resonance 1.0.1
Loading...
Searching...
No Matches
freqpart.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/color.h"
4#include "math/vector2.h"
5#include "math/vector3.h"
6
8namespace Rnd {
9class Mesh;
10}
11
25class FreqPart {
26public:
32 struct Packed {
33 short mId;
34 short mX;
35 short mZ;
36 unsigned char mPaletteX;
37 unsigned char mPaletteY;
38 };
39
47
55 explicit FreqPart(FreqPartTemplate *pTemplate);
56
64 FreqPart(const FreqPart &other);
65
73
86 void operator=(const FreqPart &other);
87
97 Rnd::Mesh *GetMesh() const {
98 return mMesh;
99 }
100
108 void SetMesh(Rnd::Mesh *pMesh);
109
121 return &mColor;
122 }
123
133 void SetColor(const Color &color);
134
143 void Reset();
144
154 void Pack(Packed *pOut);
155
166 void Unpack(const Packed &packed);
167
175
176private:
177 // Not written by any recovered routine.
178 unsigned char mPositionAlignment[0xc]; // +0x04, the quadword alignment of mPosition
179
180public:
188
196
204
205private:
206 Rnd::Mesh *mMesh; // +0x2c
207 Color mColor; // +0x30
208};
One kind of part the FreQ maker offers, shared by every FreqPart placed from it.
Definition freqparttemplate.h:25
FreqPartTemplate * mTemplate
The template this part is an instance of.
Definition freqpart.h:174
void Pack(Packed *pOut)
Write the transfer form.
Vector3 mPosition
The placement.
Definition freqpart.h:187
void Reset()
Clear every member without deleting the mesh.
void SetMesh(Rnd::Mesh *pMesh)
Replace the mesh, deleting the one this part had.
void SetColor(const Color &color)
Record a colour and apply it to the mesh.
Vector2 mPalettePosition
The palette position the colour is taken from, (-1, -1) while unset.
Definition freqpart.h:203
int mMirrored
Non-zero when the part is mirrored.
Definition freqpart.h:195
FreqPart()
Construct a part with no template, run through Reset().
void operator=(const FreqPart &other)
Copy another part, cloning a fresh mesh from the other part's mesh.
FreqPart(FreqPartTemplate *pTemplate)
Construct a part of one template at the origin.
Rnd::Mesh * GetMesh() const
Report the mesh.
Definition freqpart.h:97
FreqPart(const FreqPart &other)
Copy another part through operator=().
Color * GetColor()
Report the colour the mesh is drawn in.
Definition freqpart.h:120
void Unpack(const Packed &packed)
Read the transfer form.
~FreqPart()
Delete the mesh.
Indexed triangle mesh with one material.
Definition mesh.h:46
The rendering engine.
Definition animhelper.h:3
Linear colour with four float components.
Definition color.h:10
Eight-byte transfer form of a part that Pack() writes and Unpack() reads.
Definition freqpart.h:32
unsigned char mPaletteY
Definition freqpart.h:37
short mX
Definition freqpart.h:34
short mId
Definition freqpart.h:33
short mZ
Definition freqpart.h:35
unsigned char mPaletteX
Definition freqpart.h:36
Two-component vector, used for texture coordinates.
Definition vector2.h:10
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:12