Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SMGCommunity/Petari/llms.txt
Use this file to discover all available pages before exploring further.
LiveActor is the foundation of almost every interactive entity in Super Mario Galaxy — enemies, power-ups, platforms, hazards, and more all derive from it. It extends NameObj with a full transform (position, rotation, scale, velocity, gravity), a set of optional subsystem pointers (model, animation, collision, audio, effects, rails), and the Nerve/Spine state machine that drives per-frame behaviour.
Class definition
The order of virtual functions in the declaration above matches the vtable
layout in the original binary. Subclasses that override them must preserve
this order to achieve a matching build.
Lifecycle
EveryLiveActor follows a fixed lifecycle managed by the scene executor.
AllLiveActorGroup and the ClippingDirector automatically:
makeActorAppeared() validates hit sensors and collision, clears the dead flag, and connects the actor to the scene’s draw and movement lists. makeActorDead() zeroes velocity, clears hit sensors, and disconnects the actor.
The Nerve/Spine state machine
LiveActor uses a two-class system to represent stateful behaviour.
Nerve — a single state
Nerve — a single state
A Several convenience macros create concrete Each concrete
Nerve represents one state. Its execute method is called every frame
while the actor is in that state. executeOnEnd is called on the last frame
before a state transition.Nerve subclasses and wire them
to actor member functions:Nerve class has a static singleton instance accessed via
ClassName::sInstance.Spine — the state machine manager
Spine — the state machine manager
A
Spine owns the current and next Nerve pointers and the frame counter
(mStep). Calling update() each frame either increments mStep or, if
setNerve was called, transitions to the new state.LiveActor exposes the spine through mSpine and provides helpers:ActorStateBase — reusable state objects
ActorStateBase — reusable state objects
For complex states that need their own member variables, the game uses
ActorStateBase<T>, a templated base that holds a back-pointer to the
owning actor:ActorStateBaseInterface itself provides appear(), kill(), and a
virtual update() that drives its own nerve loop.Key virtual functions
| Function | Purpose |
|---|---|
init(rIter) | One-time setup; read placement data from JMapInfo. |
appear() | Make the actor visible and active. Delegates to makeActorAppeared(). |
kill() | Deactivate the actor. Delegates to makeActorDead(). |
movement() | Per-frame logic: advance the spine, call control(). |
calcAnim() | Update skeletal and material animation. |
calcViewAndEntry() | Frustum-cull and queue for rendering. |
control() | Override point for per-frame game logic (called from movement()). |
receiveMessage() | Dispatch an incoming HitSensor message. |
getBaseMtx() | Return the model root matrix, or NULL if no model. |
calcAndSetBaseMtx() | Recompute and apply the base matrix from position/rotation/scale. |