metaforce/Runtime/CPhysicsActor.hpp

124 lines
2.9 KiB
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CPHYSICSACTOR_HPP__
#define __PSHAG_CPHYSICSACTOR_HPP__
2015-08-22 01:58:41 +00:00
#include "CActor.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-22 01:58:41 +00:00
{
class CCollisionPrimitive
{
public:
2016-03-04 23:04:53 +00:00
zeus::CVector3f x1d8_offset;
};
class CCollisionInfoList
{
};
2015-08-22 01:58:41 +00:00
class CPhysicsActor : public CActor
{
protected:
float xd8_mass;
float xdc_massRecip;
float xe0_inertialTensor;
float xe4_inertialTensorRecip;
2016-03-04 23:04:53 +00:00
zeus::CAABox x194_baseBoundingBox;
CCollisionPrimitive x1b0_collisionPrimitive;
float x228_stepUpHeight;
float x22c_stepDownHeight;
float x230_restitutionCoefModifier;
float x234_collisionAccuracyModifier;
public:
float GetCollisionAccuracyModifier()
{ return x234_collisionAccuracyModifier; }
void SetCollisionAccuracyModifier(float modifier)
{ x234_collisionAccuracyModifier = modifier; }
float GetCoefficientOfRestitutionModifier()
{ return x230_restitutionCoefModifier; }
void SetCoefficientOfRestitutionModifier(float modifier)
{ x230_restitutionCoefModifier = modifier;}
void DrawCollisionPrimitive()
{ }
void Render(const CStateManager&)
{}
2016-03-04 23:04:53 +00:00
zeus::CVector3f GetAimPosition(const CStateManager&, float val)
{
if (val <= 0.0)
return GetBoundingBox().center();
2016-03-04 23:04:53 +00:00
//zeus::CVector3f delta = PredictMotion(val);
return zeus::CVector3f();
}
2016-03-04 23:04:53 +00:00
zeus::CVector3f GetOrbitPosition(const CStateManager&)
{ return GetBoundingBox().center(); }
float GetStepUpHeight()
{ return x228_stepUpHeight; }
float GetStepDownHeight()
{ return x22c_stepDownHeight; }
2016-03-04 23:04:53 +00:00
void SetPrimitiveOffset(const zeus::CVector2f& offset)
{ x1b0_collisionPrimitive.x1d8_offset = offset; }
2016-03-04 23:04:53 +00:00
zeus::CVector3f GetPrimitiveOffset()
{ return x1b0_collisionPrimitive.x1d8_offset; }
float GetWeight()
{ return 24.525002f * xd8_mass; }
2016-03-04 23:04:53 +00:00
void SetBoundingBox(const zeus::CAABox& box)
{ x194_baseBoundingBox = box; }
2016-03-04 23:04:53 +00:00
zeus::CAABox GetMotionVolume()
{ return zeus::CAABox::skInvertedBox; }
2016-03-04 23:04:53 +00:00
zeus::CAABox GetBoundingBox()
{ return zeus::CAABox::skInvertedBox; }
2016-03-04 23:04:53 +00:00
const zeus::CAABox& GetBaseBoundingBox() const
{ return x194_baseBoundingBox; }
void CollidedWith(const TUniqueId&, const CCollisionInfoList&, CStateManager&)
{}
2016-03-04 23:04:53 +00:00
zeus::CTransform GetPrimitiveTransform()
{
2016-03-04 23:04:53 +00:00
return zeus::CTransform();
}
const CCollisionPrimitive& GetCollisionPrimitive() const
{ return x1b0_collisionPrimitive; }
2015-11-02 18:50:24 +00:00
void SetInertiaTensorScalar(float tensor)
{
if (tensor <= 0.0f)
tensor = 1.0f;
xe0_inertialTensor = tensor;
xe4_inertialTensorRecip = 1.0f / tensor;
}
void SetMass(float mass)
{
xd8_mass = mass;
float tensor = 1.0f;
if (mass > 0.0f)
tensor = 1.0f / mass;
xdc_massRecip = tensor;
2015-11-02 18:50:24 +00:00
SetInertiaTensorScalar(mass * tensor);
}
2015-08-22 01:58:41 +00:00
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CPHYSICSACTOR_HPP__