58 m_scheduledTime = p_time + 2000.0f;
64 Vector3 positionRef(p_transform[3]);
67 if (p_time < m_scheduledTime) {
69 position = positionRef;
91 positionRef = position;
99 m_scheduledTime = 0.0f;
125 p_und2 = rand() % p_und2 + 1;
172 if (
m_animMaps[i]->GetUnknown0x00() == -20.0f) {
184 if (
m_animMaps[i]->GetUnknown0x00() == -21.0f) {
201 if (m_unk0x15 != 0) {
216 Vector3 positionRef(matrix2[3]);
225 if (positionRef.
Dot(*normal, positionRef) + normal->
index_operator(3) < -0.001) {
255 Vector3 positionRef(matrix3[3]);
262 if (fabs(dotZ) < fabs(dotX)) {
284 for (LegoAnimPresenterSet::iterator it = presenters.begin(); it != presenters.end(); it++) {
286 if ((*it)->GetROIMap(roiMapSize)) {
305 if (m_unk0x0e != 0) {
309 for (LegoAnimPresenterSet::iterator it = presenters.begin(); it != presenters.end(); it++) {
311 if ((*it)->GetROIMap(roiMapSize)) {
329 switch (m_whichAnim) {
334 if (m_scheduledTime < p_time) {
337 m_scheduledTime = m_assAnim->
GetDuration() + p_time;
345 if (m_scheduledTime < p_time) {
360 float duration2, duration;
362 duration2 = p_time - (m_scheduledTime - duration);
367 else if (duration2 > duration) {
368 duration2 = duration;
375 for (
MxS32 i = 0; i < count; i++) {
384 if (m_whichAnim == 0) {
392 if (
m_curAnim == 0 && p_worldSpeed > 0) {
436 for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
437 if ((*itap)->VTable0x94(p_v1, p_v2, p_f1, p_f2, p_v3)) {
445 for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
446 if (plpas.find(*itpa) != plpas.end()) {
455 Vector3 local60(local2world[3]);
459 float local1c = p_v2.
Dot(p_v2, p_v2);
460 float local24 = p_v2.
Dot(p_v2, local54) * 2.0f;
461 float local20 = local54.
Dot(local54, local54);
463 if (m_unk0x15 != 0 && local20 < 10.0f) {
469 if (local1c >= 0.001 || local1c <= -0.001) {
470 float local40 = (local24 * local24) + (local20 * local1c * -4.0f);
472 if (local40 >= -0.001) {
476 if (local40 < 0.0f) {
480 local40 = sqrt(local40);
481 float local20X = (local24 + local40) / local1c;
482 float local1cX = (local24 - local40) / local1c;
484 if (local1cX < local20X) {
490 if ((local20X >= 0.0f && local20X <= p_f1) || (local1cX >= 0.0f && local1cX <= p_f1) ||
491 (local20X <= -0.01 && p_f1 + 0.01 <= local1cX)) {
519 if (m_unk0x15 != 0) {
void SetWorldSpeed(MxFloat p_worldSpeed) override
[AI] Sets the current world speed and chooses which animation (from the animation map list) should be...
vector< LegoAnimActorStruct * > m_animMaps
[AI] List of animation structures, each representing a valid animation for different speed/phase rang...
virtual MxResult FUN_1001c360(float p_und, Matrix4 &p_transform)
[AI] Applies the animation transform for the current animation at the given phase,...
MxS16 m_curAnim
[AI] Index of currently selected animation map (-1 if none active). [AI]
void Animate(float p_time) override
[AI] Performs per-frame update; applies the appropriate animation to mesh ROIs based on speed and sta...
void VTable0x74(Matrix4 &p_transform) override
[AI] Applies the current animation's transforms to the provided matrix, propagates to mesh hierarchie...
LegoCacheSound * Play(const char *p_key, const char *p_name, MxBool p_looping)
[AI] Plays a sound identified by key, with the given playback name and looping flag.
Mx3DPointFloat GetWorldDirection()
[AI] Gets the normalized world-space direction vector, optionally updating from ROI....
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
MxFloat m_worldSpeed
[AI] World-relative speed (can affect animation/movement logic). [AI]
MxFloat GetWorldSpeed()
[AI] Gets the entity's current world speed state. [AI]
LegoROI * m_roi
[AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI]
MxBool GetCameraFlag()
[AI] Returns whether this entity is flagged as camera (affects world/camera synchronization)....
[AI] Specialized presenter class for handling locomotion animation playback and state in the LEGO Isl...
void FUN_1006d680(LegoAnimActor *p_actor, MxFloat p_value)
[AI] Binds a LegoAnimActor to the internal animation context and ROI mapping.
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
MxFloat m_actorTime
[AI] Animation time for current path segment. [AI]
MxBool GetCollideBox()
[AI] Gets the actor's collision box flag (if TRUE, actor uses a precise collision shape).
MxU32 GetActorState()
[AI] Gets the current navigation/animation state of the actor.
LegoUnknown100db7f4 * m_destEdge
[AI] Current or target edge for path traversal. [AI]
virtual MxBool GetUserNavFlag()
[AI] Returns user navigation state (whether actor follows player input).
LegoPathBoundary * m_boundary
[AI] Current boundary the actor is navigating on. [AI]
MxU32 m_actorState
[AI] State and flags bitfield for path following logic. [AI]
@ c_maxState
[AI] Max actor state (reserved for logic). [AI]
@ c_initial
[AI] Default state upon creation or reset. [AI]
@ c_noCollide
[AI] Disables collision for this actor (e.g. ghosts, debug). [AI]
virtual MxResult VTable0x9c()
[AI] Handles exit transition and next-edge search logic; also used for collision reaction and fallbac...
MxMatrix m_unk0xec
[AI] World-to-local transformation matrix for this actor/ROI. [AI]
MxBool m_collideBox
[AI] Use bounding-box for more accurate collision. [AI]
virtual MxS32 VTable0x68(Vector3 &p_v1, Vector3 &p_v2, Vector3 &p_v3)
[AI] Checks for collision/intersection with boundaries, geometry, and other actors along a traced seg...
virtual MxResult HitActor(LegoPathActor *, MxBool)
[AI] Handles logic when this actor hits (collides with) another path actor; can be overridden for cus...
MxFloat m_lastTime
[AI] Time of last update (used for delta calculations). [AI]
void SetActorState(MxU32 p_actorState)
[AI] Sets the navigation/path state of the actor.
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
LegoAnimPresenterSet & GetPresenters()
[AI] Direct access to the animation presenter set for this boundary.
LegoPathActorSet & GetActors()
[AI] Direct access to the actor set for this boundary.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
LegoU32 FUN_100a9410(Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3, LegoBool p_collideBox)
[AI] Tests for collision along or within sphere/box, and computes intersection point as needed.
static void FUN_100a8e80(LegoTreeNode *p_node, Matrix4 &p_matrix, LegoTime p_time, LegoROI **p_roiMap)
[AI] [Static] Recursively evaluates animation nodes, updating the transformation matrices and visibil...
const LegoChar * GetName() const
[AI] Gets this ROI's name.
LegoCacheSoundManager * GetCacheSoundManager()
[AI] Returns the cache sound manager used to cache and reuse sound effects.
[AI] Represents a node within a general, N-ary tree structure.
LegoU32 GetNumChildren()
[AI] Returns the number of direct children of this node. [AI]
LegoTreeNode * GetChild(LegoU32 p_i)
[AI] Gets the child node at the specified index (no bounds checking).
LegoTreeNode * GetRoot()
[AI] Returns a pointer to the root node of the tree. [AI]
LegoU8 GetNumEdges()
[AI] Returns the number of edge elements assigned to this face.
Mx4DPointFloat * GetEdgeNormal(int index)
[AI] Returns a pointer to the 4D edge normal at the given sub-edge index.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
4x4 Matrix class with virtual interface for manipulation and transformation.
void RotateX(const float &p_angle)
Applies a rotation (in radians or degrees, depending on implementation) about the X axis.
void RotateZ(const float &p_angle)
Applies a rotation (in radians or degrees) about the Z axis.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
[AI] 4D point class for floating point values.
float & index_operator(int idx)
[AI] Explicit indexed access wrapper (alias for operator[]).
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
virtual void VTable0x14()
[AI] Calls VTable0x1c().
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
unsigned char GetVisibility()
[AI] Returns the visibility flag; true if visible, false if hidden.
virtual float Dot(const float *p_a, const float *p_b) const
[AI] Compute the dot product of the two float arrays interpreted as vectors of 2 elements.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
void Clear() override
[AI] Sets every coordinate (x, y, z) to zero.
virtual void EqualsCross(const Vector3 &p_a, const Vector3 &p_b)
[AI] Sets this vector to be the cross product of p_a and p_b.
#define DECOMP_SIZE_ASSERT(T, S)
set< LegoAnimPresenter *, LegoAnimPresenterSetCompare > LegoAnimPresenterSet
[AI] Defines a set of LegoAnimPresenter pointers, ordered by pointer value using LegoAnimPresenterSet...
set< LegoPathActor *, LegoPathActorSetCompare > LegoPathActorSet
[AI] Defines a set of LegoPathActor pointers, ordered by pointer value using LegoPathActorSetCompare.
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
MxTimer * Timer()
[AI] Returns the global simulation timer.
#define TWOCC(a, b)
[AI] Macro to compose a 16-bit code from two 8-bit characters (e.g., for type IDs).
[AI] Holds per-animation instance data for a LegoAnimActor.
float GetDuration()
[AI] Gets the length, in seconds, of the animation (delegates to anim tree).
LegoAnim * m_AnimTreePtr
[AI] Root of animation tree for this animation [AI]
LegoROI ** m_roiMap
[AI] Mapping of animation nodes to LEGO ROIs (meshes) [AI]
LegoWEEdge * m_faceA
[AI] Pointer to the first face sharing this edge.
LegoWEEdge * m_faceB
[AI] Pointer to the second face sharing this edge.