Merge branch 'Physics' of https://github.com/dean11/Danbias into Physics

This commit is contained in:
Robin Engman 2013-12-04 09:52:03 +01:00
commit f2548c43ce
5 changed files with 18 additions and 0 deletions

View File

@ -178,3 +178,8 @@ void SimpleRigidBody::SetSize( const Float3 &size )
{ {
this->rigid.SetSize( size ); this->rigid.SetSize( size );
} }
void SimpleRigidBody::SetMomentum( const Float3 &worldG )
{
this->rigid.SetLinearMomentum( worldG );
}

View File

@ -41,6 +41,7 @@ namespace Oyster { namespace Physics
void SetRotation( const ::Oyster::Math::Float4x4 &rotation ); void SetRotation( const ::Oyster::Math::Float4x4 &rotation );
void SetOrientation( const ::Oyster::Math::Float4x4 &orientation ); void SetOrientation( const ::Oyster::Math::Float4x4 &orientation );
void SetSize( const ::Oyster::Math::Float3 &size ); void SetSize( const ::Oyster::Math::Float3 &size );
void SetMomentum( const ::Oyster::Math::Float3 &worldG );
private: private:
::Oyster::Physics3D::RigidBody rigid; ::Oyster::Physics3D::RigidBody rigid;

View File

@ -184,3 +184,8 @@ void SphericalRigidBody::SetSize( const Float3 &size )
this->rigid.SetSize( size ); this->rigid.SetSize( size );
this->body.radius = 0.5f * Min( Min( size.x, size.y ), size.z ); // inline Min( FloatN )? this->body.radius = 0.5f * Min( Min( size.x, size.y ), size.z ); // inline Min( FloatN )?
} }
void SphericalRigidBody::SetMomentum( const Float3 &worldG )
{
this->rigid.SetLinearMomentum( worldG );
}

View File

@ -42,6 +42,7 @@ namespace Oyster { namespace Physics
void SetRotation( const ::Oyster::Math::Float4x4 &rotation ); void SetRotation( const ::Oyster::Math::Float4x4 &rotation );
void SetOrientation( const ::Oyster::Math::Float4x4 &orientation ); void SetOrientation( const ::Oyster::Math::Float4x4 &orientation );
void SetSize( const ::Oyster::Math::Float3 &size ); void SetSize( const ::Oyster::Math::Float3 &size );
void SetMomentum( const ::Oyster::Math::Float3 &worldG );
private: private:
::Oyster::Physics3D::RigidBody rigid; ::Oyster::Physics3D::RigidBody rigid;

View File

@ -390,6 +390,12 @@ namespace Oyster
* Use API::SetSize(...) * Use API::SetSize(...)
********************************************************/ ********************************************************/
virtual void SetSize( const ::Oyster::Math::Float3 &size ) = 0; virtual void SetSize( const ::Oyster::Math::Float3 &size ) = 0;
/********************************************************
* To not be called if is in Engine
* Use API::?? @todo TODO:
********************************************************/
virtual void SetMomentum( const ::Oyster::Math::Float3 &worldG ) = 0;
}; };
struct API::SimpleBodyDescription struct API::SimpleBodyDescription