Isle
Loading...
Searching...
No Matches
legoentity.cpp
Go to the documentation of this file.
1#include "legoentity.h"
2
4#include "define.h"
10#include "legogamestate.h"
11#include "legomain.h"
12#include "legoplantmanager.h"
13#include "legoutils.h"
14#include "legovideomanager.h"
15#include "legoworld.h"
16#include "misc.h"
17#include "mxmisc.h"
18#include "mxutilities.h"
19#include "realtime/realtime.h"
20
22
23// FUNCTION: LEGO1 0x100105f0
24void LegoEntity::Init()
25{
26 m_worldLocation.Fill(0);
27 m_worldDirection.Fill(0);
28 m_worldSpeed = 0;
29 m_roi = NULL;
30 m_cameraFlag = FALSE;
31 m_siFile = NULL;
32 m_unk0x10 = 0;
33 m_flags = 0;
34 m_actionType = Extra::ActionType::e_unknown;
35 m_targetEntityId = -1;
36 m_type = e_autoROI;
37}
38
39// FUNCTION: LEGO1 0x10010650
40// FUNCTION: BETA10 0x1007e39a
42{
43 LegoWorld* world = CurrentWorld();
44
45 if (world != NULL && world->GetCameraController() != NULL) {
46 m_cameraFlag = p_cameraFlag;
47
48 if (m_cameraFlag) {
49 world->GetCameraController()->SetEntity(this);
51 Mx3DPointFloat(0.0F, 1.25F, 0.0F),
52 Mx3DPointFloat(0.0F, 0.0F, 1.0F),
53 Mx3DPointFloat(0.0F, 1.0F, 0.0F)
54 );
55 }
56 else {
57 if (world->GetCameraController()->GetEntity() == this) {
60 Mx3DPointFloat(0.0F, 0.0F, 0.0F),
61 Mx3DPointFloat(0.0F, 0.0F, 1.0F),
62 Mx3DPointFloat(0.0F, 1.0F, 0.0F)
63 );
64 }
65 }
66 }
67}
68
69// FUNCTION: LEGO1 0x10010790
70// FUNCTION: BETA10 0x1007e4f6
71void LegoEntity::SetWorldTransform(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up)
72{
73 LegoWorld* world = CurrentWorld();
74
75 if (world != NULL && world->GetCameraController() != NULL) {
77 world->GetCameraController()->SetEntity(this);
78 world->GetCameraController()->SetWorldTransform(p_location, p_direction, p_up);
79 }
80}
81
82// FUNCTION: LEGO1 0x100107e0
83// FUNCTION: BETA10 0x1007e572
85{
86 m_entityId = p_dsAction.GetObjectId();
87 m_atomId = p_dsAction.GetAtomId();
88 SetWorld();
89 return SUCCESS;
90}
91
92// FUNCTION: LEGO1 0x10010810
93// FUNCTION: BETA10 0x1007e5b9
94void LegoEntity::Destroy(MxBool p_fromDestructor)
95{
96 if (m_roi) {
97 if (m_flags & c_bit1) {
98 if (m_roi->GetEntity() == this) {
100 }
101
103 }
104 else {
106 delete m_roi;
107 }
108 }
109
110 delete[] m_siFile;
111 Init();
112}
113
114// FUNCTION: LEGO1 0x10010880
115// FUNCTION: BETA10 0x1007e6e1
117{
118 LegoWorld* world = CurrentWorld();
119
120 if (world != NULL && world != (LegoWorld*) this) {
121 world->Add(this);
122 }
123}
124
125// FUNCTION: LEGO1 0x100108a0
126// FUNCTION: BETA10 0x1007e724
127void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
128{
129 m_roi = p_roi;
130
131 if (m_roi != NULL) {
132 if (p_bool2) {
133 MxMatrix mat;
138 mat
139 );
140
142 }
143
144 m_roi->SetEntity(this);
146
147 if (p_bool1) {
149 }
150 else {
152 }
153 }
154}
155
156// FUNCTION: LEGO1 0x100109b0
157// FUNCTION: BETA10 0x1007e8b8
158void LegoEntity::SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_und)
159{
160 Mx3DPointFloat direction;
162
163 direction = p_direction;
164 direction.Unitize();
165
166 up = p_up;
167 up.Unitize();
168
169 m_worldLocation = p_location;
170 m_worldDirection = direction;
171 m_worldUp = up;
172
173 if (m_roi != NULL) {
174 MxMatrix mat;
176 Mx3DPointFloat(p_location[0], p_location[1], p_location[2]),
177 Mx3DPointFloat(direction[0], direction[1], direction[2]),
178 Mx3DPointFloat(up[0], up[1], up[2]),
179 mat
180 );
181
184
185 if (p_und) {
186 FUN_10010c30();
187 }
188 }
189}
190
191// FUNCTION: LEGO1 0x10010c30
193{
194 LegoWorld* world = CurrentWorld();
195
196 if (m_cameraFlag && world && world->GetCameraController() && m_roi) {
198 }
199}
200
201// FUNCTION: LEGO1 0x10010c60
203{
204 if (m_roi != NULL) {
207 }
208
209 return m_worldDirection;
210}
211
212// FUNCTION: LEGO1 0x10010cf0
214{
215 if (m_roi != NULL) {
217 }
218
219 return m_worldUp;
220}
221
222// FUNCTION: LEGO1 0x10010d80
223// FUNCTION: BETA10 0x1007ebbe
225{
226 if (m_roi != NULL) {
229 }
230
231 return m_worldLocation;
232}
233
234// FUNCTION: LEGO1 0x10010e10
235// FUNCTION: BETA10 0x1007ec97
236void LegoEntity::ParseAction(char* p_extra)
237{
238 char copy[1024];
239 char actionValue[1024];
240 strcpy(copy, p_extra);
241
242 if (KeyValueStringParse(actionValue, g_strACTION, copy)) {
243 char* token = strtok(actionValue, g_parseExtraTokens);
244 assert(token);
246
248 token = strtok(NULL, g_parseExtraTokens);
249 assert(token);
250
251 m_siFile = new char[strlen(token) + 1];
252 assert(m_siFile);
253 strcpy(m_siFile, token);
254
256 token = strtok(NULL, g_parseExtraTokens);
257 assert(token);
258 m_targetEntityId = atoi(token);
259 }
260 }
261 }
262}
263
264// FUNCTION: LEGO1 0x10010f10
265// FUNCTION: BETA10 0x1007ee87
267{
269 MxU32 objectId = 0;
270 const char* name = m_roi->GetName();
271
272 switch (m_type) {
273 case e_actor:
274 objectId = CharacterManager()->GetSoundId(m_roi, p_und);
275 break;
276 case e_unk1:
277 break;
278 case e_plant:
279 objectId = PlantManager()->GetSoundId(this, p_und);
280 break;
281 case e_building:
282 objectId = BuildingManager()->GetSoundId(this, p_und);
283 break;
284 }
285
286 if (objectId) {
287 MxDSAction action;
288 action.SetAtomId(MxAtomId(CharacterManager()->GetCustomizeAnimFile(), e_lowerCase2));
289 action.SetObjectId(objectId);
290 action.AppendExtra(strlen(name) + 1, name);
291 Start(&action);
292 }
293 }
294}
295
296// FUNCTION: LEGO1 0x10011070
297// FUNCTION: BETA10 0x1007f062
299{
301 MxU32 objectId = 0;
302 MxDSAction action;
303 const char* name = m_roi->GetName();
304 char extra[1024];
305
306 switch (m_type) {
307 case e_actor:
310 sprintf(extra, "SUBST:actor_01:%s", name);
311 break;
312 case e_unk1:
313 break;
314 case e_plant:
317 sprintf(extra, "SUBST:bush:%s:tree:%s:flwrred:%s:palm:%s", name, name, name, name);
318 break;
319 case e_building:
321 action.SetAtomId(MxAtomId(BuildingManager()->GetCustomizeAnimFile(), e_lowerCase2));
322 sprintf(extra, "SUBST:haus1:%s", name);
323 break;
324 case e_autoROI:
325 break;
326 }
327
328 if (objectId) {
329 action.SetObjectId(objectId);
330 action.AppendExtra(strlen(extra) + 1, extra);
333 }
334 }
335}
336
337// FUNCTION: LEGO1 0x10011300
338// FUNCTION: BETA10 0x1007f35a
340{
341 switch (m_type) {
342 case e_actor:
344 break;
345 case e_unk1:
346 break;
347 case e_plant:
349 break;
350 case e_building:
352 break;
353 case e_autoROI:
354 break;
355 }
356
359}
360
361// FUNCTION: LEGO1 0x10011360
362// FUNCTION: BETA10 0x1007f411
364{
365 switch (m_type) {
366 case e_actor:
368 break;
369 case e_unk1:
370 break;
371 case e_plant:
372 PlantManager()->SwitchSound(this);
373 break;
374 case e_building:
376 break;
377 case e_autoROI:
378 break;
379 }
380
383}
384
385// FUNCTION: LEGO1 0x100113c0
386// FUNCTION: BETA10 0x1007f4c8
388{
389 switch (m_type) {
390 case e_actor:
392 break;
393 case e_unk1:
394 break;
395 case e_plant:
396 PlantManager()->SwitchMove(this);
397 break;
398 case e_building:
400 break;
401 case e_autoROI:
402 break;
403 }
404
407}
408
409// FUNCTION: LEGO1 0x10011420
410// FUNCTION: BETA10 0x1007f57f
412{
413 switch (m_type) {
414 case e_actor:
416 break;
417 case e_unk1:
418 break;
419 case e_plant:
420 PlantManager()->SwitchColor(this);
421 break;
422 case e_building:
423 break;
424 case e_autoROI:
425 break;
426 }
427
430}
431
432// FUNCTION: LEGO1 0x10011470
433// FUNCTION: BETA10 0x1007f62c
435{
436 switch (m_type) {
437 case e_actor:
439 break;
440 case e_unk1:
441 break;
442 case e_plant:
443 PlantManager()->SwitchMood(this);
444 break;
445 case e_building:
447 break;
448 case e_autoROI:
449 break;
450 }
451
455}
456
457// FUNCTION: LEGO1 0x100114e0
458// FUNCTION: BETA10 0x1007f6f0
460{
461 m_type = p_type;
462}
463
464// FUNCTION: LEGO1 0x100114f0
465// FUNCTION: BETA10 0x1007f711
467{
469
470 if (param.GetNotification() != c_notificationClick) {
471 return 0;
472 }
473
476 }
477 else {
478 switch (GameState()->GetActorId()) {
480 if (GameState()->GetCurrentAct() != LegoGameState::e_act2 &&
481 GameState()->GetCurrentAct() != LegoGameState::e_act3) {
483 }
484 break;
486 SwitchSound();
487 break;
489 SwitchMove();
490 break;
492 SwitchColor(param.GetROI());
493 break;
495 SwitchMood();
496 break;
498 switch (m_type) {
499 case e_actor:
500 case e_unk1:
501 break;
502 case e_plant:
503 PlantManager()->FUN_10026c50(this);
504 break;
505 case e_building:
507 break;
508 case e_autoROI:
509 break;
510 }
511 }
512 }
513
514 return 1;
515}
BOOL Moved(ViewROI &rROI)
[AI] Notifies the manager that the ROI has moved and needs spatial update.
BOOL Remove(ViewROI &rROI)
[AI] Removes a ViewROI from the scene.
@ c_nick
Nick ([AI])
Definition: legoactor.h:20
@ c_laura
Laura ([AI])
Definition: legoactor.h:21
@ c_mama
Mama ([AI])
Definition: legoactor.h:18
@ c_brickster
The Brickster ([AI])
Definition: legoactor.h:22
@ c_pepper
Pepper Roni ([AI])
Definition: legoactor.h:17
@ c_papa
Papa ([AI])
Definition: legoactor.h:19
MxResult StartEntityAction(MxDSAction &p_dsAction, LegoEntity *p_entity)
[AI] Starts a DSAction for a specific entity, managing controller/actor logic if relevant.
MxBool SwitchSound(LegoEntity *p_entity)
[AI] Cycles the current active sound for a building (if sounds available).
MxBool SwitchMove(LegoEntity *p_entity)
[AI] Cycles the current move/animation state for a building (if moves available).
MxBool SwitchVariant(LegoEntity *p_entity)
[AI] Attempts to switch the building variant for the specified entity (e.g.
MxBool SwitchMood(LegoEntity *p_entity)
[AI] Cycles the current mood state for a building (if moods available, mood in 0.....
MxU32 GetSoundId(LegoEntity *p_entity, MxBool p_state)
[AI] Returns the sound id for a building entity, using either mood or active sound state.
MxBool FUN_10030000(LegoEntity *p_entity)
[AI] Attempts to "progress" demolition/animation of a building entity by calling FUN_10030030 on its ...
MxU32 GetAnimationId(LegoEntity *p_entity)
[AI] Returns the animation id for a building entity, factoring in base animation id and move offset.
void SetWorldTransform(const Vector3 &p_at, const Vector3 &p_dir, const Vector3 &p_up)
Updates the camera's world transformation matrix using view reference parameters.
void FUN_100123e0(const Matrix4 &p_transform, MxU32 p_und)
Sets the camera's transformation matrix in the 3D view, optionally applying a blend with the internal...
MxBool SwitchMood(LegoROI *p_roi)
[AI] Cycles the mood type for the actor, updating the per-actor info.
MxU32 GetSoundId(LegoROI *p_roi, MxBool p_und)
[AI] Returns the sound ID for the ROI's current sound/mood selection.
static const char * GetCustomizeAnimFile()
[AI] Gets the value of the customize animation file variable.
void ReleaseActor(const char *p_name)
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
MxBool SwitchColor(LegoROI *p_roi, LegoROI *p_targetROI)
[AI] Changes the color of a part of a character's ROI, updating its part info index and updating ROI ...
MxBool SwitchSound(LegoROI *p_roi)
[AI] Cycles the sound type for the actor, updating the per-actor info.
MxBool SwitchVariant(LegoROI *p_roi)
[AI] Cycles through part variants (e.g.
MxBool SwitchMove(LegoROI *p_roi)
[AI] Cycles the move type for the actor, updating the per-actor info.
MxU32 GetAnimationId(LegoROI *p_roi)
[AI] Returns an animation ID corresponding to the ROI's move index.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
MxBool GetUnknown0x10IsSet(MxU8 p_flag)
[AI] Checks if a bit flag in m_unk0x10 is set (purpose: state/animation suppression lock).
Definition: legoentity.h:148
void Init()
[AI] Initializes the entity's members to default/neutral values (utility for constructors and resets)...
Definition: legoentity.cpp:24
void SetFlag(MxU8 p_flag)
[AI] Sets the given flag in the flags byte.
Definition: legoentity.h:175
virtual void SetROI(LegoROI *p_roi, MxBool p_bool1, MxBool p_bool2)
[AI] Assigns a 3D ROI (3D object instance) to this entity, controlling how it appears/acts in the wor...
Definition: legoentity.cpp:127
void SetLocation(const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up, MxBool p_und)
[AI] Sets the world-space location, direction, and up, applying normalization and transformation.
Definition: legoentity.cpp:158
virtual void SwitchSound()
[AI] Triggers a context-dependent audio/sound variant switch for this entity. [AI]
Definition: legoentity.cpp:363
Mx3DPointFloat GetWorldDirection()
[AI] Gets the normalized world-space direction vector, optionally updating from ROI....
Definition: legoentity.cpp:202
virtual void ClickSound(MxBool p_und)
[AI] Plays a click sound, typically in response to user/AI actions, according to entity type.
Definition: legoentity.cpp:266
virtual void Destroy(MxBool p_fromDestructor)
[AI] Cleans up the entity, detaching ROI and releasing references.
Definition: legoentity.cpp:94
MxS32 m_targetEntityId
[AI] When parsing ACTION command, this is the target entity ID for the action (or -1 for none)....
Definition: legoentity.h:231
virtual void SwitchColor(LegoROI *p_roi)
[AI] Switches the color or texture variant for this entity (or target ROI).
Definition: legoentity.cpp:411
MxU8 m_type
[AI] The entity type (Type enum value). [AI]
Definition: legoentity.h:221
Mx3DPointFloat m_worldDirection
[AI] Entity direction vector in world space (normalized). [AI]
Definition: legoentity.h:206
void FUN_10010c30()
[AI] Updates the camera transformation when this entity is the camera target. Used after movement or ...
Definition: legoentity.cpp:192
MxBool m_cameraFlag
[AI] Set to TRUE if this entity is currently the camera target. [AI]
Definition: legoentity.h:218
char * m_siFile
[AI] When parsing ACTION command, this is the SI script/filename to execute (owned,...
Definition: legoentity.h:228
Mx3DPointFloat m_worldLocation
[AI] Entity location in world coordinates. [AI]
Definition: legoentity.h:203
virtual MxResult Create(MxDSAction &p_dsAction)
[AI] Initializes the entity from a DSAction object, typically from a script or file load.
Definition: legoentity.cpp:84
void ClearFlag(MxU8 p_flag)
[AI] Clears the given flag in the flags byte.
Definition: legoentity.h:179
MxLong Notify(MxParam &p_param) override
[AI] Handles event notification for the entity, most notably user clicks, using polymorphic dispatch.
Definition: legoentity.cpp:466
virtual void ResetWorldTransform(MxBool p_cameraFlag)
[AI] Resets the transformation for this entity (e.g., used with camera transitions).
Definition: legoentity.cpp:41
Mx3DPointFloat m_worldUp
[AI] Entity up vector in world space (normalized). [AI]
Definition: legoentity.h:209
virtual void SwitchMove()
[AI] Switches movement/animation variant for this entity, if applicable (e.g., walking/running state)...
Definition: legoentity.cpp:387
Extra::ActionType m_actionType
[AI] Action type, parsed from script/extra string (e.g., openram/run/exit); guides Notify() and click...
Definition: legoentity.h:224
virtual void SetWorldTransform(const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up)
[AI] Explicitly sets the world transformation (location, direction, up vector) for this entity.
Definition: legoentity.cpp:71
LegoROI * m_roi
[AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI]
Definition: legoentity.h:215
MxU8 m_flags
[AI] Primary entity flags (bitfield); tracks per-entity management status, internal update locks,...
Definition: legoentity.h:200
virtual void SwitchMood()
[AI] Triggers a mood/state switch for this entity (if supported), often for characters....
Definition: legoentity.cpp:434
void SetType(MxU8 p_type)
[AI] Sets the entity's type (actor/plant/building/etc.) [AI]
Definition: legoentity.cpp:459
Mx3DPointFloat GetWorldUp()
[AI] Gets the normalized world-space up vector, optionally updating from ROI. [AI]
Definition: legoentity.cpp:213
virtual void SwitchVariant()
[AI] Switches variants for this entity (e.g., different animation, mesh, or texture variant),...
Definition: legoentity.cpp:339
virtual void ParseAction(char *p_extra)
[AI] Parses an action description string (usually from script "extra" data) and sets up this entity's...
Definition: legoentity.cpp:236
@ e_plant
[AI] Plant objects in the game (e.g., trees or bushes) [AI]
Definition: legoentity.h:22
@ e_unk1
[AI_SUGGESTED_NAME: e_unknown1] Reserved or unused, purpose unclear [AI]
Definition: legoentity.h:21
@ e_autoROI
[AI] Catchall for ROI-adapted/unknown entities [AI]
Definition: legoentity.h:24
@ e_building
[AI] Building entities, usually interactable or decorations [AI]
Definition: legoentity.h:23
@ e_actor
[AI] Standard character entity controlled by scripts or user [AI]
Definition: legoentity.h:20
@ c_altBit1
[AI] Used to prevent repeat sound/animation actions while one is in progress [AI]
Definition: legoentity.h:35
void SetWorld()
[AI] Registers/attaches this entity to the current world if not already; called on create or location...
Definition: legoentity.cpp:116
@ c_bit1
[AI] Used internally for ROI/entity ownership tracking [AI]
Definition: legoentity.h:29
virtual void ClickAnimation()
[AI] Plays a context-sensitive click animation, driven by current entity type and state....
Definition: legoentity.cpp:298
MxU8 m_unk0x10
[AI] Unknown state/flag, used mainly to guard against repeated actions or manage animation/sound stat...
Definition: legoentity.h:197
Mx3DPointFloat GetWorldPosition()
[AI] Gets the world-space position vector, optionally updating from ROI. [AI]
Definition: legoentity.cpp:224
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
LegoROI * GetROI()
Returns the ROI (3D Object) associated with this event, if any.
@ e_act3
Act 3: final main story segment. [AI].
Definition: legogamestate.h:86
@ e_act2
Act 2: main story segment two. [AI].
Definition: legogamestate.h:85
LegoCharacterManager * GetCharacterManager()
[AI] Returns character manager, handling population and logic for all in-world characters.
Definition: legomain.h:437
LegoAnimationManager * GetAnimationManager()
[AI] Returns animation manager for managing character/world animations.
Definition: legomain.h:395
LegoBuildingManager * GetBuildingManager()
[AI] Returns building manager (handles in-world structures and their logic).
Definition: legomain.h:401
LegoPlantManager * GetPlantManager()
[AI] Returns active plant manager, which tracks in-world plants/objects.
Definition: legomain.h:389
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
Definition: legomain.cpp:305
MxBool SwitchSound(LegoEntity *p_entity)
[AI] Cycles the sound effect variant for a plant.
static const char * GetCustomizeAnimFile()
[AI] Gets the current file name/path for plant customization animation file.
MxBool SwitchColor(LegoEntity *p_entity)
[AI] Cycles the color attribute for the plant and updates its LOD/appearance.
MxBool SwitchVariant(LegoEntity *p_entity)
[AI] Cycles the variant/type for a plant (flower, tree, bush, palm) and updates appearance.
MxU32 GetSoundId(LegoEntity *p_entity, MxBool p_state)
[AI] Returns the sound ID for a plant, used for localized SFX depending on mood/state.
MxBool FUN_10026c50(LegoEntity *p_entity)
[AI] Triggers a growth decrement or similar on a plant entity, and updates accordingly if possible.
MxBool SwitchMood(LegoEntity *p_entity)
[AI] Cycles the plant's "mood" state property (e.g., for appearance/hidden states) [AI]
MxU32 GetAnimationId(LegoEntity *p_entity)
[AI] Returns the current animation ID for the given plant, based on its variant and move type.
MxBool SwitchMove(LegoEntity *p_entity)
[AI] Cycles the movement/animation type for a plant.
virtual void SetEntity(LegoEntity *p_entity)
[AI] Assign the entity which this controller operates on, typically to associate the point of view wi...
LegoEntity * GetEntity()
[AI] Accessor for the currently attached entity.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
void SetEntity(LegoEntity *p_entity)
[AI] Associates a LegoEntity with this ROI (typically called by parent entity/logic).
Definition: legoroi.h:305
const LegoChar * GetName() const
[AI] Gets this ROI's name.
Definition: legoroi.h:287
LegoEntity * GetEntity()
[AI] Gets the entity associated with this ROI (or NULL).
Definition: legoroi.h:293
Lego3DManager * Get3DManager()
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view con...
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
Definition: legoworld.cpp:418
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
Definition: legoworld.h:277
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
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
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
Definition: mxentity.h:124
MxS32 m_entityId
The unique entity ID, typically used for lookup and reference.
Definition: mxentity.h:119
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
const float * GetWorldUp() const
Returns a pointer to the world up vector from the transformation matrix.
const float * GetWorldPosition() const
Returns a pointer to the world position from the transformation matrix (translation row).
const float * GetWorldDirection() const
Returns a pointer to the world direction vector (forward axis) from the transformation matrix.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
void UpdateTransformationRelativeToParent(const Matrix4 &p_transform)
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldDa...
virtual int Unitize()
[AI] Scales the vector so its norm is 1 (unit vector).
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
const char * g_strACTION
[AI] Used as the key for defining an action or command block in game scripts.
Definition: define.cpp:5
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
Definition: define.cpp:141
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
Definition: legoutils.cpp:271
Extra::ActionType MatchActionString(const char *)
[AI] Parses an action string to determine the corresponding action type.
Definition: legoutils.cpp:228
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
Definition: misc.cpp:101
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
Definition: misc.cpp:123
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
Definition: misc.cpp:115
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
@ e_lowerCase2
[AI] Alternative or legacy lower case mode, functionally equivalent to e_lowerCase.
Definition: mxatom.h:109
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
Definition: mxmisc.cpp:97
@ c_notificationClick
[AI] Mouse click event [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
Definition: mxutilities.cpp:85
void CalcLocalTransform(const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
[AI] Computes a transformation matrix based on a position, direction, and up vector.
Definition: realtime.cpp:7
@ e_exit
[AI] Exit an activity, context or resource [AI]
Definition: extra.h:33
@ e_run
[AI] Run (execute) an operation [AI]
Definition: extra.h:32
@ e_unknown
[AI] Unrecognized or unclassified action [AI]
Definition: extra.h:37