Skip to main content

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.

MapObj is the catch-all system for placed world objects in Super Mario Galaxy 1. Almost every non-enemy, non-player, non-area object in a level — from coins and power stars to lava geysers and observatory machinery — is a MapObjActor or a class that inherits from it. The MapObj/ directory contains over 310 header files, making it the largest subsystem in the codebase.

MapObjActor — the base class

MapObjActor inherits LiveActor and adds standardized support for rail movement, rotation, breakable models, switch reactions (SwitchA / SwitchB), LOD control, and a three-nerve state machine (WaitMoveDone).
class MapObjActor : public LiveActor {
public:
    MapObjActor(const char*);
    MapObjActor(const char*, const char*);  // alternate ctor with model name override

    virtual void init(const JMapInfoIter&);
    virtual void initAfterPlacement();
    virtual void appear();
    virtual void kill();
    virtual void control();
    virtual void calcAndSetBaseMtx();

    // Scene-connection and switch setup
    virtual void connectToScene(const MapObjActorInitInfo&);
    virtual void initCaseUseSwitchA(const MapObjActorInitInfo&);
    virtual void initCaseNoUseSwitchA(const MapObjActorInitInfo&);
    virtual void initCaseUseSwitchB(const MapObjActorInitInfo&);
    virtual void initCaseNoUseSwitchB(const MapObjActorInitInfo&);

    // Helpers
    bool isObjectName(const char*) const;
    bool tryCreateBreakModel(const MapObjActorInitInfo&);
    void startMapPartsFunctions();
    void endMapPartsFunctions();
    void pauseMapPartsFunctions();

    // State execute methods
    void exeWait();
    void exeMove();
    void exeDone();

    const char* mObjectName;                    // 0x8C
    LodCtrl* mPlanetLodCtrl;                    // 0x90
    ModelObj* mBloomModel;                      // 0x94
    ModelObj* mModelObj;                        // 0x98
    ProjmapEffectMtxSetter* mMatrixSetter;      // 0x9C
    MapPartsRailMover* mRailMover;              // 0xA0
    MapPartsRotator* mRotator;                  // 0xA4
    MapPartsRailRotator* mRailRotator;          // 0xA8
    MapPartsRailPosture* mRailPosture;          // 0xAC
    MapPartsRailGuideDrawer* mRailGuideDrawer;  // 0xB0
    Nerve* mWaitNrv;  // 0xB8
    Nerve* mMoveNrv;  // 0xBC
    Nerve* mDoneNrv;  // 0xC0
};

MapObjActorInitInfo — initialization descriptor

MapObjActorInitInfo is a plain data struct that sub-classes fill before calling MapObjActor::initialize(). It switches on/off subsystems like the binder, shadow, sensors, rail mover, and rotator without requiring virtual overrides for every combination.
class MapObjActorInitInfo {
public:
    MapObjActorInitInfo();

    void setupHioNode(const char*);
    void setupModelName(const char*);
    void setupConnectToScene();
    void setupBinder(f32, f32);
    void setupEffect(const char*);
    void setupHitSensor();
    void setupShadow(const char*);
    void setupRailMover();
    void setupRotator();
    void setupRailRotator();
    void setupRailPosture();
    void setupNerve(const Nerve*);
    void setupGroupClipping(s32);
    void setupClippingRadius(f32);

    bool mSetDefaultPosition;  // 0x0
    bool mConnectToScene;      // 0x1
    bool mInitBinder;          // 0x2
    bool mHasEffect;           // 0x3
    bool mHasSensors;          // 0x4
    bool mHasShadows;          // 0x5
    bool mCalcGravity;         // 0x6
    bool mProjectMapMtx;       // 0x7
    bool mHasRailMover;        // 0x9
    bool mHasRotator;          // 0xA
    bool mHasRailRotator;      // 0xB
    bool mUsesRailPosture;     // 0xE
    bool mNoUseLOD;            // 0x8D

    const char* mModelName;    // 0x14
    f32 mSensorSize;           // 0x20
    TVec3f mSensorOffset;      // 0x24
    f32 mBinderRadius;         // 0x34
    f32 mBinderCenterY;        // 0x38
    const char* mEffectName;   // 0x3C
    const Nerve* mNerve;       // 0x4C
    f32 mClippingRadius;       // 0x54
    const char* mShadowName;   // 0x78
    f32 mShadowLength;         // 0x7C
};

Object categories

Items the player picks up to gain points, health, or progress.
ClassObjectNotes
CoinCoinFull state machine: fix, move, hop, spin-drain; tracks mIsPurpleCoin
BlueChipBlue chipCounted variant of coin
YellowChipYellow chipCounted variant
StarPieceStar bitPhysics projectile attracted by star pointer
PowerStarPower starComplex appear demo and mIsGrandStar flag
NoteMusic notePath-following collectible
MorphItemObjNeoTransformation itemActivates bee/ice/fire modes
BenefitItemInvincibleInvincibility starTimed power-up
BenefitItemLifeUp1-Up mushroomExtra life collectible
CoinBoxCoin boxSpawns coins when struck
ItemBlock? BlockSpawns item on first hit
Pressure plates and interactive switches that trigger other objects via the switch system.
ClassObjectNotes
CrystalSwitchCrystal switchSpin-attack activated; rotates on impact
HipDropSwitchGround-pound switchRequires hip-drop to activate
HipDropTimerSwitchTimed ground-pound switchAuto-deactivates
KeySwitchKey switchRequires a key item
ScrewSwitchScrew switchRotated by spin attack
ScrewSwitchReverseReverse screw switchOpposite rotation direction
PicketSwitchPicket switchStep-on activated
SpinLeverSwitchSpin leverPull by spinning
ValveSwitchValveTurn to open
ArrowSwitchArrow switchDirectional tile switch
PTimerSwitchP-switchClassic Mario timed switch
HitWallTimerSwitchWall-hit timer switchActivates on collision
SwitchBoxSwitch boxDestroyable to activate
DesertLandMoveSwitchSand land switchMoves terrain segment
SnowplowSwitchSnowplow switchPushes snow
Surfaces the player can stand on, with optional movement along a rail.
ClassObjectNotes
IceStepIce platformSlippery surface; also used as a footing on Mario’s ice floor
AssemblyBlockAssembly blockSnaps together via switch
FallDownBridgeCollapsing bridgeFalls after delay when stood on
RailMoveObjGeneric rail moverMapObjActor subclass for rail-following platforms
RotateMoveObjRotating platformMapObjActor subclass for rotating objects
HipDropMoveObjHip-drop platformDrops on ground-pound
RevolvingWayRevolving walkwayRotates continuously
CollapsePlaneCollapse planeCrumbles under sustained weight
RailBlockRail blockSlides along rail between stops
TimerMoveWallTimer-wallMoves on timed schedule
WatchTowerRotateStepTower staircaseRotates around vertical axis
BattleShipElevatorBattleship elevatorVertical lift
LargeChainChainAnimated decorative chain with physics
Environmental objects that damage or kill the player on contact.
class BlackHole : public LiveActor {
public:
    virtual void init(const JMapInfoIter&);
    virtual void attackSensor(HitSensor*, HitSensor*);

    bool isInCubeBox(const TVec3f&) const;
    void exeWait();
    void exeDemo();
    void exeDisappear();

    ModelObj* mBlackHoleModel;     // 0x8C
    ActorCameraInfo* mCameraInfo;  // 0x108
};
ClassObjectNotes
BlackHoleBlack holePulls Mario in; isInCubeBox for cubic variant
FireBarFire barRotating fire chain (FireBubble chain)
LavaGeyserLava geyserPeriodic lava burst
SpaceMineSpiked mineFloats on path; contact hazard
JirairaSpiked ground mineProximity-triggered explosion (also in Enemy)
ElectricBallElectric ballRolling electric sphere
ElectricRailElectric railRail with periodic pulse
LavaBreakColumnLava columnBreaks after timed interval
LavaProminenceLava prominenceEruption of lava arc
LavaFloaterLava floaterRocks floating on lava
NeedlePlantNeedle plantSpike-hazard foliage
SandstormBaseSandstormWind-push hazard
DossunThwomp (also Enemy)Ceiling-drop hazard
Objects related to water physics, fountains, and the ocean system.
ClassObjectNotes
FountainFountainVertical water spout
FountainBigLarge fountainLarger variant with extra splash
OceanWaveFloaterOcean wave floaterFollows wave height
LotusLeafLily padFloats on water surface
WaterLeakPipeLeaky pipeSprays directional water stream
WaterPressureWater pressure cannonShoots WaterPressureBullet
SpringJetWaterSpring jetUnderwater upward jet
SpringWaterFloaterSpotWater hover spotLifts Mario if in beam
WhirlPoolWhirlpoolSpinning current area
AirBubbleAir bubbleReplenishes water breath meter
AirBubbleGeneratorBubble generatorPeriodically emits AirBubble
BigBubble / BigBubbleHolderGiant bubbleTransport bubble for Mario
ShellfishClamOpens and closes; can contain item
Objects specific to the hub world, Comet Observatory / Astro Observatory.
ClassObjectNotes
AstroDomeDome buildingEach dome leads to a galaxy
AstroCoreObservatory coreCentral power star socket
AstroMapBoardMap boardDisplays galaxy select map
AstroMapObjGeneric observatory objectBase for observatory decoration
AstroOverlookObjOverlook objectScenic decoration near observatory
AstroDomeAsteroidDome asteroidFlying rock near domes
AstroDomeBlueStarBlue starDecorative orbiting star
AstroDomeCometCometFast-moving comet decoration
AstroDomeOrbitOrbit ringAnimated orbit trajectory
AstroCountDownPlateCountdown plateDisplays comet arrival timer
MiniatureGalaxyMiniature galaxySmall galaxy model in hub
Objects that launch Mario to a new area.
ClassObjectNotes
SpinDriverLaunch starStandard spin-powered launch star
SuperSpinDriverSuper launch starFaster variant
SpinDriverCameraCamera controllerHandles the launch camera cut
SpinDriverShootPathShoot pathDefines the launch trajectory
MarioLauncherCannonBarrel cannon that fires Mario
WarpPodWarp podWarp point between galaxy sections
DashRingDash ringBoosts Mario’s speed through ring
PrizeRingPrize ringSpin through to collect star bits
JumpStandJump panelBounces Mario upward
JumpHoleJump holeDrops Mario to a lower area

Coin — full state machine example

Coin illustrates the level of detail typical in MapObj classes: it has nine distinct nerve states, can appear in multiple ways, and tracks water submersion and purple coin variants.
class Coin : public LiveActor {
public:
    virtual void init(const JMapInfoIter&);
    virtual void appear();
    virtual void calcAndSetBaseMtx();
    virtual bool receiveOtherMsg(u32, HitSensor*, HitSensor*);

    // Appear variants
    void appearFix();
    void appearFixTimer(s32, s32);
    void appearMove(const TVec3f&, const TVec3f&, s32, s32);
    void appearHop(const TVec3f&, const TVec3f&);

    // Nerve execute methods
    void exeNonActive();
    void exeFix();
    void exeFixHide();
    void exeFixTimer();
    void exeMove();
    void exeControled();
    void exeSpinDrained();
    void exeHop();

    CoinHostInfo* mHostInfo;   // 0x8C
    FlashingCtrl* mFlashCtrl;  // 0x90
    PartsModel* mAirBubble;    // 0x94
    TVec3f mDropPosition;      // 0x98
    s32 mCannotTime;           // 0xB4
    bool mIsInWater;           // 0xB8
    bool mIsPurpleCoin;        // 0xBC
    bool mIsNeedBubble;        // 0xBD
};
MapObjActorUtil provides static helpers for starting, stopping, and pausing the rotator and rail mover on any MapObjActor. Use MapObjActorUtil::isRailMoverReachedEnd to check if a moving platform has completed its path, and MapObjActorUtil::startBreak to trigger a breakable object’s destruction sequence.

Build docs developers (and LLMs) love