metaforce/Runtime/World/CPhysicsActor.hpp

93 lines
2.7 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CPHYSICSACTOR_HPP__
#define __URDE_CPHYSICSACTOR_HPP__
2015-08-22 01:58:41 +00:00
#include "CActor.hpp"
#include "Collision/CCollidableAABox.hpp"
2015-08-22 01:58:41 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-22 01:58:41 +00:00
{
2016-04-22 20:22:45 +00:00
class CCollisionInfoList;
2016-04-19 00:17:49 +00:00
struct SMoverData;
2015-08-22 01:58:41 +00:00
2016-04-19 00:17:49 +00:00
struct SMoverData
{
zeus::CVector3f x0_velocity;
zeus::CAxisAngle xc_angularVelocity;
2016-04-19 00:17:49 +00:00
zeus::CVector3f x18_;
zeus::CAxisAngle x24_;
float x30_mass;
2016-04-19 00:17:49 +00:00
SMoverData(float mass) : x30_mass(mass) {}
};
struct CMotionState
{
CMotionState(const zeus::CVector3f&, const zeus::CNUQuaternion&, const zeus::CVector3f&, const zeus::CAxisAngle&);
2016-04-19 00:17:49 +00:00
};
2015-08-22 01:58:41 +00:00
class CPhysicsActor : public CActor
{
protected:
2016-04-22 20:22:45 +00:00
float xe8_mass;
float xec_massRecip;
float xf0_inertialTensor;
float xf4_inertialTensorRecip;
bool xf8_;
bool xf9_;
zeus::CVector3f xfc_;
zeus::CAxisAngle x108_;
zeus::CMatrix3f x114_;
zeus::CVector3f x138_;
zeus::CAxisAngle x144_;
zeus::CVector3f x150_;
zeus::CVector3f x15c_;
zeus::CVector3f x168_;
zeus::CAxisAngle x174_;
zeus::CAxisAngle x180_;
zeus::CVector3f x18c_;
zeus::CAxisAngle x198_;
2016-04-22 20:22:45 +00:00
zeus::CAABox x1a4_baseBoundingBox;
CCollidableAABox x1c0_collisionPrimitive;
2016-04-22 20:22:45 +00:00
zeus::CVector3f x1e8_primitiveOffset;
zeus::CQuaternion x200_;
zeus::CVector3f x210_;
zeus::CVector3f x21c_;
bool x234_;
float x238_ = 1000000.0f;
2016-04-22 20:22:45 +00:00
float x23c_stepUpHeight;
float x240_stepDownHeight;
float x244_restitutionCoefModifier;
float x248_collisionAccuracyModifier;
u32 x24c_;
u32 x250_;
public:
2016-04-19 00:17:49 +00:00
CPhysicsActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
2016-04-22 20:22:45 +00:00
const zeus::CTransform&, CModelData&&, const CMaterialList&,
2016-04-19 00:17:49 +00:00
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);
virtual const CCollisionPrimitive& GetCollisionPrimitive() const;
virtual zeus::CTransform GetPrimitiveTransform();
virtual void CollidedWith(const TUniqueId&, const CCollisionInfoList&, CStateManager&);
virtual float GetStepUpHeight();
virtual float GetStepDownHeight();
virtual float GetWeight();
void SetPrimitiveOffset(const zeus::CVector2f& offset);
zeus::CVector3f GetPrimitiveOffset();
void MoveCollisionPrimitive(const zeus::CVector3f& offset);
void SetBoundingBox(const zeus::CAABox& box);
zeus::CAABox GetMotionVolume();
2016-04-22 20:22:45 +00:00
zeus::CAABox GetBoundingBox();
const zeus::CAABox& GetBaseBoundingBox() const;
void SetInertiaTensorScalar(float tensor);
void SetMass(float mass);
2015-08-22 01:58:41 +00:00
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CPHYSICSACTOR_HPP__