33 {
"INT38",
NULL, {3.69, -1.31251, -59.231}, {-0.99601698, 0.0, -0.089166}},
111 m_unk0x1c = p_time + 2000.0f;
118 Vector3 positionRef(p_transform[3]);
122 if (m_unk0x1c > p_time) {
125 position = positionRef;
128 positionRef = position;
140 positionRef -= g_unk0x10104ef0;
164 Vector3(local2world[3]) += g_unk0x10104ef0;
190 if (p_bool && !strncmp(roi->
GetName(),
"dammo", 5)) {
192 if (sscanf(roi->
GetName(),
"dammo%d", &index) != 1) {
197 ((
Act3*) m_world)->EatDonut(index);
206 if (((
Act3*) m_world)->m_brickster->GetROI() != roi) {
225 ((
Act3*) m_world)->AddCop(
this);
242 MxTrace(
"Bad Act3 cop destination %d\n", i);
249 if (point.
Dot(point, *boundary0x14) + boundary0x14->
index_operator(3) <= 0.001 &&
259 "Act3 cop destination %d (%g, %g, %g) is not on plane of boundary %s...adjusting to (%g, %g, %g)\n",
273 if (
m_animMaps[i]->GetUnknown0x00() == -1.0f) {
287 if (m_unk0x20 > 0.0f && m_unk0x20 <
m_lastTime) {
300 if (distance < 4.0f) {
305 if (distance < 25.0f) {
397 (grec ==
NULL || locald8 < local18)) {
399 local134 = local138 = grec;
408 local13c = local140 = r2;
422 if (boundary !=
NULL) {
437 local14c = local150 = grec;
448 local154 = local158 =
m_grec;
455 if (
m_grec->size() == 0) {
479 edge =
m_grec->front().m_edge;
558 ((
Act3*) m_world)->SetBrickster(
this);
561 if (
m_animMaps[i]->GetUnknown0x00() == -1.0f) {
573 if (
m_lastTime <= m_unk0x20 && m_unk0x20 <= p_time) {
577 if (m_unk0x38 != 3 && m_unk0x38 != 4) {
581 if (m_unk0x54 < p_time) {
582 ((
Act3*) m_world)->FUN_10072ad0(5);
583 m_unk0x54 = p_time + 15000.0f;
592 m_unk0x20 = p_time + 2000.0f;
597 if (m_unk0x58 >= 8) {
598 ((
Act3*) m_world)->FUN_10072ad0(6);
607 assert(m_shootAnim && m_pInfo);
609 if (m_unk0x50 < p_time) {
638 float time = p_time - (m_unk0x50 - m_shootAnim->
GetDuration());
648 assert(m_shootAnim && m_bInfo);
650 if (m_unk0x50 < p_time) {
651 ((
Act3*) m_world)->FUN_10073a60();
676 local80 -= m_unk0x3c;
685 float time = p_time - (m_unk0x50 - m_shootAnim->
GetDuration());
696 assert(m_shootAnim && m_pInfo);
708 assert(m_shootAnim && m_bInfo);
725 m_unk0x24 = p_time + 10000.0f;
729 if (m_unk0x24 < p_time) {
732 else if (m_unk0x24 - 9000.0f < p_time) {
752 if (!strncmp(r->
GetName(),
"pammo", 5)) {
754 if (sscanf(r->
GetName(),
"pammo%d", &index) != 1) {
800 if (m_unk0x58 < 8 && m_unk0x24 + 5000.0f <
m_lastTime) {
817 ((
Act3*) m_world)->m_shark->EatPizza(pizza);
837 (grec ==
NULL || locald8 < local18)) {
839 local168 = local16c = grec;
848 local170 = local174 = r2;
867 for (
MxS32 i = 0; i < length; i++) {
868 if (bInfo[i].m_unk0x11 < 0 && bInfo[i].
m_boundary !=
NULL && bInfo[i].m_entity !=
NULL && i != 0 &&
869 (local120 == -1 || i != 15)) {
870 Mx3DPointFloat local188(bInfo[i].m_x, bInfo[i].m_y, bInfo[i].m_z);
876 if (local120 < 0 || length < local124) {
884 if (local120 != -1) {
886 m_bInfo = &bInfo[local120];
892 m_pInfo = &pInfo[local120];
899 if (localf4 !=
NULL) {
900 assert(m_pInfo || m_bInfo);
921 local1bc = local1c0 = grec;
942 local1c4 = local1c8 =
m_grec;
949 if (
m_grec->size() == 0) {
974 edge =
m_grec->front().m_edge;
1000 if (m_pInfo !=
NULL) {
1003 else if (m_bInfo !=
NULL) {
1013MxS32 Act3Brickster::FUN_10042300()
1031 local18 = local64[0];
1035 local18 = local64[1];
1039 if (local24[1] < local24[0]) {
1043 if (local24[local1c] < 225.0f) {
1051 if (m_pInfo !=
NULL) {
1065 boundaries[1] =
NULL;
1068 float local78, local98;
1070 if (boundaries[i] !=
NULL) {
1080 local18 -= local64[local1c];
1084 local18 = local64[local1c];
1087 if (maxE ==
NULL || (local18.
Dot(local94, local18) < 0.0f && local78 < local98)) {
1114 if (m_unk0x38 != 8) {
1144 m_eatPizzas.push_back(p_ammo);
1153 if (m_nextPizza ==
NULL) {
1154 if (m_eatPizzas.size() > 0) {
1155 m_nextPizza = m_eatPizzas.front();
1156 m_eatPizzas.pop_front();
1158 roiMap[1] = m_nextPizza->
GetROI();
1164 if (m_nextPizza ==
NULL) {
1169 float time = m_unk0x2c + m_unk0x34->
GetDuration();
1171 if (time > p_time) {
1172 float duration = p_time - m_unk0x2c;
1192 roiMap[1] = m_unk0x38;
1193 ((
Act3*) m_world)->RemovePizza(*m_nextPizza);
1211 while (token !=
NULL) {
1215 if (presenter !=
NULL) {
1218 if (token !=
NULL) {
1227 ((
Act3*) m_world)->SetShark(
this);
1229 m_unk0x38 = m_unk0x34->
m_roiMap[1];
#define MAX_DONUTS
[AI] Maximum number of donuts that can be handled in Act 3 logic.
#define MAX_PIZZAS
[AI] Maximum number of pizzas that can be handled in Act 3 logic.
Act3Cop::Act3CopDest g_copDest[5]
[AI] Represents a generic animatable actor in Act 3, supporting path following and custom animation t...
Act3Actor()
[AI] Constructs a new Act3Actor, initializing state.
MxResult HitActor(LegoPathActor *p_actor, MxBool p_bool) override
[AI] Called when this actor is hit/collided by another actor, such as a projectile or another charact...
MxU32 VTable0x90(float p_time, Matrix4 &p_transform) override
[AI] Handles transformation updates for the actor.
Represents an ammo object (pizza or donut) used in Act 3 gameplay sequence.
void SetSharkFood(MxBool p_sharkFood)
Sets the "shark food" flag if this ammo should become food for a shark.
MxU32 IsSharkFood()
Returns true if the ammo became "shark food".
MxU32 IsValid()
Returns true if the ammo is valid (active in game/world).
[AI] Represents the Brickster actor in Act 3, with AI and scene logic for stealing pizzas and causing...
MxResult HitActor(LegoPathActor *p_actor, MxBool p_bool) override
[AI] Handles Brickster being hit by an actor (e.g., cop, pizza ammo), processes pizza counters and de...
MxResult FUN_100417c0()
[AI] Recalculates Brickster's navigation to a new plant/building/target as dictated by AI logic.
void Animate(float p_time) override
[AI] Main logic for Brickster's per-frame AI behavior: handles pizza seeking, plant/building attacks,...
void ParseAction(char *p_extra) override
[AI] Parses Brickster-specific commands from action strings; sets its world reference and triggers th...
~Act3Brickster() override
[AI] Frees Brickster resources, implemented for correct inheritance.
Act3Brickster()
[AI] Constructs a Brickster character, setting default animation and navigation state.
MxResult FUN_100417a0(Act3Ammo &p_ammo, const Vector3 &)
[AI] Triggers the Brickster to react to a thrown pizza.
MxResult VTable0x9c() override
[AI] Handles AI updates post pathfinding/state transition recalculation.
void SwitchBoundary(LegoPathBoundary *&p_boundary, LegoUnknown100db7f4 *&p_edge, float &p_unk0xe4) override
[AI] Switches navigation/path boundary for Brickster and updates edge and offset (stateful for when e...
[AI] Represents a police officer actor in Act 3, supporting specific cop AI actions,...
MxResult FUN_10040360()
[AI] Internal: recalculates cop movement/path container target.
void Animate(float p_time) override
[AI] Per-frame animation update, handles cop AI state switching to seek donuts, interact with Brickst...
Act3Cop()
[AI] Constructs a new police officer actor, initializing references and default patrol states.
MxResult VTable0x9c() override
[AI] Performs path container recalculation for cop AI movement.
MxResult HitActor(LegoPathActor *, MxBool) override
[AI] Processes collision with another actor, especially for handling donut pickups and Brickster inte...
MxResult FUN_10040350(Act3Ammo &p_ammo, const Vector3 &)
[AI] Triggers the cop to attempt to intercept or react to a thrown donut.
void ParseAction(char *p_extra) override
[AI] Parses incoming action command strings for cop-specific data and registers itself with the world...
[AI] Represents the shark actor for Act 3 of the LEGO Island game.
Act3Shark()
[AI] Constructs a new Act3Shark object, initializing internal state.
void Animate(float p_time) override
[AI] Handles per-frame animation updates for the shark, synchronizing animation with pizza consumptio...
virtual MxResult EatPizza(Act3Ammo *p_ammo)
[AI] Called when the shark "eats" a pizza.
void ParseAction(char *) override
[AI] Handles additional parsing logic for shark-specific actions, such as animation triggers.
[AI] Controls all main logic and progression of Act 3 in LEGO Island, including objects,...
Act3Cop * m_cop2
[AI] Second cop, instantiated when both are present.
void EatPizza(MxS32 p_index)
[AI] Simulates eating (removing) a pizza from the world at the given index.
Act3Ammo m_pizzas[MAX_PIZZAS]
[AI] All possible pizza projectiles/instances in flight for this sequence.
Act3Brickster * m_brickster
[AI] Main antagonist.
Act3Ammo m_donuts[MAX_DONUTS]
[AI] All possible donuts in flight/active for Act3's special logic.
Act3Cop * m_cop1
[AI] First cop involved in sequence (player/AI).
void ParseAction(char *p_extra) override
[AI] Handles extra action strings, looks for animation assignments and delegates to presenters (overr...
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...
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...
LegoBuildingInfo * GetInfoArray(MxS32 &p_length)
[AI] Returns the full set of LegoBuildingInfo entries, checks/initializes boundary data if needed.
void ScheduleAnimation(LegoEntity *p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_unk0x28)
[AI] Schedules an animation bounce/effect for a given building entity (updates AnimEntry tracking and...
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.
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
MxBool m_cameraFlag
[AI] Set to TRUE if this entity is currently the camera target. [AI]
MxFloat m_worldSpeed
[AI] World-relative speed (can affect animation/movement logic). [AI]
LegoROI * m_roi
[AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI]
[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]
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]
MxFloat m_unk0xe4
[AI] Position scalar on destination edge (0-1 across the edge). [AI]
void ParseAction(char *p_extra) override
[AI] Parses a set of key-value action commands and configures path navigation and collision for this ...
LegoPathController * m_pathController
[AI] Path controller/manages permitted boundaries for transitions. [AI]
@ c_maxState
[AI] Max actor state (reserved for logic). [AI]
@ c_initial
[AI] Default state upon creation or reset. [AI]
@ c_disabled
[AI] Marks as disabled or inactive for path follow logic. [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_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 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.
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
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.
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 sequen...
MxBool FUN_10026c50(LegoEntity *p_entity)
[AI] Triggers a growth decrement or similar on a plant entity, and updates accordingly if possible.
LegoPlantInfo * GetInfoArray(MxS32 &p_length)
[AI] Returns pointer to plant info array and populates its size.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
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.
LegoUnknown100db7f4 ** GetEdges()
[AI] Gets the array of pointers to the edge objects that form this face.
const LegoChar * GetName()
[AI] Returns the name string of this edge, typically used for debugging and lookup.
Mx4DPointFloat * GetEdgeNormal(int index)
[AI] Returns a pointer to the 4D edge normal at the given sub-edge index.
Mx4DPointFloat * GetUnknown0x14()
[AI] Returns a pointer to the cached 4D normal or reference plane for the edge.
MxResult PlaceActor(LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale)
Places an actor along a path, from source to destination, using named references and scaling.
LegoPathBoundary * FindPathBoundary(const char *p_name)
Finds a path boundary in all path controllers by name.
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.
virtual void SetIdentity()
Sets this matrix to identity (diagonal 1, others 0).
[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.
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
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.
virtual int Unitize()
[AI] Scales the vector so its norm is 1 (unit vector).
[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.
float LenSquared() const override
[AI] Computes the squared magnitude (x^2 + y^2 + z^2) of this vector.
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)
const char * g_strANIMATION
[AI] Keyword used for tagging animation properties, types, or script commands.
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
#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.
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
#define MxTrace(args)
[AI] Macro for trace logging (non-variadic version, MSVC compatibility), expands to nothing.
MxTimer * Timer()
[AI] Returns the global simulation timer.
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
LegoPathBoundary * m_boundary
[AI] Cached pointer to the boundary object after resolving m_bName
MxFloat m_unk0x08[3]
[AI] World coordinates for the destination or checkpoint [AI_SUGGESTED_NAME: destinationPos]
float GetDuration()
[AI] Gets the length, in seconds, of the animation (delegates to anim tree).
LegoAnim * GetAnimTreePtr()
[AI] Returns the root animation tree node for this mapping.
LegoROI ** m_roiMap
[AI] Mapping of animation nodes to LEGO ROIs (meshes) [AI]
LegoROI ** GetROIMap()
[AI] Returns the mapping of tree nodes to LegoROI pointers (array of pointers, one per mesh/node).
[AI] Describes the state, configuration, and world placement of a single LEGO building entity,...
float m_y
[AI] World Y coordinate for the building's ground placement [AI]
LegoEntity * m_entity
[AI] Associated entity in the world for this building [AI]
float m_x
[AI] World X coordinate for the building's ground placement [AI]
float m_z
[AI] World Z coordinate for the building's ground placement [AI]
LegoPathBoundary * m_boundary
[AI] Pointer to the world boundary (collision/trigger volume) [AI]
MxS8 m_unk0x11
[AI] Counter or state value for construction/demolition progress [AI]
[AI] Represents an edge in the LEGO world geometry graph.
Vector3 * CWVertex(LegoWEEdge &p_face)
[AI] Returns the "clockwise" endpoint of this edge with respect to a given face.
Vector3 * GetPointA()
[AI] Gets the first endpoint (A) of the edge.
Vector3 * GetPointB()
[AI] Gets the second endpoint (B) of the edge.
Vector3 * CCWVertex(LegoWEEdge &p_face)
[AI] Returns the "counterclockwise" endpoint of this edge with respect to a given face.
[AI] Container for path boundary edges, also stores position, direction, and flags.
Mx3DPointFloat m_direction
[AI] 3D direction vector reference, e.g., average or intended facing. [AI]
LegoPathBoundary * m_boundary
[AI] Associated boundary for all contained edges; may be null if container is generic....
Mx3DPointFloat m_position
[AI] 3D position reference for the edge group, e.g., start or mean location. [AI]
MxU32 GetBit1()
[AI] Query if the c_bit1 flag is set.
[AI] Struct representing a single plant's static configuration on LEGO Island, including placement,...
MxS8 m_unk0x16
[AI] Unknown; appears to be a state variable, possibly animation frame or LOD index [AI]
float m_z
[AI] World Z position (depth/axis in world) [AI]
LegoPathBoundary * m_boundary
[AI] Pointer to a collision or path boundary for this plant, if any [AI]
float m_y
[AI] World Y position (vertical/elevation) [AI]
float m_x
[AI] World X position (center or reference) [AI]
LegoEntity * m_entity
[AI] Pointer to the associated entity instance (initialized later at runtime) [AI]
float m_position[3]
[AI] Alternate position array (likely for display, reference, or bounding computations) [AI]
[AI] Represents an advanced edge in the LEGO Island geometry system, with direction,...
LegoU32 GetMask0x03()
[AI] Returns a mask of flags relevant to the two faces (bits 0 and 1: c_bit1, c_bit2).
@ c_bit1
[AI] Bit flag 1 for face B connection/properties
LegoU32 FUN_10048c40(const Vector3 &p_position)
[AI] Tests if a position is on this edge based on its direction and points, within a precision thresh...
LegoWEEdge * OtherFace(LegoWEEdge *p_other)
[AI] Returns the opposite face pointer to the one passed in.