Isle
Loading...
Searching...
No Matches
mxdsaction.h
Go to the documentation of this file.
1#ifndef MXDSACTION_H
2#define MXDSACTION_H
3
4#include "mxdsobject.h"
6#include "mxtypes.h"
7
8class MxOmni;
9
10// VTABLE: LEGO1 0x100dc098
11// VTABLE: BETA10 0x101c1b68
12// SIZE 0x94
17class MxDSAction : public MxDSObject {
18public:
20 enum {
21 c_looping = 0x01,
22 c_bit3 = 0x04,
23 c_bit4 = 0x08,
24 c_bit5 = 0x10,
25 c_enabled = 0x20,
26 c_bit7 = 0x40,
27 c_world = 0x80,
28 c_bit9 = 0x100,
29 c_bit10 = 0x200,
30 c_bit11 = 0x400,
31 };
32
37 MxDSAction();
38
43 ~MxDSAction() override;
44
49 MxDSAction(MxDSAction& p_dsAction);
50
55 void CopyFrom(MxDSAction& p_dsAction);
56
62 MxDSAction& operator=(MxDSAction& p_dsAction);
63
68 const char* ClassName() const override // vtable+0x0c
69 {
70 // STRING: LEGO1 0x101013f4
71 return "MxDSAction";
72 }
73
80 MxBool IsA(const char* p_name) const override // vtable+0x10
81 {
82 return !strcmp(p_name, MxDSAction::ClassName()) || MxDSObject::IsA(p_name);
83 }
84
89 undefined4 VTable0x14() override;
90
95 MxU32 GetSizeOnDisk() override;
96
103 void Deserialize(MxU8*& p_source, MxS16 p_unk0x24) override;
104
109 virtual MxLong GetDuration();
110
115 virtual void SetDuration(MxLong p_duration);
116
121 virtual MxDSAction* Clone();
122
128 virtual void MergeFrom(MxDSAction& p_dsAction);
129
135 virtual MxBool HasId(MxU32 p_objectId);
136
141 virtual void SetUnknown90(MxLong p_unk0x90);
142
147 virtual MxLong GetUnknown90();
148
153 virtual MxLong GetElapsedTime();
154
161 void AppendExtra(MxU16 p_extraLength, const char* p_extraData);
162
168 void GetExtra(MxU16& p_extraLength, char*& p_extraData)
169 {
170 p_extraLength = m_extraLength;
171 p_extraData = m_extraData;
172 }
173
177 MxU32 GetFlags() { return m_flags; }
178
183 void SetFlags(MxU32 p_flags) { m_flags = p_flags; }
184
188 char* GetExtraData() { return m_extraData; }
189
194
198 MxLong GetStartTime() const { return m_startTime; }
199
204
209 void SetLoopCount(MxS32 p_loopCount) { m_loopCount = p_loopCount; }
210
215 const Vector3& GetLocation() { return m_location; }
216
220 const Vector3& GetDirection() { return m_direction; }
221
225 const Vector3& GetUp() { return m_up; }
226
231 void SetLocation(const Vector3& p_location) { m_location = p_location; }
232
237 void SetDirection(const Vector3& p_direction) { m_direction = p_direction; }
238
243 void SetUp(const Vector3& p_up) { m_up = p_up; }
244
249
254 void SetUnknown84(MxCore* p_unk0x84) { m_unk0x84 = p_unk0x84; }
255
259 MxCore* GetOrigin() { return m_origin; }
260
265 void SetOrigin(MxCore* p_origin) { m_origin = p_origin; }
266
270 MxBool IsLooping() const { return m_flags & c_looping; }
271
275 MxBool IsBit3() const { return m_flags & c_bit3; }
276
277 // SYNTHETIC: LEGO1 0x100ada60
278 // SYNTHETIC: BETA10 0x1012be40
279 // MxDSAction::`scalar deleting destructor'
280
281protected:
286
290 MxU32 m_flags; // 0x30
291
296
301
306
311
316
321
325 char* m_extraData; // 0x7c
326
331
336
341
345 MxCore* m_origin; // 0x8c
346
351};
352
353#endif // MXDSACTION_H
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
char * GetExtraData()
[AI] Accessor for extra data (not null-terminated).
Definition: mxdsaction.h:188
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
Definition: mxdsaction.h:177
undefined4 VTable0x14() override
[AI] Unknown virtual placeholder, possibly for additional interfaces.
Definition: mxdsaction.cpp:106
virtual void SetDuration(MxLong p_duration)
[AI] Sets the duration of this action in ticks or time units.
Definition: mxdsaction.cpp:46
MxU32 GetSizeOnDisk() override
[AI] Serializes the size on disk of this action (all fields + extra data length)
Definition: mxdsaction.cpp:113
undefined4 m_unk0x88
[AI] 4 bytes at 0x88; usage not known.
Definition: mxdsaction.h:340
void SetLocation(const Vector3 &p_location)
[AI] Sets the location vector for this action.
Definition: mxdsaction.h:231
MxDSAction & operator=(MxDSAction &p_dsAction)
[AI] Assignment operator: deep-copy from a different MxDSAction, including base class data and extra ...
Definition: mxdsaction.cpp:133
MxLong GetStartTime() const
[AI] Gets the nominal start time for the action, as loaded or scheduled.
Definition: mxdsaction.h:198
MxBool IsLooping() const
[AI] Whether this action is set to loop based on current flags.
Definition: mxdsaction.h:270
virtual MxBool HasId(MxU32 p_objectId)
[AI] Checks if this action contains/was created for a specific SI object id.
Definition: mxdsaction.cpp:53
char * m_extraData
[AI] Opaque extra data for custom or extended behavior.
Definition: mxdsaction.h:325
MxCore * GetUnknown84()
[AI] Returns a pointer to an associated or auxiliary core object.
Definition: mxdsaction.h:248
void CopyFrom(MxDSAction &p_dsAction)
[AI] Copies all properties from another MxDSAction (deep copy, including extra data string)
Definition: mxdsaction.cpp:81
MxBool IsBit3() const
[AI] Tests for the state of the (unknown purpose) bit 3 flag in m_flags.
Definition: mxdsaction.h:275
const char * ClassName() const override
[AI] Returns the class name for RTTI or reflection purposes.
Definition: mxdsaction.h:68
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
Definition: mxdsaction.h:168
void Deserialize(MxU8 *&p_source, MxS16 p_unk0x24) override
[AI] Deserializes this action's data from a binary buffer.
Definition: mxdsaction.cpp:259
Mx3DPointFloat m_up
[AI] "Up" vector for this action.
Definition: mxdsaction.h:320
MxS32 GetLoopCount()
[AI] Returns the loop count for this action.
Definition: mxdsaction.h:203
virtual void SetUnknown90(MxLong p_unk0x90)
[AI] Set unknown value at offset 0x90, used as baseline in GetElapsedTime.
Definition: mxdsaction.cpp:60
MxBool IsA(const char *p_name) const override
[AI] Run-time type check, compares provided name with this or any ancestor type.
Definition: mxdsaction.h:80
MxDSAction()
[AI] Default constructor.
Definition: mxdsaction.cpp:19
virtual MxLong GetUnknown90()
[AI] Gets the unknown value at offset 0x90, likely a start timestamp.
Definition: mxdsaction.cpp:67
void SetDirection(const Vector3 &p_direction)
[AI] Sets the direction vector for this action.
Definition: mxdsaction.h:237
void SetOrigin(MxCore *p_origin)
[AI] Sets the origin core pointer for this action, if spatially transforming/localizing this action.
Definition: mxdsaction.h:265
MxS32 m_loopCount
[AI] Number of times to repeat the action, or -1 for infinite/not-set.
Definition: mxdsaction.h:305
MxU32 m_flags
[AI] Bitfield for flags (enabled, looping, etc).
Definition: mxdsaction.h:290
Mx3DPointFloat m_location
[AI] Location in 3D world or local space (x, y, z).
Definition: mxdsaction.h:310
const Vector3 & GetLocation()
[AI] Gets the location vector for this action (world or local space).
Definition: mxdsaction.h:215
MxCore * m_origin
[AI] Pointer to an "origin" MxCore object, for spatial/ownership reference.
Definition: mxdsaction.h:345
void AppendExtra(MxU16 p_extraLength, const char *p_extraData)
[AI] Concatenates or stores extra data associated with this action, robust for multi-part actions.
Definition: mxdsaction.cpp:225
void SetFlags(MxU32 p_flags)
[AI] Sets the flag bitmask controlling action logic (enabled, looping, etc).
Definition: mxdsaction.h:183
const Vector3 & GetUp()
[AI] Gets the up vector for this action (global or local).
Definition: mxdsaction.h:225
MxU16 m_extraLength
[AI] Length of extra data in bytes.
Definition: mxdsaction.h:330
const Vector3 & GetDirection()
[AI] Gets the direction vector (typically forward vector) for this action.
Definition: mxdsaction.h:220
virtual MxLong GetDuration()
[AI] Gets the duration for which this action is intended to run.
Definition: mxdsaction.cpp:39
MxLong m_duration
[AI] The duration to run the action, or INT_MIN for undefined.
Definition: mxdsaction.h:300
virtual MxLong GetElapsedTime()
[AI] Gets elapsed time for this action since the last time field 0x90 was set.
Definition: mxdsaction.cpp:159
MxCore * m_unk0x84
[AI] Pointer to an auxiliary MxCore object, purpose unknown.
Definition: mxdsaction.h:335
MxU16 GetExtraLength() const
[AI] Returns the length (in bytes) of extra data.
Definition: mxdsaction.h:193
MxLong m_startTime
[AI] Time at which the action is meant to start, or INT_MIN for unset.
Definition: mxdsaction.h:295
void SetUnknown84(MxCore *p_unk0x84)
[AI] Sets the auxiliary core pointer for this action.
Definition: mxdsaction.h:254
void SetLoopCount(MxS32 p_loopCount)
[AI] Sets the loop count for this action.
Definition: mxdsaction.h:209
void SetUp(const Vector3 &p_up)
[AI] Sets the up vector for this action.
Definition: mxdsaction.h:243
virtual MxDSAction * Clone()
[AI] Clones (deep-copies) this action and returns a new pointer.
Definition: mxdsaction.cpp:146
virtual void MergeFrom(MxDSAction &p_dsAction)
[AI] Copies/merges properties from another action.
Definition: mxdsaction.cpp:166
MxCore * GetOrigin()
[AI] Returns a pointer to the "origin" core object, which may be used to localize the action.
Definition: mxdsaction.h:259
@ c_looping
[AI] Action or media should repeat in a loop [AI]
Definition: mxdsaction.h:21
@ c_bit5
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:24
@ c_world
[AI] Action is described in world-space coordinates [AI]
Definition: mxdsaction.h:27
@ c_enabled
[AI] Action is currently enabled [AI]
Definition: mxdsaction.h:25
@ c_bit11
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:30
@ c_bit10
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:29
@ c_bit7
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:26
@ c_bit3
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:22
@ c_bit4
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:23
@ c_bit9
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:28
MxU32 m_sizeOnDisk
[AI] The size of this action's fields on disk, not counting ancestor size.
Definition: mxdsaction.h:285
MxLong m_unk0x90
[AI] Unknown field, appears to store a timestamp for GetElapsedTime logics.
Definition: mxdsaction.h:350
~MxDSAction() override
[AI] Destructor.
Definition: mxdsaction.cpp:74
Mx3DPointFloat m_direction
[AI] "Forward" direction vector for this action.
Definition: mxdsaction.h:315
[AI] Base class for any object deserialized from an SI (script/data) file in the LEGO Island engine.
Definition: mxdsobject.h:44
MxBool IsA(const char *p_name) const override
[AI] Runtime type check; supports derived/parent class lookup by name.
Definition: mxdsobject.h:97
[AI] Central subsystem coordinator and singleton of the LEGO Island engine.
Definition: mxomni.h:32
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
#define override
Definition: compat.h:21
unsigned int undefined4
Definition: decomp.h:28
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32