Added function for ICustomBody

void ICustomBody::SetMomentum( const ::Oyster::Math::Float3 &worldG )
- Added and implemented
This commit is contained in:
Dander7BD 2013-12-03 15:11:13 +01:00
parent 0a0e327d71
commit e4476f7757
5 changed files with 18 additions and 0 deletions

View File

@ -177,4 +177,9 @@ void SimpleRigidBody::SetOrientation( const Float4x4 &orientation )
void SimpleRigidBody::SetSize( const Float3 &size ) 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

@ -183,4 +183,9 @@ 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