Isle
Loading...
Searching...
No Matches
legopathactor.h
Go to the documentation of this file.
1#ifndef LEGOPATHACTOR_H
2#define LEGOPATHACTOR_H
3
4#include "legoactor.h"
5#include "misc/legounknown.h"
6#include "mxtypes.h"
7
8struct LegoEdge;
9struct LegoNamedPlane;
14class LegoWEEdge;
15
17extern const char* g_strHIT_WALL_SOUND;
18
32class LegoPathActor : public LegoActor {
33public:
36 // States
38 c_one = 1,
39 c_two = 2,
42 c_maxState = 255,
43
44 // Flags
45 c_noCollide = 0x100
46 };
47
49 ~LegoPathActor() override;
50
56 void ParseAction(char* p_extra) override; // vtable+0x20
57
65 virtual MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3); // vtable+0x68
66
77 virtual MxU32 VTable0x6c(
78 LegoPathBoundary* p_boundary,
79 Vector3& p_v1,
80 Vector3& p_v2,
81 float p_f1,
82 float p_f2,
83 Vector3& p_v3
84 ); // vtable+0x6c
85
90 virtual void Animate(float p_time); // vtable+0x70
91
96 virtual void VTable0x74(Matrix4& p_transform); // vtable+0x74
97
102 virtual void SetUserNavFlag(MxBool p_userNavFlag) { m_userNavFlag = p_userNavFlag; } // vtable+0x78
103
108 virtual MxBool GetUserNavFlag() { return m_userNavFlag; } // vtable+0x7c
109
118 virtual MxResult VTable0x80(
119 const Vector3& p_point1,
120 Vector3& p_point2,
121 Vector3& p_point3,
122 Vector3& p_point4
123 ); // vtable+0x80
124
135 virtual MxResult VTable0x84(
136 LegoPathBoundary* p_boundary,
137 float p_time,
138 Vector3& p_p1,
139 Vector3& p_p4,
140 LegoUnknown100db7f4& p_destEdge,
141 float p_destScale
142 ); // vtable+0x84
143
154 virtual MxResult VTable0x88(
155 LegoPathBoundary* p_boundary,
156 float p_time,
157 LegoEdge& p_srcEdge,
158 float p_srcScale,
159 LegoUnknown100db7f4& p_destEdge,
160 float p_destScale
161 ); // vtable+0x88
162
169 virtual MxS32 VTable0x8c(float p_time, Matrix4& p_transform); // vtable+0x8c
170
176 virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90
177
183 virtual MxResult HitActor(LegoPathActor*, MxBool) { return 0; } // vtable+0x94
184
191 virtual void SwitchBoundary(
192 LegoPathBoundary*& p_boundary,
193 LegoUnknown100db7f4*& p_edge,
194 float& p_unk0xe4
195 ); // vtable+0x98
196
201 virtual MxResult VTable0x9c(); // vtable+0x9c
202
207 virtual MxS32 VTable0xa0() { return 0; } // vtable+0xa0
208
214 virtual void VTable0xa4(MxBool& p_und1, MxS32& p_und2); // vtable+0xa4
215
219 virtual void VTable0xa8(); // vtable+0xa8
220
225 virtual void SetMaxLinearVel(MxFloat p_maxLinearVel) { m_maxLinearVel = p_maxLinearVel; } // vtable+0xac
226
231 virtual MxFloat GetMaxLinearVel() { return m_maxLinearVel; } // vtable+0xb0
232
237 virtual MxFloat VTable0xb4() { return m_unk0x140; } // vtable+0xb4
238
242 virtual MxFloat VTable0xb8() { return m_unk0x144; } // vtable+0xb8
243
248 virtual void VTable0xbc(MxFloat p_unk0x140) { m_unk0x140 = p_unk0x140; } // vtable+0xbc
249
254 virtual void VTable0xc0(MxFloat p_unk0x144) { m_unk0x144 = p_unk0x144; } // vtable+0xc0
255
259 virtual void VTable0xc4() {} // vtable+0xc4
260
265 virtual void VTable0xc8(MxU8 p_unk0x148) { m_unk0x148 = p_unk0x148; } // vtable+0xc8
266
270 const char* ClassName() const override // vtable+0x0c
271 {
272 return "LegoPathActor";
273 }
274
280 MxBool IsA(const char* p_name) const override // vtable+0x10
281 {
282 return !strcmp(p_name, LegoPathActor::ClassName()) || LegoActor::IsA(p_name);
283 }
284
290
295
300
305
310
315
320 void SetBoundary(LegoPathBoundary* p_boundary) { m_boundary = p_boundary; }
321
326 void SetActorState(MxU32 p_actorState) { m_actorState = p_actorState; }
327
332 void SetController(LegoPathController* p_pathController) { m_pathController = p_pathController; }
333
338 void SetLastTime(MxFloat p_lastTime) { m_lastTime = p_lastTime; }
339
344 void SetActorTime(MxFloat p_actorTime) { m_actorTime = p_actorTime; }
345
350 void UpdatePlane(LegoNamedPlane& p_namedPlane);
351
356 void PlaceActor(LegoNamedPlane& p_namedPlane);
357
358protected:
371 inline MxU32 FUN_1002edd0(
372 list<LegoPathBoundary*>& p_boundaries,
373 LegoPathBoundary* p_boundary,
374 Vector3& p_v1,
375 Vector3& p_v2,
376 float p_f1,
377 float p_f2,
378 Vector3& p_v3,
379 MxS32 p_und
380 );
381
403};
404
405#endif // LEGOPATHACTOR_H
[AI] Represents an actor (character) entity in the LEGO Island 3D world, providing specific actor log...
Definition: legoactor.h:12
MxBool IsA(const char *p_name) const override
[AI] Determines if the class is or derives from the given name.
Definition: legoactor.h:43
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
virtual void VTable0xc8(MxU8 p_unk0x148)
[AI] Sets the rolling state (animation index, mainly for camera turning/curves).
virtual MxResult VTable0x80(const Vector3 &p_point1, Vector3 &p_point2, Vector3 &p_point3, Vector3 &p_point4)
[AI] Calculates path interpolation for a set of points, updates state for path animation,...
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).
void SetBoundary(LegoPathBoundary *p_boundary)
[AI] Assigns a new boundary for the actor (for path switching).
const char * ClassName() const override
[AI] Returns the class name string for RTTI-style checks.
virtual MxResult VTable0x88(LegoPathBoundary *p_boundary, float p_time, LegoEdge &p_srcEdge, float p_srcScale, LegoUnknown100db7f4 &p_destEdge, float p_destScale)
[AI] Moves the actor between two edges across a boundary, recalculates placement and orientation.
virtual MxFloat VTable0xb4()
[AI] Returns an internal value used in fallback collision/velocity calculation (proportional fudge fa...
virtual void Animate(float p_time)
[AI] Per-frame animation update.
MxFloat m_maxLinearVel
[AI] Maximum speed of actor while moving along path. [AI]
MxU32 GetActorState()
[AI] Gets the current navigation/animation state of the actor.
virtual MxU32 VTable0x90(float, Matrix4 &)
[AI] Placeholder for custom logic during per-timestep simulation for non-user-controlled animation.
LegoUnknown100db7f4 * m_destEdge
[AI] Current or target edge for path traversal. [AI]
virtual MxU32 VTable0x6c(LegoPathBoundary *p_boundary, Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3)
[AI] Trace movement or collision through presenters (edge test), then through other actors.
MxFloat m_unk0x144
[AI] Damping factor for velocity after collision ("bounce" friction). [AI]
void SetActorTime(MxFloat p_actorTime)
[AI] Sets the global actor animation time value, adjusting how far along the animation is.
virtual void VTable0xc0(MxFloat p_unk0x144)
[AI] Sets the velocity damping factor after bump.
virtual MxBool GetUserNavFlag()
[AI] Returns user navigation state (whether actor follows player input).
virtual MxS32 VTable0x8c(float p_time, Matrix4 &p_transform)
[AI] Advance actor's position/state along the path for a given timeslice.
virtual void SwitchBoundary(LegoPathBoundary *&p_boundary, LegoUnknown100db7f4 *&p_edge, float &p_unk0xe4)
[AI] Switches current path boundary and destination edge, typically called on transitions or respawns...
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]
MxFloat m_unk0x7c
[AI] Interpolator/progress state along curve segment. [AI]
MxFloat m_unk0xe4
[AI] Position scalar on destination edge (0-1 across the edge). [AI]
virtual void SetUserNavFlag(MxBool p_userNavFlag)
[AI] Sets whether the actor is controlled by user navigation.
virtual void VTable0xc4()
[AI] Empty handler for optional custom per-tick transition logic.
void ParseAction(char *p_extra) override
[AI] Parses a set of key-value action commands and configures path navigation and collision for this ...
MxFloat m_unk0x140
[AI] Scaling factor for fallback/collision response logic. [AI]
virtual void SetMaxLinearVel(MxFloat p_maxLinearVel)
[AI] Sets the maximum linear velocity for actor navigation.
void SetController(LegoPathController *p_pathController)
[AI] Assigns a new path controller (used for actor transitions between paths).
virtual void VTable0x74(Matrix4 &p_transform)
[AI] Updates the ROI's transformation (typically matrix) with new values, applies world position/orie...
MxS32 m_unk0x14c
[AI] Rolling angle delta (variant for camera logic). [AI]
LegoPathController * m_pathController
[AI] Path controller/manages permitted boundaries for transitions. [AI]
MxU32 FUN_1002edd0(list< LegoPathBoundary * > &p_boundaries, LegoPathBoundary *p_boundary, Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3, MxS32 p_und)
[AI] Recursively checks boundaries for collisions or collision path propagation up to a certain recur...
void SetLastTime(MxFloat p_lastTime)
[AI] Sets the time value for the last performed simulation tick.
ActorState
[AI] State and flags for a LegoPathActor during navigation along a path. [AI]
Definition: legopathactor.h:35
@ c_maxState
[AI] Max actor state (reserved for logic). [AI]
Definition: legopathactor.h:42
@ c_initial
[AI] Default state upon creation or reset. [AI]
Definition: legopathactor.h:37
@ c_disabled
[AI] Marks as disabled or inactive for path follow logic. [AI]
Definition: legopathactor.h:41
@ c_noCollide
[AI] Disables collision for this actor (e.g. ghosts, debug). [AI]
Definition: legopathactor.h:45
MxU8 m_unk0x148
[AI] Angle/animation mode for rolling/camera tilting. [AI]
virtual MxResult VTable0x9c()
[AI] Handles exit transition and next-edge search logic; also used for collision reaction and fallbac...
virtual MxResult VTable0x84(LegoPathBoundary *p_boundary, float p_time, Vector3 &p_p1, Vector3 &p_p4, LegoUnknown100db7f4 &p_destEdge, float p_destScale)
[AI] Moves actor to a destination edge.
LegoPathController * GetController()
[AI] Retrieves pointer to the path controller which governs this actor's movement.
MxMatrix m_unk0xec
[AI] World-to-local transformation matrix for this actor/ROI. [AI]
virtual void VTable0xa8()
[AI] Re-applies transform to ROI, updates camera if needed, and processes per-actor tick actions.
MxBool m_userNavFlag
[AI] TRUE if this actor is currently user/player controlled. [AI]
LegoPathEdgeContainer * m_grec
[AI] Edge/boundary helper for tracking transitions and stateful animation. [AI]
MxFloat GetLastTime()
[AI] Gets the previous animation time value from last simulation tick.
void PlaceActor(LegoNamedPlane &p_namedPlane)
[AI] Places this actor into the world at the given plane's name, location, and orientation.
virtual void VTable0xbc(MxFloat p_unk0x140)
[AI] Sets the fudge parameter for fallback collision push-back.
void UpdatePlane(LegoNamedPlane &p_namedPlane)
[AI] Updates a named plane to match this actor's world position, direction, and up vector.
LegoUnknown m_unk0x8c
[AI] Helper object for path curve interpolation and evaluation. [AI]
virtual MxFloat GetMaxLinearVel()
[AI] Gets the maximum allowed navigation speed for this actor.
virtual MxS32 VTable0xa0()
[AI] Placeholder for custom extension.
MxFloat m_unk0x150
[AI] Scalar factor for camera turn velocity logic. [AI]
virtual void VTable0xa4(MxBool &p_und1, MxS32 &p_und2)
[AI] Returns information depending on actor type.
MxBool IsA(const char *p_name) const override
[AI] RTTI-like check, matches against own or base class name for IsA hierarchy checks.
MxBool m_collideBox
[AI] Use bounding-box for more accurate collision. [AI]
virtual MxFloat VTable0xb8()
[AI] Returns a damping/multiplier factor used for velocity reduction after collisions.
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...
LegoPathActor()
[AI] Initializes the path actor, setting up default state and references. [AI]
virtual MxResult HitActor(LegoPathActor *, MxBool)
[AI] Handles logic when this actor hits (collides with) another path actor; can be overridden for cus...
MxFloat GetActorTime()
[AI] Returns the current animation time of the actor.
MxBool m_unk0xe9
[AI] Stores latest intersection/collision status/type. [AI]
MxFloat m_BADuration
[AI] Duration of current Bezier arc (distance along path/current edge). [AI]
MxFloat m_lastTime
[AI] Time of last update (used for delta calculations). [AI]
LegoPathBoundary * GetBoundary()
[AI] Retrieves the current path boundary associated with this actor.
void SetActorState(MxU32 p_actorState)
[AI] Sets the navigation/path state of the actor.
~LegoPathActor() override
[AI] Destructor, cleans up allocated containers. [AI]
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
[AI] Manager for controlling actors' movement along predefined geometric paths.
Opaque Bezier curve utility used for actor or path position interpolation.
Definition: legounknown.h:18
[AI] Represents a face (polygon) composed of a list of edges in the LEGO Island world engine.
Definition: legoweedge.h:17
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
#define override
Definition: compat.h:21
#define FALSE
Definition: d3drmdef.h:27
const char * g_strHIT_WALL_SOUND
[AI] Variable table name for the wall hit sound [AI]
MxLong g_unk0x100f3308
[AI] Timer for wall hit sound playback throttling in navigation [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
float MxFloat
[AI]
Definition: mxtypes.h:68
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
[AI] Represents an edge in the LEGO world geometry graph.
Definition: legoedge.h:16
[AI] Represents a named 3D plane with orientation and position, used to describe places or camera tar...
[AI] Container for path boundary edges, also stores position, direction, and flags.
[AI] Represents an advanced edge in the LEGO Island geometry system, with direction,...