243 if (p_maxLinearVelocity < 0) {
271 if (
m_animMaps[i]->GetUnknown0x00() == -1.0f) {
274 else if (
m_animMaps[i]->GetUnknown0x00() == -2.0f) {
279 assert(m_skelKick1Anim && m_skelKick2Anim);
315 deltaTime = p_param - m_unk0x58;
317 if (a->
GetDuration() <= deltaTime || deltaTime < 0.0) {
363 float skeletonCurAnimPosition;
364 float skeletonCurAnimDuration;
368 float skeletonCurAnimPhase = skeletonCurAnimPosition / skeletonCurAnimDuration;
372 skeletonCurAnimPhase <= current->m_upper) {
375 current = ¤t[1];
381 "Got kicked in boundary %s %d %g:%g %g\n",
383 skeletonCurAnimPosition,
384 skeletonCurAnimDuration,
390 m_unk0x58 = p_param1;
425 sprintf(buffer,
"%g", absoluteSpeed / maximumSpeed);
431 if (absoluteSpeed > 0.83 * maximumSpeed) {
436 MxS32 gearRpmFactor = (
MxS32) (6.0 * absoluteSpeed) % 100;
442 if (absoluteSpeed != 0.0f) {
482 const char* soundKey =
NULL;
492 else if (actorIsRhoda) {
506 else if (actorIsRhoda) {
596 if (p_worldSpeed < 0) {
624 sprintf(buffer,
"%g", speedRatio);
696 const char* soundKey =
NULL;
705 else if (actorIsValerie) {
Implements the LEGO Island car race game mode.
RaceSkel * GetSkeleton()
Provides access to the RaceSkel (race skeleton) object managing actor animations or kinematics.
[AI] LEGO Island's "Jetski" racing game logic and presenter class, derived from LegoRace.
LegoCacheSound * m_sound
[AI] Pointer to a currently active sound instance played by the actor, if any.
MxFloat m_frequencyFactor
[AI] The frequency/pitch scaling factor for the actor's sound (default 0 == normal).
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...
LegoResult FUN_1009f490(LegoFloat p_time, Matrix4 &p_matrix)
[AI] Evaluates this scene's animation at the given time, updating the passed matrix.
LegoAnimScene * GetCamAnim()
[AI] Gets the optional camera/scene animation track.
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.
void FUN_100123e0(const Matrix4 &p_transform, MxU32 p_und)
Sets the camera's transformation matrix in the 3D view, optionally applying a blend with the internal...
MxResult VTable0x9c() override
[AI] Handles the transition at key animation logic points, such as the end/start of edges and boundar...
virtual void FUN_10080590(float p_time)
[AI] Adjusts the target and acceleration for the car based on path, player position,...
MxU8 m_unk0x0c
[AI] State variable/fsm controlling the actor's current animation/logic state. [AI]
void Animate(float p_time) override
[AI] Main per-frame update for the car racer, controls activation of animation and state switching ba...
virtual void SetWorldSpeed(MxFloat p_worldSpeed)
[AI] Sets the current world speed value for this entity (used to control motion/animation rate).
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [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]
void Animate(float p_time) override
[AI] Per-frame logic and animation for jetski racing - enables racing state and syncs with variables....
[AI] Represents a Jetski actor in the race, combining behavior from LegoJetskiRaceActor and LegoRaceM...
static void InitSoundIndices()
[AI] Initializes static indices for jetski-specific sound arrays to randomized starting positions.
void ParseAction(char *p_extra) override
[AI] Parses an action string to configure or trigger Jetski behaviors such as switching race boundari...
void SetWorldSpeed(MxFloat p_worldSpeed) override
[AI] Sets world speed for the jetski, influencing both physics and animation logic.
MxLong Notify(MxParam &p_param) override
[AI] Processes notifications/events for the LegoJetski instance (see MxCore).
virtual void FUN_100136f0(float p_worldSpeed)
[AI] Custom world speed handler for clamping or setting maximum velocity for the jetski.
MxResult HitActor(LegoPathActor *p_actor, MxBool p_bool) override
[AI] Handles collision/hit logic between this jetski and another race actor.
void Animate(float p_time) override
[AI] Updates jetski animation for the current frame.
MxFloat GetMaxLinearVel()
[AI] Returns the current maximum linear velocity (units per sec).
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
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.
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]
@ c_initial
[AI] Default state upon creation or reset. [AI]
MxBool m_userNavFlag
[AI] TRUE if this actor is currently user/player controlled. [AI]
void SetActorState(MxU32 p_actorState)
[AI] Sets the navigation/path state of the actor.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
const LegoChar * GetName() const
[AI] Gets this ROI's name.
[AI] Represents a Race Car actor in the game, combining advanced pathing, skeleton kick logic,...
void ParseAction(char *p_extra) override
[AI] Parses an action string to configure or trigger car behaviors (e.g., updates kick animation refe...
MxResult HitActor(LegoPathActor *p_actor, MxBool p_bool) override
[AI] Handles player/AI actor collision—score, animation, and sound effects, as well as respawn logic ...
static void InitSoundIndices()
[AI] Initializes sound playback array indices for collision sounds to randomized values.
MxLong Notify(MxParam &p_param) override
[AI] Processes notifications/events for the LegoRaceCar (see MxCore).
void Animate(float p_time) override
[AI] Main animation tick function; handles skeleton kick special states when user-controlled.
void SetWorldSpeed(MxFloat p_worldSpeed) override
[AI] Sets world speed for the race car, either for user nav or animation context.
virtual MxU32 HandleSkeletonKicks(float p_param1)
[AI] Handles transition between skeleton kick phases based on animation time and current boundary.
virtual void SetMaxLinearVelocity(float p_maxLinearVelocity)
[AI] Sets the maximum linear velocity the car is allowed to attain (and can force 0 for "despawn" eff...
static void FUN_10012de0()
[AI] Resets static sound state variables for the car (last sound time, stopped flag,...
MxResult VTable0x9c() override
[AI] Finalizes animation phase/post-kick state machine.
virtual void FUN_10012ff0(float p_param)
[AI] Handles skeleton kick transition logic for given time; switches state as needed.
virtual void FUN_1005d4b0()
[AI] Updates the minimap overlay position and enables/disables the overlay image as needed.
MxLong Notify(MxParam &p_param) override
[AI] Handles notifications, especially for UI control interactions (e.g., clicking the map control to...
void ParseAction(char *p_extra) override
[AI] Parses action strings for map locator and geometry mapping and links control and map geometry to...
[AI] Base class for all race-type LegoWorlds.
virtual void VTable0x7c(LegoRaceMap *p_map, MxU32 p_index)
[AI] Associates a race map instance to the maps array at the given index.
LegoCacheSoundManager * GetCacheSoundManager()
[AI] Returns the cache sound manager used to cache and reuse sound effects.
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.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
LegoPathBoundary * FindPathBoundary(const char *p_name)
Finds a path boundary in all path controllers by name.
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
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 ...
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
void SetVariable(const char *p_key, const char *p_value)
Sets a variable by key and value, replacing or updating if it exists.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
[AI] Specialized skeleton animation actor for LEGO Island car racing sequences.
void GetCurrentAnimData(float *p_outCurAnimPosition, float *p_outCurAnimDuration)
[AI] Retrieves the current animation position and its duration.
[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.
#define DECOMP_SIZE_ASSERT(T, S)
const char * g_strCOMP
[AI] Used to identify comparison operations, likely for variable or trigger checks in scripts.
MxLong g_unk0x100f3308
[AI] Timer for wall hit sound playback throttling in navigation [AI]
undefined4 g_hitSnapSoundsIndex
MxLong g_timeLastJetskiSoundPlayed
const SkeletonKickPhase g_skeletonKickPhases[]
const char * g_strJetSpeed
const char * g_rhodaHitPlayerSounds[]
MxU32 g_playerHitRhodaSoundsIndex
const char * g_youCantStopSound
MxBool g_playedYouCantStopSound
const char * g_hitSnapSounds[]
MxU32 g_playerHitStudsSoundsIndex
const char * g_studsHitPlayerSounds[]
MxU32 g_rhodaHitPlayerSoundsIndex
const char * g_hitValerieSounds[]
undefined4 g_hitValerieSoundsIndex
MxU32 g_studsHitPlayerSoundsIndex
const char * g_playerHitStudsSounds[]
const char * g_playerHitRhodaSounds[]
MxLong g_timeLastRaceCarSoundPlayed
Mx3DPointFloat g_unk0x10102af0
MxS32 g_timePlayerLastMoved
const char * g_soundSkel3
#define LEGORACECAR_KICK2
[AI] User state identifier for LegoRaceCar in "kick2" action/animation state.
#define LEGORACECAR_KICK1
[AI] User state identifier for LegoRaceCar in "kick1" action/animation state.
#define LEGORACECAR_UNKNOWN_0
[AI] User state identifier for LegoRaceCar (unknown purpose—likely "neutral/idle").
#define LEGORACECAR_UNKNOWN_1
[AI] User state identifier for LegoRaceCar (unknown purpose—likely "in kick/transition state").
#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.
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
LegoNavController * NavController()
[AI] Accessor for the navigation controller, managing player/camera navigation. [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.
MxVariableTable * VariableTable()
[AI] Returns the variable table used for script variables and global key/value state.
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
[AI] Associates a named edge (string) to a LegoPathBoundary, used within skeleton kick phases to assi...
LegoPathBoundary * m_b
[AI] Boundary pointer; set to NULL until mapped by ParseAction or similar initialization.
[AI] Holds per-animation instance data for a LegoAnimActor.
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.
[AI] Represents an advanced edge in the LEGO Island geometry system, with direction,...
[AI] Represents a phase of the skeleton kick animation/action, delimiting animation intervals along a...
MxU8 m_userState
[AI] State to switch to if currently within this phase. LEGORACECAR_KICK1 or LEGORACECAR_KICK2.
float m_lower
[AI] Lower normalized bound of animation phase where this skeleton kick is applicable....
EdgeReference * m_edgeRef
[AI] Pointer to the EdgeReference describing which boundary this phase is associated with.