Add CScriptActorRotate

Former-commit-id: 521b2d5413
This commit is contained in:
Henrique Gemignani Passos Lima
2022-12-23 22:50:36 -03:00
parent 06c5486887
commit 8e843d0174
6 changed files with 250 additions and 15 deletions

View File

@@ -0,0 +1,40 @@
#ifndef _CSCRIPTACTORROTATE
#define _CSCRIPTACTORROTATE
#include "MetroidPrime/CEntity.hpp"
#include "rstl/map.hpp"
struct SRiders;
class CScriptPlatform;
class CScriptActorRotate : public CEntity {
public:
CScriptActorRotate(TUniqueId, const rstl::string&, const CEntityInfo&, const CVector3f&, float,
bool, bool, bool);
~CScriptActorRotate();
void Accept(IVisitor& visitor) override;
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
void Think(float, CStateManager&) override;
private:
CVector3f x34_rotation;
float x40_maxTime;
float x44_currentTime; // = 0.f;
// rstl::map< TUniqueId, CTransform4f > x48_actors;
rstl::vector< rstl::pair<TUniqueId, CTransform4f> > x48_actors;
bool x58_24_updateRotation : 1; // = false;
bool x58_25_updateSpiderBallWaypoints : 1; // = false;
bool x58_26_updateActors : 1;
bool x58_27_updateOnCreation : 1;
void UpdateActors(bool, CStateManager&);
void RebuildSpiderBallWaypoints(CStateManager&);
void UpdatePlatformRiders(CScriptPlatform&, const CTransform4f&, CStateManager&);
void UpdatePlatformRiders(rstl::vector< SRiders >&, CScriptPlatform&, const CTransform4f&,
CStateManager&);
};
#endif // _CSCRIPTACTORROTATE

View File

@@ -75,6 +75,9 @@ public:
bool IsSlave(TUniqueId id) const;
void BuildSlaveList(CStateManager& mgr);
rstl::vector< SRiders >& GetStaticSlaves() { return x328_slavesStatic; }
rstl::vector< SRiders >& GetDynamicSlaves() { return x338_slavesDynamic; }
void SetControlledAnimation(bool controlled) { x356_25_controlledAnimation = controlled; }
static void AddRider(rstl::vector< SRiders >& riders, TUniqueId riderId,

View File

@@ -0,0 +1,19 @@
#ifndef _CSCRIPTSPIDERBALLWAYPOINT
#define _CSCRIPTSPIDERBALLWAYPOINT
#include "MetroidPrime/CActor.hpp"
class CScriptSpiderBallWaypoint : public CActor {
public:
void ClearWaypoints();
void BuildWaypointListAndBounds(CStateManager& mgr);
private:
enum ECheckActiveWaypoint { kCAW_Check, kCAW_SkipCheck };
uint xe8_;
rstl::vector< TUniqueId > xec_waypoints;
rstl::optional_object< CAABox > xfc_aabox;
};
#endif // _CSCRIPTSPIDERBALLWAYPOINT