Added support for applying impulse
This commit is contained in:
parent
5d245d7151
commit
7541994419
|
@ -67,6 +67,11 @@ void SimpleRigidBody::SetState( const SimpleRigidBody::State &state )
|
|||
this->state = state;
|
||||
}
|
||||
|
||||
void SimpleRigidBody::ApplyImpulse(Float3 impulse)
|
||||
{
|
||||
this->rigidBody->applyImpulse(btVector3(impulse.x, impulse.y, impulse.z), btVector3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetCollisionShape(btCollisionShape* shape)
|
||||
{
|
||||
this->collisionShape = shape;
|
||||
|
|
|
@ -18,6 +18,8 @@ namespace Oyster
|
|||
State& GetState( State &targetMem ) const;
|
||||
void SetState( const State &state );
|
||||
|
||||
void ApplyImpulse(Math::Float3 impulse);
|
||||
|
||||
void SetCollisionShape(btCollisionShape* shape);
|
||||
void SetMotionState(btDefaultMotionState* motionState);
|
||||
void SetRigidBody(btRigidBody* rigidBody);
|
||||
|
|
|
@ -134,6 +134,8 @@ namespace Oyster
|
|||
virtual void SetSubscription(EventAction_AfterCollisionResponse function) = 0;
|
||||
virtual void SetSubscription(EventAction_Move function) = 0;
|
||||
|
||||
virtual void ApplyImpulse(::Oyster::Math::Float3 impulse) = 0;
|
||||
|
||||
virtual void SetLinearVelocity(::Oyster::Math::Float3 velocity) = 0;
|
||||
virtual void SetPosition(::Oyster::Math::Float3 position) = 0;
|
||||
virtual void SetRotation(::Oyster::Math::Float4 quaternion) = 0;
|
||||
|
|
Loading…
Reference in New Issue