Danbias/Code/GamePhysics/PhysicsStructs.h

47 lines
1.4 KiB
C
Raw Normal View History

#ifndef PHYSICS_STRUCTS_H
#define PHYSICS_STRUCTS_H
#include "OysterMath.h"
#include "PhysicsAPI.h"
#include "Inertia.h"
2014-02-09 21:24:09 +01:00
namespace Oyster
{
namespace Physics
{
2014-02-09 21:24:09 +01:00
namespace Struct
{
2014-02-09 21:24:09 +01:00
struct CustomBodyState
{
2014-02-09 21:24:09 +01:00
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;
2014-02-10 12:42:31 +01:00
void CustomBodyState::ApplyFriction( const ::Oyster::Math::Float3 &j);
2014-02-09 21:24:09 +01:00
// Variables for state
::Oyster::Math::Float mass, restitutionCoeff, staticFrictionCoeff, dynamicFrictionCoeff;
::Oyster::Math::Float3 reach, centerPos;
::Oyster::Math::Quaternion quaternion;
};
}
}
}
#include "PhysicsStructs-Impl.h"
#endif