41 if (!p_fromDestructor) {
77 sprintf(name,
"pammo%d", p_index);
91 sprintf(name,
"dammo%d", p_index);
114 assert(p_srcDir[1] != 0);
116 MxFloat local1c = -(p_srcLoc[1] / p_srcDir[1]);
123 local34[0] = local34[2] = 0.0f;
132 for (
MxS32 i = 0; i < 3; i++) {
133 if (local18[0] == p_srcLoc[0]) {
137 m_eq[0][i] = (local48[i] * local48[i] + local48[i] * m_eq[1][i] * 2.0f) / ((local18[i] - p_srcLoc[i]) * 4.0f);
140 assert(m_eq[0][0] > 0.000001 || m_eq[0][0] < -0.000001);
142 m_unk0x19c = local48[0] / (m_eq[0][0] * 2.0f);
165 m_unk0x19c = p_unk0x19c;
192 m_unk0x19c = p_unk0x19c;
201MxResult Act3Ammo::FUN_10053db0(
float p_param1,
const Matrix4& p_param2)
203 float local34 = p_param1 * p_param1;
223 if (localc.Unitize() != 0) {
228 local14[1] = local14[2] = 0.0f;
230 local3c.EqualsCross(localc, local14);
232 if (local3c.Unitize() != 0) {
233 local14[0] = local14[1] = 0.0f;
235 local3c.EqualsCross(localc, local14);
237 if (local3c.Unitize() != 0) {
243 local14.EqualsCross(local3c, localc);
258 m_unk0x158 = p_time + 2000.0f;
263 Vector3 positionRef(transform[3]);
267 if (m_unk0x158 > p_time) {
270 position = positionRef;
273 positionRef = position;
282 positionRef -= g_unk0x10104f08;
327 local60.
Scale(2.0f, 2.0f, 2.0f);
330 local60.
Scale(5.0f, 5.0f, 5.0f);
342 local17c[1] = local17c[2] = 0.0f;
350 local184[1] = local184[2] = 0.0f;
365 local104.
Product(local60, localb0);
399 for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
400 if (plpas.find(*itpa) != plpas.end() &&
this != *itpa) {
401 LegoROI* r = (*itpa)->GetROI();
404 if (!strncmp(r->
GetName(),
"pammo", 5)) {
411 local1b4 -= local1c8;
414 if (local1b4.
LenSquared() <= radius * radius) {
416 if (sscanf(r->
GetName(),
"pammo%d", &index) != 1) {
436 else if (!strncmp(r->
GetName(),
"dammo", 5)) {
443 local1e4 -= local1f8;
446 if (local1e4.
LenSquared() <= radius * radius) {
448 if (sscanf(r->
GetName(),
"dammo%d", &index) != 1) {
Represents an ammo object (pizza or donut) used in Act 3 gameplay sequence.
void SetBit4(MxBool p_bit4)
Set or clear the bit4 flag, used internally for special state/behavior (e.g.
MxU32 IsPizza()
Returns true if the ammo is a pizza projectile.
MxU32 IsBit4()
Returns true if the internal bit4 flag is set (special usage, e.g.
@ c_donut
[AI] The ammo is a donut projectile. [AI]
@ c_pizza
[AI] The ammo is a pizza projectile. [AI]
void Animate(float p_time) override
Updates position, animation, and handles collision or end-of-trajectory logic for this ammo.
MxResult Create(Act3 *p_world, MxU32 p_isPizza, MxS32 p_index)
Creates an ammo (pizza or donut), initializes its ROI, bounding volumes, and enables it in the world.
MxU32 IsDonut()
Returns true if the ammo is a donut projectile.
MxResult FUN_10053cb0(LegoPathController *p_p, LegoPathBoundary *p_boundary, MxFloat p_unk0x19c)
Initializes the path controller/boundary and sets up animation and sound when ammo is fired.
MxU32 IsSharkFood()
Returns true if the ammo became "shark food".
void Destroy(MxBool p_fromDestructor) override
Completely removes this ammo object from all managers.
MxResult FUN_10053b40(const Vector3 &p_srcLoc, const Vector3 &p_srcDir, const Vector3 &p_srcUp)
Sets up trajectory control points for the projectile, calculating a quadratic curve based on origin/d...
MxU32 IsValid()
Returns true if the ammo is valid (active in game/world).
~Act3Ammo() override
Destructor.
MxResult Remove()
Removes this ammo instance from the world, cleans up path controller/boundary and notifies managers.
void SetValid(MxBool p_valid)
Set or clear the valid flag for the object, making it active or inactive in the world.
MxResult FUN_10053d30(LegoPathController *p_p, MxFloat p_unk0x19c)
Variant of firing logic (uses only controller and param, also sets bit4).
MxResult FUN_100417c0()
[AI] Recalculates Brickster's navigation to a new plant/building/target as dictated by AI logic.
[AI] Controls all main logic and progression of Act 3 in LEGO Island, including objects,...
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.
MxResult FUN_10073390(Act3Ammo &p_ammo, const Vector3 &p_param2)
[AI] Triggers script/animation effects on cops for donuts that impact them.
Act3Brickster * m_brickster
[AI] Main antagonist.
void FUN_10072ad0(undefined4 p_param1)
[AI] Triggers special sequence actions or sounds depending on the provided param; cycles through queu...
MxResult FUN_10073360(Act3Ammo &p_ammo, const Vector3 &p_param2)
[AI] Triggers script/animation effects on the brickster for pizzas that impact him.
void EatDonut(MxS32 p_index)
[AI] Simulates eating (removing) a donut from the world at the given index.
void RemoveDonut(Act3Ammo &p_p)
[AI] Removes given donut actor and performs associated logic.
void RemovePizza(Act3Ammo &p_p)
[AI] Removes given pizza actor and performs associated logic.
[AI] Represents a bounding sphere in 3D space with center and radius.
const float & Radius() const
[AI] Const accessor for the sphere radius.
const Vector3 & Center() const
[AI] Const accessor for the center of the sphere.
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 * CreateAutoROI(const char *p_name, const char *p_lodName, MxBool p_createEntity)
[AI] Creates an "auto" ROI object with the given name, LOD name, and optional entity creation.
void ReleaseActor(const char *p_name)
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
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]
MxFloat m_actorTime
[AI] Animation time for current path segment. [AI]
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]
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]
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]
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
LegoPathActorSet & GetActors()
[AI] Direct access to the actor set for this boundary.
MxResult RemoveActor(LegoPathActor *p_actor)
[AI] Removes the actor from this boundary's actor set.
[AI] Manager for controlling actors' movement along predefined geometric paths.
MxResult RemoveActor(LegoPathActor *p_actor)
[AI] Removes an actor from the controller, detaches it from controlled boundaries,...
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
void SetBoundingSphere(const BoundingSphere &p_sphere)
[AI] Sets the local and world bounding spheres.
const LegoChar * GetName() const
[AI] Gets this ROI's name.
BoundingSphere & GetBoundingSphere()
[AI] Accesses the local bounding sphere object.
LegoCacheSoundManager * GetCacheSoundManager()
[AI] Returns the cache sound manager used to cache and reuse sound effects.
Mx4DPointFloat * GetUnknown0x14()
[AI] Returns a pointer to the cached 4D normal or reference plane for the edge.
4x4 Matrix class with virtual interface for manipulation and transformation.
void RotateY(const float &p_angle)
Applies a rotation (in radians or degrees, depending on implementation) about the Y axis.
void RotateX(const float &p_angle)
Applies a rotation (in radians or degrees, depending on implementation) about the X axis.
void Scale(const float &p_x, const float &p_y, const float &p_z)
Applies scaling factors along X, Y, and Z axes.
virtual void Product(float(*p_a)[4], float(*p_b)[4])
Multiplies two 4x4 float matrices, storing result in this.
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] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
const BoundingSphere & GetWorldBoundingSphere() const override
Returns the object's bounding sphere in world coordinates.
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 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)
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.
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....