Danbias/Code/GamePhysics/PhysicsStructs.h

52 lines
1.5 KiB
C++

#ifndef PHYSICS_STRUCTS_H
#define PHYSICS_STRUCTS_H
#include "OysterMath.h"
#include "PhysicsAPI.h"
#include "Inertia.h"
namespace Oyster
{
namespace Physics
{
namespace Struct
{
struct CustomBodyState
{
public:
// Default constructor
CustomBodyState( ::Oyster::Math::Float mass = 1.0f,
::Oyster::Math::Float restitutionCoeff = 1.0f,
::Oyster::Math::Float staticFrictionCoeff = 1.0f,
::Oyster::Math::Float dynamicFrictionCoeff = 1.0f,
const ::Oyster::Math::Float3 &centerPos = ::Oyster::Math::Float3::null,
const ::Oyster::Math::Quaternion &quaternion = ::Oyster::Math::Quaternion(::Oyster::Math::Float3(0, 0, 0), 1));
// Assignment operator
CustomBodyState & operator = ( const CustomBodyState &state );
// Get functions that calculate matrices that do not exist as variables
::Oyster::Math::Float4x4 GetRotation() const;
::Oyster::Math::Float4x4 GetOrientation() const;
::Oyster::Math::Float4x4 GetView() const;
::Oyster::Math::Float4x4 GetView( const ::Oyster::Math::Float3 &offset ) const;
::Oyster::Math::Float GetMass() const;
::Oyster::Math::Float GetStaticFriction() const;
::Oyster::Math::Float GetDynamicFriction() const;
::Oyster::Math::Float GetRestitution() const;
// Variables for state
::Oyster::Math::Float mass, restitutionCoeff, staticFrictionCoeff, dynamicFrictionCoeff;
::Oyster::Math::Float3 reach, centerPos;
::Oyster::Math::Quaternion quaternion;
};
}
}
}
#include "PhysicsStructs-Impl.h"
#endif