Isle
Loading...
Searching...
No Matches
legoanimpresenter.h
Go to the documentation of this file.
1#ifndef LEGOANIMPRESENTER_H
2#define LEGOANIMPRESENTER_H
3
4#include "legoroilist.h"
5#include "mxatom.h"
6#include "mxvideopresenter.h"
7
13class LegoAnim;
14
20class LegoWorld;
21
28
29class MxMatrix;
30class Vector3;
31
38 MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
39};
40
47 MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
48};
49
59};
60
66typedef map<const char*, LegoAnimStruct, LegoAnimStructComparator> LegoAnimStructMap;
67
73typedef map<const char*, const char*, LegoAnimSubstComparator> LegoAnimSubstMap;
74
95public:
102 enum {
104 c_mustSucceed = 0x02
105 };
106
111
115 ~LegoAnimPresenter() override;
116
121 static const char* HandlerClassName();
122
127 const char* ClassName() const override;
128
134 MxBool IsA(const char* p_name) const override;
135
139 void ReadyTickle() override;
140
144 void StartingTickle() override;
145
149 void StreamingTickle() override;
150
154 void DoneTickle() override;
155
159 void ParseExtra() override;
160
165 MxResult AddToManager() override;
166
170 void Destroy() override;
171
178 MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override;
179
183 void EndAction() override;
184
188 void PutFrame() override;
189
195 virtual MxResult CreateAnim(MxStreamChunk* p_chunk);
196
200 virtual void VTable0x8c();
201
205 virtual void VTable0x90();
206
217 virtual MxU32 VTable0x94(Vector3& p_v1, Vector3& p_v2, float p_f1, float p_f2, Vector3& p_v3);
218
224 virtual MxResult VTable0x98(LegoPathBoundary* p_boundary);
225
231 virtual LegoROI** GetROIMap(MxU32& p_roiMapSize);
232
237 virtual void VTable0xa0(Matrix4& p_matrix);
238
245 MxResult FUN_1006afc0(MxMatrix*& p_matrix, float p_und);
246
253
257 void FUN_1006c7a0();
258
263 const char* GetActionObjectName();
264
269 void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
270
275
280 void SetUnknown0xa0(Matrix4* p_unk0xa0) { m_unk0xa0 = p_unk0xa0; }
281
287
288protected:
292 void Init();
293
298 void Destroy(MxBool p_fromDestructor);
299
305 LegoChar* FUN_10069150(const LegoChar* p_und1);
306
310 void FUN_100692b0();
311
315 void FUN_100695c0();
316
323 LegoChar* FUN_100697c0(const LegoChar* p_und1, const LegoChar* p_und2);
324
331 LegoBool FUN_100698b0(const CompoundObject& p_rois, const LegoChar* p_und2);
332
338 LegoROI* FUN_100699e0(const LegoChar* p_und);
339
343 void FUN_10069b10();
344
351 void FUN_1006a3c0(LegoAnimStructMap& p_map, LegoTreeNode* p_node, LegoROI* p_roi);
352
360 void FUN_1006a4f0(LegoAnimStructMap& p_map, LegoAnimNodeData* p_data, const LegoChar* p_und, LegoROI* p_roi);
361
365 void FUN_1006aa60();
366
370 void FUN_1006ab70();
371
376
383 MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi);
384
388 void SubstituteVariables();
389
396 void FUN_1006b900(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
397
404 void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
405
410 void FUN_1006c8a0(MxBool p_bool);
411
417
423
428
433
439
445
450
456
461
467
472
476 char** m_unk0x90;
477
482
487
492
497
502
507
512
513public:
517 float m_unk0xa4;
518
523};
524
525#endif // LEGOANIMPRESENTER_H
[AI] Holds per-node animation data for a model's animation tree.
Definition: legoanim.h:144
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
MxBool m_unk0x96
[AI] Boolean/mode: influences actor release vs animation manager cleanup selection (see FUN_1006ab70)...
MxS16 m_unk0x9c
[AI] Int16 state flag, set via SetUnknown0x0cTo1().
LegoROIList * m_unk0x70
[AI] List of ROIs used during preprocessing, actor matching, or variable substitution (purpose varies...
void Init()
[AI] Allocates and resets all internal presenter state.
void StartingTickle() override
[AI] Called at the "Starting" tickle state.
char ** m_unk0x90
[AI] Array of char* names used for selecting camera attached ROIs (from ptatcam extra parameter).
LegoROI * FUN_100699e0(const LegoChar *p_und)
[AI] Looks up an ROI in m_unk0x70 by substituted name.
MxU32 m_flags
[AI] Animation presenter flags (hide-on-stop, must-succeed, etc).
void FUN_1006c8a0(MxBool p_bool)
[AI] Enables or disables internal state (LegoEntity c_altBit1) on all animated entities.
void FUN_10069b10()
[AI] Builds mapping from animation node data names to ROIs, fills m_roiMap and m_roiMapSize.
LegoBool FUN_1006aba0()
[AI] Returns TRUE if every animation actor/ROI node is bound successfully.
const char * ClassName() const override
[AI] RTTI name for the presenter ("LegoAnimPresenter"), used for string-based identification.
void ParseExtra() override
[AI] Extra data parser for animation presenter.
virtual MxResult CreateAnim(MxStreamChunk *p_chunk)
[AI] Creates/loads the LegoAnim resource instance from a stream chunk buffer.
virtual MxU32 VTable0x94(Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3)
[AI] Tests if a swept segment (defined by v1, v2, f1, f2) collides any of this presenter's animated R...
virtual void VTable0x90()
[AI] Virtual callback for future expansion.
virtual void VTable0x8c()
[AI] Virtual callback for future expansion.
@ c_hideOnStop
Hide animated objects after stopping [AI].
@ c_mustSucceed
Require all animation targets be satisfied [AI].
MxBool IsA(const char *p_name) const override
[AI] Checks if this or a parent class matches the given type name for RTTI.
undefined m_unk0x97
[AI] Unknown/unused byte, for possible explicit alignment or hidden flag.
void FUN_1006aa60()
[AI] Releases all actors in m_unk0x74 via CharacterManager, respecting state flag m_unk0x96.
LegoROI ** m_unk0x8c
[AI] Lookup array for secondary ROI objects (used for e.g.
LegoAnim * m_anim
[AI] Animation resource currently being played back.
void ReadyTickle() override
[AI] Called when the presenter is in the "Ready" tickle state.
Mx3DPointFloat m_unk0xa8
[AI] 3D float property, used for animation base position offset.
void SetUnknown0x0cTo1()
[AI] Sets the value of internal flag m_unk0x9c to 1.
MxU32 m_roiMapSize
[AI] Number of valid entries in m_roiMap (excluding 0th index).
virtual void VTable0xa0(Matrix4 &p_matrix)
[AI] Sets the baseline transform for the animation.
float m_unk0xa4
[AI] Animation touch radius for path boundary checks and state (set from resource).
LegoAnimSubstMap * m_substMap
[AI] Table of macro/variable substitutions to apply before animation begins (from resource "subst" fi...
void Destroy() override
[AI] Releases all internal resources, actors, maps, and presenter state.
LegoChar * FUN_10069150(const LegoChar *p_und1)
[AI] [Internal] String construction utility used in actor/ROI naming substitution.
void FUN_1006a3c0(LegoAnimStructMap &p_map, LegoTreeNode *p_node, LegoROI *p_roi)
[AI] Recursive helper for building ROI map: walks animation node tree, matching names to ROIs at each...
void EndAction() override
[AI] Completes playback action, triggers world notification and resets/hides all animated actors depe...
void FUN_1006a4f0(LegoAnimStructMap &p_map, LegoAnimNodeData *p_data, const LegoChar *p_und, LegoROI *p_roi)
[AI] Helper to insert an animation node's data into the map (adding new struct if not already inserte...
void FUN_1006b900(LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
[AI] Steps animation nodes to 'p_time' using transform 'p_matrix', using fast path for tree traversal...
MxS32 m_worldId
[AI] Numeric world ID for world selection/lookup.
void FUN_100692b0()
[AI] Populates m_unk0x74 with all relevant ROIs/actors for this animation by iterating actors in the ...
void SubstituteVariables()
[AI] Applies all queued variable substitutions in the animation resource by setting corresponding Var...
LegoChar * FUN_100697c0(const LegoChar *p_und1, const LegoChar *p_und2)
[AI] Returns a composed name string for combining variable substitution and direct actor references f...
MxBool FUN_1006abb0(LegoTreeNode *p_node, LegoROI *p_roi)
[AI] Recursively validates correct ROI matching/binding in animation tree (helper for FUN_1006aba0).
LegoROI ** m_roiMap
[AI] Lookup array to map animation node indices to scene ROIs (1-based index).
virtual LegoROI ** GetROIMap(MxU32 &p_roiMapSize)
[AI] Returns the mapping array from animation node index to LegoROI*.
virtual MxResult VTable0x98(LegoPathBoundary *p_boundary)
[AI] Adds all actor ROIs, associated with this animation, to the provided path boundary for grouping ...
Matrix4 * m_unk0xa0
[AI] Optional pointer to a matrix storing a blended/baseline local-to-world transform.
MxAtomId m_worldAtom
[AI] String identifier for the target world (if set in animation resource via extra data).
void SetCurrentWorld(LegoWorld *p_currentWorld)
[AI] Sets the world used by this presenter for actor placement and notification.
void SetUnknown0xa0(Matrix4 *p_unk0xa0)
[AI] Sets a pointer to the baseline animation transform.
void FUN_1006ab70()
[AI] Invokes end-of-animation logic via AnimationManager, depending on mode flag m_unk0x96.
MxResult StartAction(MxStreamController *p_controller, MxDSAction *p_action) override
[AI] Begin playback action using a stream and a given action descriptor.
LegoBool FUN_100698b0(const CompoundObject &p_rois, const LegoChar *p_und2)
[AI] Locates (and adds to m_unk0x70) an ROI in a compound object by substituted name,...
const char * GetActionObjectName()
[AI] Gets the name of the object associated with the current animation action.
MxU8 m_unk0x94
[AI] Count of valid camera attached ROI names in m_unk0x90 / m_unk0x8c.
MxResult FUN_1006afc0(MxMatrix *&p_matrix, float p_und)
[AI] Fills a matrix array with each node's local-to-world transform after animation advance (for stat...
void FUN_1006b9a0(LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
[AI] Like FUN_1006b900, but also processes associated camera animation if present.
~LegoAnimPresenter() override
[AI] Destructor for LegoAnimPresenter.
LegoAnim * GetAnimation()
[AI] Returns the current animation resource in use.
void FUN_1006c7a0()
[AI] Immediately completes this animation, updates all ROIs to their final pose.
void DoneTickle() override
[AI] Called when animation streaming completes; triggers notification and wraps up state.
void FUN_100695c0()
[AI] Scans the world view compound objects to find and collect relevant ROIs for animation,...
void PutFrame() override
[AI] Called once per frame to push updated animation information (transform, position,...
static const char * HandlerClassName()
[AI] Returns the class name for this presenter ("LegoAnimPresenter").
LegoAnimPresenter()
[AI] Constructor for LegoAnimPresenter.
LegoROIList * m_unk0x74
[AI] List of actors/ROIs created or acquired for this animation instance.
MxBool m_unk0x95
[AI] Boolean: indicates streaming/animation is finished and presenter should progress to Done state.
Matrix4 * m_unk0x78
[AI] Pointer to root/offset MxMatrix used for transform computations.
MxResult AddToManager() override
[AI] Adds this presenter instance to the relevant presenter/notification manager.
void StreamingTickle() override
[AI] Tickle function during streaming (active animation).
MxResult FUN_1006b140(LegoROI *p_roi)
[AI] Calculates a blended transformation for a target ROI and applies as base transform for this anim...
LegoWorld * m_currentWorld
[AI] Reference to the world in which this presenter is currently placed/active.
[AI] Root class for all node-based animation blending/structure.
Definition: legoanim.h:356
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
[AI] A specialized pointer list for managing LegoROI instances.
Definition: legoroilist.h:25
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
[AI] Represents a node within a general, N-ary tree structure.
Definition: legotree.h:44
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
[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
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
Derived video presenter responsible for displaying video frames using DirectDraw surfaces.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
unsigned char undefined
Definition: decomp.h:26
map< const char *, const char *, LegoAnimSubstComparator > LegoAnimSubstMap
[AI] Mapping for macro or variable substitutions in animation resource parsing.
map< const char *, LegoAnimStruct, LegoAnimStructComparator > LegoAnimStructMap
[AI] Mapping from string names to LegoAnimStruct.
char LegoChar
[AI] Alias for char, for use in character/byte data and string handling.
Definition: legotypes.h:83
LegoU8 LegoBool
[AI] Boolean value used throughout the codebase.
Definition: legotypes.h:89
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
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 int MxU32
[AI]
Definition: mxtypes.h:32
list< ROI * > CompoundObject
Definition: roi.h:135
[AI] Comparator for anim struct maps using string (char*) keys.
MxBool operator()(const char *const &p_a, const char *const &p_b) const
[AI] Maps an ROI and index for animation nodes/actors.
LegoROI * m_roi
Associated LEGO Region of Interest (ROI) for animation [AI].
MxU32 m_index
Index value for lookup or ordering [AI].
[AI] Comparator for substition map lookups using string (char*) keys.
MxBool operator()(const char *const &p_a, const char *const &p_b) const