Isle
Loading...
Searching...
No Matches
LegoPathBoundary Class Reference

[AI] Represents a path segment or boundary in the navigation network for actors (vehicles, NPCs). More...

#include <legopathboundary.h>

Inheritance diagram for LegoPathBoundary:
Collaboration diagram for LegoPathBoundary:

Public Member Functions

 LegoPathBoundary ()
 [AI] Constructs a LegoPathBoundary, initializing internal actor/presenter storage. More...
 
 ~LegoPathBoundary () override
 [AI] Destructor. More...
 
MxResult AddActor (LegoPathActor *p_actor)
 [AI] Adds the given actor to this path boundary and sets its boundary pointer. More...
 
MxResult RemoveActor (LegoPathActor *p_actor)
 [AI] Removes the actor from this boundary's actor set. More...
 
void FUN_100575b0 (Vector3 &p_point1, Vector3 &p_point2, LegoPathActor *p_actor)
 [AI] Handles processing path triggers along this boundary as an actor moves from p_point1 to p_point2. More...
 
void SwitchBoundary (LegoPathActor *p_actor, LegoPathBoundary *&p_boundary, LegoUnknown100db7f4 *&p_edge, float &p_unk0xe4)
 [AI] Switches the boundary that the actor is associated with based on edge traversal. More...
 
MxU32 Intersect (float p_scale, Vector3 &p_point1, Vector3 &p_point2, Vector3 &p_point3, LegoUnknown100db7f4 *&p_edge)
 [AI] Tests for intersection between a path and this boundary; finds the first edge hit and intersection point. More...
 
MxU32 FUN_10057fe0 (LegoAnimPresenter *p_presenter)
 [AI] Adds an animation presenter to the set if within region, based on spatial bounds. More...
 
MxU32 FUN_100586e0 (LegoAnimPresenter *p_presenter)
 [AI] Removes an animation presenter from the set, or if nullptr resets all presenters' world association. More...
 
LegoPathActorSetGetActors ()
 [AI] Direct access to the actor set for this boundary. More...
 
LegoAnimPresenterSetGetPresenters ()
 [AI] Direct access to the animation presenter set for this boundary. More...
 
- Public Member Functions inherited from LegoWEGEdge
 LegoWEGEdge ()
 [AI] Constructs a LegoWEGEdge and initializes its member variables. More...
 
 ~LegoWEGEdge () override
 [AI] Destroys this edge instance and properly deallocates memory for associated dynamic members. More...
 
LegoS32 VTable0x04 () override
 [AI] Performs geometry calculations for the edge, sets up normals, center point, and trigger vectors. More...
 
LegoU32 GetFlag0x10 ()
 Returns TRUE if the 'disabled' flag is not set, otherwise FALSE. More...
 
Mx4DPointFloatGetUnknown0x14 ()
 [AI] Returns a pointer to the cached 4D normal or reference plane for the edge. More...
 
Mx4DPointFloatGetEdgeNormal (int index)
 [AI] Returns a pointer to the 4D edge normal at the given sub-edge index. More...
 
const LegoCharGetName ()
 [AI] Returns the name string of this edge, typically used for debugging and lookup. More...
 
void SetFlag0x10 (LegoU32 p_disable)
 [AI] Sets the enabled/disabled flag for this edge. More...
 
LegoU8 GetMask0x03 ()
 [AI] Returns a two-bit mask of the first two edge state flags (bit1, bit2). More...
 
- Public Member Functions inherited from LegoWEEdge
 LegoWEEdge ()
 [AI] Constructs a LegoWEEdge with no edges. More...
 
virtual ~LegoWEEdge ()
 [AI] Destroys the LegoWEEdge object, releasing memory used by its edge list. More...
 
virtual LegoS32 VTable0x04 ()
 [AI] Connects and links the associated edge objects to set up adjacency across the face. More...
 
LegoU8 GetNumEdges ()
 [AI] Returns the number of edge elements assigned to this face. More...
 
LegoUnknown100db7f4 ** GetEdges ()
 [AI] Gets the array of pointers to the edge objects that form this face. More...
 
LegoU32 IsEqual (LegoWEEdge *p_other)
 [AI] Checks if this face object is the same as another. More...
 
void SetEdges (LegoUnknown100db7f4 **p_edges, LegoU8 p_numEdges)
 [AI] Assigns the edge list and count for this face. More...
 

Additional Inherited Members

- Public Types inherited from LegoWEGEdge
enum  { c_bit1 = 0x01 , c_bit2 = 0x02 , c_bit3 = 0x04 , c_bit5 = 0x10 }
 [AI] Flags controlling various edge behaviors and states. [AI] More...
 
- Protected Member Functions inherited from LegoWEGEdge
LegoS32 FUN_1009aea0 ()
 [AI] Internal routine called by VTable0x04 for validity checking of polygon vertices and normal consistency. More...
 
- Protected Attributes inherited from LegoWEGEdge
LegoU8 m_flags
 [AI] Flags indicating edge state, enabled/disabled, and type bits. [AI] More...
 
LegoU8 m_unk0x0d
 [AI] Unknown, used for internal status/tracking. [AI] More...
 
LegoCharm_name
 [AI] Edge's name string, dynamically allocated for debug/lookup. [AI] More...
 
Mx4DPointFloat m_unk0x14
 [AI] 4D plane equation or normal used for polygon/edge side tests. [AI] More...
 
Mx4DPointFloatm_edgeNormals
 [AI] Per-edge normals for each polygon segment, allocated dynamically. [AI] More...
 
Mx3DPointFloat m_unk0x30
 [AI] Cached center for the edge polygon, used in geometric calculations. [AI] More...
 
float m_unk0x44
 [AI] Maximum squared distance from center—polygon bounding radius or similar. [AI] More...
 
LegoU8 m_numTriggers
 [AI] Number of trigger (path/segment) structures attached to this edge. [AI] More...
 
PathWithTriggerm_pathTrigger
 [AI] Array of triggers influencing entity motion or event logic on this edge. [AI] More...
 
Mx3DPointFloatm_unk0x50
 [AI] Transition direction/unit vector—used for edge trigger geometry. [AI] More...
 
- Protected Attributes inherited from LegoWEEdge
LegoU8 m_numEdges
 [AI] Number of edge elements in m_edges; number of sides of the polygon. [AI] More...
 
LegoUnknown100db7f4 ** m_edges
 [AI] Array of pointers to edge objects (LegoUnknown100db7f4) comprising this face. [AI] More...
 

Detailed Description

[AI] Represents a path segment or boundary in the navigation network for actors (vehicles, NPCs).

[AI] Inherits from LegoWEGEdge, connecting multiple path edges and managing the set of actors present on this path segment as well as relevant animation presenters. Provides API for actor entry, removal, intersection testing, and traversal between boundaries.

Definition at line 59 of file legopathboundary.h.

Constructor & Destructor Documentation

◆ LegoPathBoundary()

LegoPathBoundary::LegoPathBoundary ( )

[AI] Constructs a LegoPathBoundary, initializing internal actor/presenter storage.

Definition at line 13 of file legopathboundary.cpp.

◆ ~LegoPathBoundary()

LegoPathBoundary::~LegoPathBoundary ( )
override

[AI] Destructor.

Cleans up actors and removes their boundary association.

Definition at line 19 of file legopathboundary.cpp.

Member Function Documentation

◆ AddActor()

MxResult LegoPathBoundary::AddActor ( LegoPathActor p_actor)

[AI] Adds the given actor to this path boundary and sets its boundary pointer.

Parameters
p_actorPointer to LegoPathActor to add. [AI]
Returns
Result code (SUCCESS on success, or error code). [AI]

Definition at line 30 of file legopathboundary.cpp.

◆ FUN_100575b0()

void LegoPathBoundary::FUN_100575b0 ( Vector3 p_point1,
Vector3 p_point2,
LegoPathActor p_actor 
)

[AI] Handles processing path triggers along this boundary as an actor moves from p_point1 to p_point2.

[AI] Checks all triggers if the movement between points crosses their threshold, calling the appropriate trigger handler per trigger direction.

Parameters
p_point1Starting position of movement. [AI]
p_point2Ending position of movement. [AI]
p_actorActor moving along the path. [AI]

Definition at line 47 of file legopathboundary.cpp.

◆ FUN_10057fe0()

MxU32 LegoPathBoundary::FUN_10057fe0 ( LegoAnimPresenter p_presenter)

[AI] Adds an animation presenter to the set if within region, based on spatial bounds.

[AI] Inserts specific subclass instances (e.g., LegoLocomotionAnimPresenter*). Used for assigning control to presenters within range.

Parameters
p_presenterAnimation presenter instance. [AI]
Returns
1 if added, 0 if not. [AI]

Definition at line 343 of file legopathboundary.cpp.

◆ FUN_100586e0()

MxU32 LegoPathBoundary::FUN_100586e0 ( LegoAnimPresenter p_presenter)

[AI] Removes an animation presenter from the set, or if nullptr resets all presenters' world association.

Parameters
p_presenterAnimation presenter to remove, or NULL for batch removal. [AI]
Returns
1 if removed, 0 if not found or batch reset. [AI]

Definition at line 366 of file legopathboundary.cpp.

◆ GetActors()

LegoPathActorSet & LegoPathBoundary::GetActors ( )
inline

[AI] Direct access to the actor set for this boundary.

Returns
Reference to the internal actor set. [AI]

Definition at line 146 of file legopathboundary.h.

◆ GetPresenters()

LegoAnimPresenterSet & LegoPathBoundary::GetPresenters ( )
inline

[AI] Direct access to the animation presenter set for this boundary.

Returns
Reference to the internal presenter set. [AI]

Definition at line 152 of file legopathboundary.h.

◆ Intersect()

MxU32 LegoPathBoundary::Intersect ( float  p_scale,
Vector3 p_point1,
Vector3 p_point2,
Vector3 p_point3,
LegoUnknown100db7f4 *&  p_edge 
)

[AI] Tests for intersection between a path and this boundary; finds the first edge hit and intersection point.

[AI] Used for navigation/pathfinding. If the segment crosses an edge, calculates where it intersects and on which subedge.

Parameters
p_scaleScaling factor, typically unused in current impl. [AI]
p_point1Segment start position. [AI]
p_point2Segment end position. [AI]
p_point3Output: the computed intersection point. [AI]
p_edgeOutput: pointer to the edge crossed/found. [AI]
Returns
0 if no intersection, 1 or 2 depending on tangent or corner intersection. [AI]

Definition at line 183 of file legopathboundary.cpp.

◆ RemoveActor()

MxResult LegoPathBoundary::RemoveActor ( LegoPathActor p_actor)

[AI] Removes the actor from this boundary's actor set.

Parameters
p_actorPointer to actor to remove. [AI]
Returns
Result code (SUCCESS on success, or error code). [AI]

Definition at line 39 of file legopathboundary.cpp.

◆ SwitchBoundary()

void LegoPathBoundary::SwitchBoundary ( LegoPathActor p_actor,
LegoPathBoundary *&  p_boundary,
LegoUnknown100db7f4 *&  p_edge,
float &  p_unk0xe4 
)

[AI] Switches the boundary that the actor is associated with based on edge traversal.

[AI] Handles neighbor boundary search and traversal logic with respect to actor navigation flags and edge properties.

Parameters
p_actorThe actor potentially switching boundaries. [AI]
p_boundaryReference to the actor's current boundary, will be updated if switch occurs. [AI]
p_edgeReference to the edge across which the switch may occur; updates during process. [AI]
p_unk0xe4Value representing fractional progress/tangent or orientation for traversal; may be adjusted. [AI]

Definition at line 86 of file legopathboundary.cpp.


The documentation for this class was generated from the following files: