mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09:47:43 +00:00
More CPhysicsActor imps
This commit is contained in:
@@ -22,19 +22,48 @@ struct SMoverData
|
||||
|
||||
struct CMotionState
|
||||
{
|
||||
zeus::CVector3f x0_origin;
|
||||
zeus::CQuaternion xc_rotation;
|
||||
zeus::CVector3f x1c_;
|
||||
zeus::CAxisAngle x28_;
|
||||
CMotionState(const zeus::CVector3f& origin, const zeus::CNUQuaternion& rotation,
|
||||
const zeus::CVector3f& v2, const zeus::CAxisAngle& angle)
|
||||
: x0_origin(origin)
|
||||
, xc_rotation(rotation)
|
||||
, x1c_(v2)
|
||||
, x28_(angle)
|
||||
zeus::CVector3f x0_translation;
|
||||
zeus::CNUQuaternion xc_orientation;
|
||||
zeus::CVector3f x1c_velocity;
|
||||
zeus::CAxisAngle x28_angularVelocity;
|
||||
CMotionState(const zeus::CVector3f& origin, const zeus::CNUQuaternion& orientation,
|
||||
const zeus::CVector3f& velocity, const zeus::CAxisAngle& angle)
|
||||
: x0_translation(origin)
|
||||
, xc_orientation(orientation)
|
||||
, x1c_velocity(velocity)
|
||||
, x28_angularVelocity(angle)
|
||||
{}
|
||||
};
|
||||
|
||||
class CPhysicsState
|
||||
{
|
||||
zeus::CVector3f x0_translation;
|
||||
zeus::CQuaternion xc_orientation;
|
||||
zeus::CVector3f x1c_constantForce;
|
||||
zeus::CAxisAngle x28_angularMomentum;
|
||||
zeus::CVector3f x34_momentum;
|
||||
zeus::CVector3f x40_force;
|
||||
zeus::CVector3f x4c_impulse;
|
||||
zeus::CAxisAngle x58_torque;
|
||||
zeus::CAxisAngle x64_angularImpulse;
|
||||
public:
|
||||
CPhysicsState(const zeus::CVector3f&, const zeus::CQuaternion&, const zeus::CVector3f&,
|
||||
const zeus::CAxisAngle&, const zeus::CVector3f&, const zeus::CVector3f&,
|
||||
const zeus::CVector3f&, const zeus::CAxisAngle&, const zeus::CAxisAngle&);
|
||||
|
||||
void SetOrientation(const zeus::CQuaternion&);
|
||||
const zeus::CQuaternion& GetOrientation() const;
|
||||
void SetTranslation(const zeus::CVector3f&);
|
||||
const zeus::CVector3f& GetTranslation() const;
|
||||
const zeus::CVector3f& GetConstantForceWR() const;
|
||||
const zeus::CAxisAngle& GetAngularMomentumWR() const;
|
||||
const zeus::CVector3f& GetMomentumWR() const;
|
||||
const zeus::CVector3f& GetForceWR() const;
|
||||
const zeus::CVector3f& GetImpulseWR() const;
|
||||
const zeus::CAxisAngle& GetTorque() const;
|
||||
const zeus::CAxisAngle& GetAngularImpulseWR() const;
|
||||
};
|
||||
|
||||
class CPhysicsActor : public CActor
|
||||
{
|
||||
protected:
|
||||
@@ -42,27 +71,35 @@ protected:
|
||||
float xec_massRecip;
|
||||
float xf0_inertiaTensor;
|
||||
float xf4_inertiaTensorRecip;
|
||||
bool xf8_;
|
||||
bool xf9_;
|
||||
zeus::CVector3f xfc_;
|
||||
zeus::CAxisAngle x108_;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool xf8_24_ : 1;
|
||||
bool xf8_25_ : 1;
|
||||
};
|
||||
u8 _dummy = 0;
|
||||
};
|
||||
bool xf9_ = false;
|
||||
zeus::CVector3f xfc_constantForce;
|
||||
zeus::CAxisAngle x108_angularMomentum;
|
||||
zeus::CMatrix3f x114_;
|
||||
zeus::CVector3f x138_velocity;
|
||||
zeus::CAxisAngle x144_angularVelocity;
|
||||
zeus::CVector3f x150_;
|
||||
zeus::CVector3f x15c_;
|
||||
zeus::CVector3f x168_;
|
||||
zeus::CAxisAngle x174_;
|
||||
zeus::CAxisAngle x180_;
|
||||
zeus::CVector3f x150_momentum;
|
||||
zeus::CVector3f x15c_force;
|
||||
zeus::CVector3f x168_impulse;
|
||||
zeus::CAxisAngle x174_torque;
|
||||
zeus::CAxisAngle x180_angularImpulse;
|
||||
zeus::CVector3f x18c_;
|
||||
zeus::CAxisAngle x198_;
|
||||
zeus::CAABox x1a4_baseBoundingBox;
|
||||
CCollidableAABox x1c0_collisionPrimitive;
|
||||
zeus::CVector3f x1e8_primitiveOffset;
|
||||
zeus::CQuaternion x200_;
|
||||
zeus::CVector3f x210_;
|
||||
zeus::CVector3f x21c_;
|
||||
bool x234_;
|
||||
zeus::CNUQuaternion x200_;
|
||||
zeus::CAxisAngle x210_;
|
||||
zeus::CAxisAngle x21c_;
|
||||
bool x234_ = false;
|
||||
float x238_ = 1000000.0f;
|
||||
float x23c_stepUpHeight;
|
||||
float x240_stepDownHeight;
|
||||
@@ -76,9 +113,9 @@ public:
|
||||
const zeus::CAABox&, const SMoverData&, const CActorParameters&,
|
||||
float, float);
|
||||
|
||||
void Render(const CStateManager& mgr);
|
||||
zeus::CVector3f GetOrbitPosition(const CStateManager&);
|
||||
zeus::CVector3f GetAimPosition(const CStateManager&, float val);
|
||||
void Render(const CStateManager& mgr) const;
|
||||
zeus::CVector3f GetOrbitPosition(const CStateManager&) const;
|
||||
zeus::CVector3f GetAimPosition(const CStateManager&, float val) const;
|
||||
virtual const CCollisionPrimitive& GetCollisionPrimitive() const;
|
||||
virtual zeus::CTransform GetPrimitiveTransform() const;
|
||||
virtual void CollidedWith(const TUniqueId&, const CCollisionInfoList&, CStateManager&);
|
||||
@@ -92,10 +129,11 @@ public:
|
||||
void SetBoundingBox(const zeus::CAABox& box);
|
||||
zeus::CAABox GetMotionVolume(float f31) const;
|
||||
zeus::CVector3f CalculateNewVelocityWR_UsingImpulses() const;
|
||||
zeus::CAABox GetBoundingBox();
|
||||
zeus::CAABox GetBoundingBox() const;
|
||||
const zeus::CAABox& GetBaseBoundingBox() const;
|
||||
void AddMotionState(const CMotionState& mst);
|
||||
CMotionState GetMotionState() const;
|
||||
void SetMotionState(const CMotionState& mst);
|
||||
void SetInertiaTensorScalar(float tensor);
|
||||
void SetMass(float mass);
|
||||
void SetAngularVelocityOR(const zeus::CAxisAngle& angVel);
|
||||
@@ -105,12 +143,32 @@ public:
|
||||
void SetVelocityOR(const zeus::CVector3f& vel);
|
||||
zeus::CVector3f GetTotalForcesWR() const;
|
||||
void RotateInOneFrameOR(const zeus::CQuaternion& q, float d);
|
||||
zeus::CVector3f GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const;
|
||||
void MoveInOneFrameOR(const zeus::CVector3f& trans, float d);
|
||||
void RotateToOR(const zeus::CQuaternion& q, float d);
|
||||
void MoveToOR(const zeus::CVector3f& trans, float d);
|
||||
void sub_8011B098(const zeus::CVector3f &v1, float d);
|
||||
void MoveToWR(const zeus::CVector3f& trans, float d);
|
||||
zeus::CAxisAngle GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const;
|
||||
zeus::CVector3f GetMoveToORImpulseWR(const zeus::CVector3f& trans, float d) const;
|
||||
void ClearImpulses();
|
||||
void ClearForcesAndTorques();
|
||||
void Stop();
|
||||
void ComputeDerivedQuantities();
|
||||
bool WillMove(const CStateManager&);
|
||||
void SetPhysicsState(const CPhysicsState& state);
|
||||
CPhysicsState GetPhysicsState() const;
|
||||
|
||||
CMotionState PredictMotion_Internal(float) const;
|
||||
CMotionState PredictMotion(float dt) const;
|
||||
CMotionState PredictLinearMotion(float dt) const;
|
||||
CMotionState PredictAngularMotion(float dt) const;
|
||||
void ApplyForceOR(const zeus::CVector3f& force, const zeus::CAxisAngle& angle);
|
||||
void ApplyForceWR(const zeus::CVector3f& force, const zeus::CAxisAngle& angle);
|
||||
void ApplyImpulseOR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle);
|
||||
void ApplyImpulseWR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle);
|
||||
void ApplyTorqueWR(const zeus::CVector3f& torque);
|
||||
|
||||
void UseCollisionImpulses();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user