Isle
|
[AI] Manager for controlling actors' movement along predefined geometric paths. More...
#include <legopathcontroller.h>
Classes | |
struct | CtrlBoundary |
[AI] Helper structure for rapid lookups of controller-boundary pairs, often used for global or indexed access patterns across controllers. More... | |
struct | CtrlEdge |
[AI] Helper structure pairing controllers with edge references for global or fast access. More... | |
Public Member Functions | |
LegoPathController () | |
[AI] Constructs a LegoPathController, initializing boundary and edge pointers to NULL and counts to zero. More... | |
~LegoPathController () override | |
[AI] Destructor, unregisters itself from the tickle manager and releases all dynamically allocated path data. More... | |
MxResult | Tickle () override |
[AI] Implements the tickle (per-frame update) callback for the controller. More... | |
const char * | ClassName () const override |
[AI] Returns the class name for runtime type identification. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Checks inheritance by class name for type introspection. More... | |
virtual MxResult | Create (MxU8 *p_data, const Vector3 &p_location, const MxAtomId &p_trigger) |
[AI] Initializes the path controller from the provided binary data at the specified location, applying a trigger. More... | |
virtual void | Destroy () |
[AI] Deinitializes path controller, releases all owned resources and unregisters from tickle manager. More... | |
MxResult | PlaceActor (LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale) |
[AI] Places an actor on a boundary at given source/destination edge indices, commonly for track segment transitions (e.g., for vehicles). More... | |
MxResult | PlaceActor (LegoPathActor *p_actor, LegoAnimPresenter *p_presenter, Vector3 &p_position, Vector3 &p_direction) |
[AI] Places an actor using an animation presenter and direct position/direction data. More... | |
MxResult | PlaceActor (LegoPathActor *p_actor) |
[AI] Registers an actor as controlled by this path controller without moving it to a specific boundary location, e.g., after controller change. More... | |
MxResult | RemoveActor (LegoPathActor *p_actor) |
[AI] Removes an actor from the controller, detaches it from controlled boundaries, and clears associations. More... | |
void | FUN_100468f0 (LegoAnimPresenter *p_presenter) |
[AI] Processes all boundaries except those with bit3 set, invoking FUN_10057fe0 for the provided animation presenter. More... | |
void | FUN_10046930 (LegoAnimPresenter *p_presenter) |
[AI] Invokes FUN_100586e0 for each boundary, with the provided animation presenter. More... | |
MxResult | FUN_10046b30 (LegoPathBoundary *&p_boundaries, MxS32 &p_numL) |
[AI] Provides current array of boundaries and count as output parameters, for external queries. More... | |
LegoPathBoundary * | GetPathBoundary (const char *p_name) |
[AI] Searches for a path boundary by name among owned boundaries. More... | |
void | Enable (MxBool p_enable) |
[AI] Enables or disables the controller's registration with the tickle manager, controlling per-frame updates. More... | |
void | FUN_10046bb0 (LegoWorld *p_world) |
[AI] Assigns the provided world pointer to all struct triggers owned by this path controller. More... | |
MxResult | FUN_10048310 (LegoPathEdgeContainer *p_grec, const Vector3 &p_oldPosition, const Vector3 &p_oldDirection, LegoPathBoundary *p_oldBoundary, const Vector3 &p_newPosition, const Vector3 &p_newDirection, LegoPathBoundary *p_newBoundary, LegoU8 p_mask, MxFloat *p_param9) |
[AI] Complex function performing path transition resolution; computes possible edge transition sequences for an actor moving between boundaries. More... | |
MxS32 | FUN_1004a240 (LegoPathEdgeContainer &p_grec, Vector3 &p_v1, Vector3 &p_v2, float p_f1, LegoUnknown100db7f4 *&p_edge, LegoPathBoundary *&p_boundary) |
[AI] Computes path vector and orientation for an actor given a transition along the resolved edge container sequence. More... | |
MxResult | FUN_1004a380 (Vector3 &p_param1, Vector3 &p_param2, Mx3DPointFloat *p_param3, LegoPathBoundary *&p_boundary, MxFloat &p_param5) |
[AI] Finds earliest intersection and placement on a valid boundary for the provided vectors and updates parameters as needed. More... | |
MxBool | ActorExists (LegoPathActor *p_actor) |
[AI] Checks whether an actor is contained in the controller's actor set. More... | |
![]() | |
MxCore () | |
[AI] Constructs a new MxCore object and assigns it a unique id. More... | |
virtual | ~MxCore () |
[AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More... | |
virtual MxLong | Notify (MxParam &p_param) |
[AI] Virtual callback notification mechanism. More... | |
virtual MxResult | Tickle () |
[AI] Called by tickle managers to allow the object to update itself. More... | |
virtual const char * | ClassName () const |
[AI] Returns the runtime class name of this object. More... | |
virtual MxBool | IsA (const char *p_name) const |
[AI] Checks whether this object's class type or parents match the given name. More... | |
MxU32 | GetId () |
[AI] Gets the unique (per-process) id assigned to this object instance. More... | |
Static Public Member Functions | |
static MxResult | Init () |
[AI] Static initializer for global controller boundary/edge arrays. More... | |
static MxResult | Reset () |
[AI] Resets (cleans up) global controller boundary/edge arrays allocated by Init(). More... | |
static LegoUnknown100db7f4 * | GetControlEdgeA (MxS32 p_index) |
[AI] Provides static access to the edge at a given index in g_ctrlEdgesA. More... | |
static LegoPathBoundary * | GetControlBoundaryA (MxS32 p_index) |
[AI] Provides static access to the boundary at given index in g_ctrlBoundariesA. More... | |
static LegoUnknown100db7f4 * | GetControlEdgeB (MxS32 p_index) |
[AI] Provides static access to the edge at a given index in g_ctrlEdgesB. More... | |
static LegoPathBoundary * | GetControlBoundaryB (MxS32 p_index) |
[AI] Provides static access to the boundary at given index in g_ctrlBoundariesB. More... | |
[AI] Manager for controlling actors' movement along predefined geometric paths.
Handles path boundaries, connectivity, and the logic for actor transitions and obstacle detection. Registered as a tickle client for per-frame updates. [AI]
[AI] This class provides and maintains the runtime representation of path boundaries (track segments), structural triggers, and linkage edges. It manages actor attachments, movement placement along the path network, and supplies special path information to enable complex transitions between segments. Path data is read from script storage and is essential for AI pathfinding and animation coordination. [AI]
Definition at line 47 of file legopathcontroller.h.
LegoPathController::LegoPathController | ( | ) |
[AI] Constructs a LegoPathController, initializing boundary and edge pointers to NULL and counts to zero.
[AI]
Definition at line 70 of file legopathcontroller.cpp.
|
inlineoverride |
[AI] Destructor, unregisters itself from the tickle manager and releases all dynamically allocated path data.
[AI]
Definition at line 93 of file legopathcontroller.h.
|
inline |
[AI] Checks whether an actor is contained in the controller's actor set.
p_actor | [AI] Pointer to the actor to query. |
Definition at line 282 of file legopathcontroller.h.
|
overridevirtual |
[AI] Returns the class name for runtime type identification.
[AI]
Reimplemented from MxCore.
|
virtual |
[AI] Initializes the path controller from the provided binary data at the specified location, applying a trigger.
[AI]
p_data | [AI] Pointer to memory containing path controller serialized data. |
p_location | [AI] The world position for relocation of controller-linked objects. |
p_trigger | [AI] Atom ID used for signaling or associating with relevant path structures. |
Definition at line 84 of file legopathcontroller.cpp.
|
virtual |
[AI] Deinitializes path controller, releases all owned resources and unregisters from tickle manager.
[AI]
Definition at line 137 of file legopathcontroller.cpp.
void LegoPathController::Enable | ( | MxBool | p_enable | ) |
[AI] Enables or disables the controller's registration with the tickle manager, controlling per-frame updates.
[AI]
p_enable | [AI] TRUE to enable, FALSE to disable. [AI] |
Definition at line 416 of file legopathcontroller.cpp.
void LegoPathController::FUN_100468f0 | ( | LegoAnimPresenter * | p_presenter | ) |
[AI] Processes all boundaries except those with bit3 set, invoking FUN_10057fe0 for the provided animation presenter.
[AI]
p_presenter | [AI] Pointer to an animation presenter. [AI] |
Definition at line 347 of file legopathcontroller.cpp.
void LegoPathController::FUN_10046930 | ( | LegoAnimPresenter * | p_presenter | ) |
[AI] Invokes FUN_100586e0 for each boundary, with the provided animation presenter.
[AI]
p_presenter | [AI] Pointer to the animation presenter. [AI] |
Definition at line 358 of file legopathcontroller.cpp.
MxResult LegoPathController::FUN_10046b30 | ( | LegoPathBoundary *& | p_boundaries, |
MxS32 & | p_numL | ||
) |
[AI] Provides current array of boundaries and count as output parameters, for external queries.
[AI]
p_boundaries | [AI] Output: pointer set to internal array of boundaries. [AI] |
p_numL | [AI] Output: count of path boundaries. [AI] |
Definition at line 385 of file legopathcontroller.cpp.
void LegoPathController::FUN_10046bb0 | ( | LegoWorld * | p_world | ) |
[AI] Assigns the provided world pointer to all struct triggers owned by this path controller.
[AI]
p_world | [AI] Pointer to the LegoWorld object, set in all structs. [AI] |
Definition at line 407 of file legopathcontroller.cpp.
MxResult LegoPathController::FUN_10048310 | ( | LegoPathEdgeContainer * | p_grec, |
const Vector3 & | p_oldPosition, | ||
const Vector3 & | p_oldDirection, | ||
LegoPathBoundary * | p_oldBoundary, | ||
const Vector3 & | p_newPosition, | ||
const Vector3 & | p_newDirection, | ||
LegoPathBoundary * | p_newBoundary, | ||
LegoU8 | p_mask, | ||
MxFloat * | p_param9 | ||
) |
[AI] Complex function performing path transition resolution; computes possible edge transition sequences for an actor moving between boundaries.
[AI]
p_grec | [AI] Edge container holding the resulting transition sequence. |
p_oldPosition | [AI] Source position. |
p_oldDirection | [AI] Source direction. |
p_oldBoundary | [AI] Boundary actor is moving from. |
p_newPosition | [AI] Destination position. |
p_newDirection | [AI] Destination direction. |
p_newBoundary | [AI] Boundary actor is moving to. |
p_mask | [AI] Path mask for allowed transitions (bitmask). |
p_param9 | [AI] Out: will contain shortest path distance if provided. |
Definition at line 745 of file legopathcontroller.cpp.
MxS32 LegoPathController::FUN_1004a240 | ( | LegoPathEdgeContainer & | p_grec, |
Vector3 & | p_v1, | ||
Vector3 & | p_v2, | ||
float | p_f1, | ||
LegoUnknown100db7f4 *& | p_edge, | ||
LegoPathBoundary *& | p_boundary | ||
) |
[AI] Computes path vector and orientation for an actor given a transition along the resolved edge container sequence.
[AI]
p_grec | [AI] Edge transition container (LegoPathEdgeContainer). |
p_v1 | [AI] Output: next position vector for the actor. |
p_v2 | [AI] Output: next direction vector for the actor. |
p_f1 | [AI] Interpolation parameter or normalized distance along the transition. |
p_edge | [AI] Output: pointer to the next transition edge taken. |
p_boundary | [AI] Output: pointer to the target boundary. |
Definition at line 933 of file legopathcontroller.cpp.
MxResult LegoPathController::FUN_1004a380 | ( | Vector3 & | p_param1, |
Vector3 & | p_param2, | ||
Mx3DPointFloat * | p_param3, | ||
LegoPathBoundary *& | p_boundary, | ||
MxFloat & | p_param5 | ||
) |
[AI] Finds earliest intersection and placement on a valid boundary for the provided vectors and updates parameters as needed.
[AI]
p_param1 | [AI] Reference vector for placement update. |
p_param2 | [AI] Reference direction for placement update. |
p_param3 | [AI] Array of three 3D float points used in intersection calculation. |
p_boundary | [AI] Output: chosen boundary for intersection, if any. |
p_param5 | [AI] In/out intersection parameter: updated if intersection found. |
Definition at line 966 of file legopathcontroller.cpp.
|
inlinestatic |
[AI] Provides static access to the boundary at given index in g_ctrlBoundariesA.
p_index | [AI] The index of the control boundary to retrieve. |
Definition at line 308 of file legopathcontroller.h.
|
inlinestatic |
[AI] Provides static access to the boundary at given index in g_ctrlBoundariesB.
p_index | [AI] The index of the control boundary to retrieve. |
Definition at line 322 of file legopathcontroller.h.
|
inlinestatic |
[AI] Provides static access to the edge at a given index in g_ctrlEdgesA.
p_index | [AI] The index of the control edge to retrieve. |
Definition at line 301 of file legopathcontroller.h.
|
inlinestatic |
[AI] Provides static access to the edge at a given index in g_ctrlEdgesB.
p_index | [AI] The index of the control edge to retrieve. |
Definition at line 315 of file legopathcontroller.h.
LegoPathBoundary * LegoPathController::GetPathBoundary | ( | const char * | p_name | ) |
[AI] Searches for a path boundary by name among owned boundaries.
[AI]
p_name | [AI] Name to search for (case-insensitive). [AI] |
Definition at line 394 of file legopathcontroller.cpp.
|
static |
[AI] Static initializer for global controller boundary/edge arrays.
Allocates the global lookup tables for controller-bounded objects.
Definition at line 428 of file legopathcontroller.cpp.
|
overridevirtual |
[AI] Checks inheritance by class name for type introspection.
[AI]
p_name | Class name to check. [AI] |
Reimplemented from MxCore.
MxResult LegoPathController::PlaceActor | ( | LegoPathActor * | p_actor | ) |
[AI] Registers an actor as controlled by this path controller without moving it to a specific boundary location, e.g., after controller change.
[AI]
p_actor | [AI] The actor to register. |
Definition at line 315 of file legopathcontroller.cpp.
MxResult LegoPathController::PlaceActor | ( | LegoPathActor * | p_actor, |
const char * | p_name, | ||
MxS32 | p_src, | ||
float | p_srcScale, | ||
MxS32 | p_dest, | ||
float | p_destScale | ||
) |
[AI] Places an actor on a boundary at given source/destination edge indices, commonly for track segment transitions (e.g., for vehicles).
[AI]
p_actor | [AI] Pointer to the path actor to move. |
p_name | [AI] Name of the path boundary to use as source/destination. |
p_src | [AI] Index of the source edge on the boundary. |
p_srcScale | [AI] Scaled offset on the source edge (0..1), for fine placement. |
p_dest | [AI] Index of destination edge on the boundary. |
p_destScale | [AI] Scaled offset on the destination edge (0..1), for fine placement. |
Definition at line 201 of file legopathcontroller.cpp.
MxResult LegoPathController::PlaceActor | ( | LegoPathActor * | p_actor, |
LegoAnimPresenter * | p_presenter, | ||
Vector3 & | p_position, | ||
Vector3 & | p_direction | ||
) |
[AI] Places an actor using an animation presenter and direct position/direction data.
Used for initial placement or precise positioning by external systems. [AI]
p_actor | [AI] Pointer to the actor. |
p_presenter | [AI] Animation presenter used for visual/behavior state. |
p_position | [AI] Starting position in world coordinates. |
p_direction | [AI] Direction vector for initial movement or facing. |
Definition at line 241 of file legopathcontroller.cpp.
MxResult LegoPathController::RemoveActor | ( | LegoPathActor * | p_actor | ) |
[AI] Removes an actor from the controller, detaches it from controlled boundaries, and clears associations.
[AI]
p_actor | [AI] Actor to remove. |
Definition at line 329 of file legopathcontroller.cpp.
|
static |
[AI] Resets (cleans up) global controller boundary/edge arrays allocated by Init().
Definition at line 443 of file legopathcontroller.cpp.
|
overridevirtual |
[AI] Implements the tickle (per-frame update) callback for the controller.
[AI]
[AI] Updates animation state for managed actors along the path. [AI]
Reimplemented from MxCore.
Definition at line 193 of file legopathcontroller.cpp.