Files
bigmak94andClaude Opus 5.5 4b395efe5c Add the Petari decompilation (SMGCommunity/Petari@0a5c660)
The sources of Petari (https://github.com/SMGCommunity/Petari), the
Super Mario Galaxy decompilation by the SMGCommunity, at commit
0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line
endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and
src/.  Left out: the game data Petari keeps from the original
executable, the error message archive (include/Game/System/
ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and
StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's
own disc.  The port's changes follow in the next commit, so
`git diff petari-base -- decomp` shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 01:59:38 +02:00

91 lines
2.3 KiB
C++

#pragma once
#include "Game/LiveActor/Nerve.hpp"
#include "Game/MapObj/MapPartsFunction.hpp"
#include <JSystem/JGeometry/TMatrix.hpp>
class MapPartsRotatorBase : public MapPartsFunction {
public:
inline MapPartsRotatorBase(LiveActor* pActor, const char* pName) : MapPartsFunction(pActor, pName) {
}
virtual ~MapPartsRotatorBase();
virtual const TMtx34f& getRotateMtx() const = 0;
virtual bool isMoving() const {
return false;
}
virtual bool isOnReverse() const {
return false;
}
virtual f32 getRotateSpeed() const {
return 1.0f;
}
};
class MapPartsRotator : public MapPartsRotatorBase {
public:
MapPartsRotator(LiveActor*);
enum AxisType { AxisType_XAxis, AxisType_YAxis, AxisType_ZAxis };
virtual void init(const JMapInfoIter&);
virtual bool isWorking() const;
virtual void start();
virtual void end();
virtual const TMtx34f& getRotateMtx() const {
return mRotateMtx;
}
virtual bool isMoving() const;
virtual f32 getRotateSpeed() const {
return mRotateSpeed;
}
virtual bool isOnReverse() const {
return mIsOnReverse;
}
void startWithSignalMotion();
void cancelSignalMotion();
void updateBaseHostMtx();
void updateVelocity();
void updateAngle();
void updateTargetAngle();
void restartAtEnd();
void initRotateSpeed(const JMapInfoIter&);
bool isReachedTargetAngle() const;
void updateRotateMtx(AxisType, f32);
void calcRotateAxisDir(AxisType, TVec3f*) const;
void exeNeverMove();
void exeWait();
void exeRotateStart();
void exeRotate();
void exeStopAtEnd();
bool isAccelTypeConstantSpeed() {
return mRotateAccelType == 0 || mRotateAccelType == 2;
}
bool isRotateClockwise() const {
return 0.0f < _18;
}
/* 0x18 */ f32 _18;
/* 0x1C */ f32 mRotateAngle;
/* 0x20 */ s32 mRotateStopTime;
/* 0x24 */ f32 mTargetAngle;
/* 0x28 */ f32 mRotateSpeed;
/* 0x2C */ f32 mAngle;
/* 0x30 */ s32 mRotateAxis;
/* 0x34 */ s32 mRotateAccelType;
/* 0x38 */ s32 mRotateType;
/* 0x3C */ s32 mSignMotionType;
/* 0x40 */ TPos3f mBaseHostMtx;
/* 0x70 */ TPos3f mRotateMtx;
/* 0xA0 */ f32 _A0;
/* 0xA4 */ bool mIsOnReverse;
};