diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 23:37:43 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 23:37:43 +0400 |
commit | 15c105c157057d249192b02f438cc60af600f9e6 (patch) | |
tree | 9ed6c9a6dd6a43d0d7986e58e0f527d138699b65 /source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | |
parent | 533539901b1a50962a5870ee30d7c0d1ba123585 (diff) |
BGE patch: Add damping and clamping option to motion actuator.
This patch introduces two options for the motion actuator:
damping: number of frames to reach the target velocity. It takes
into account the startup velocityin the target velocity direction
and add 1/damping fraction of target velocity until the full
velocity is reached. Works only with linear and angular velocity.
It will be extended to delta and force motion method in a future
release.
clamping: apply the force and torque as long as the target velocity
is not reached. If this option is set, the velocity specified
in linV or angV are not applied to the object but used as target
velocity. You should also specify a force in force or torque field:
the force will be applied as long as the velocity along the axis of
the vector set in linV or angV is not reached. Works best in low
friction environment.
Diffstat (limited to 'source/gameengine/Ketsji/KX_BulletPhysicsController.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index aa7c75e9633..70443ced7a9 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -102,6 +102,13 @@ MT_Vector3 KX_BulletPhysicsController::GetLinearVelocity() CcdPhysicsController::GetLinearVelocity(angVel[0],angVel[1],angVel[2]);//rcruiz return MT_Vector3(angVel[0],angVel[1],angVel[2]); } +MT_Vector3 KX_BulletPhysicsController::GetAngularVelocity() +{ + float angVel[3]; + //CcdPhysicsController::GetAngularVelocity(angVel[0],angVel[1],angVel[2]); + CcdPhysicsController::GetAngularVelocity(angVel[0],angVel[1],angVel[2]);//rcruiz + return MT_Vector3(angVel[0],angVel[1],angVel[2]); +} MT_Vector3 KX_BulletPhysicsController::GetVelocity(const MT_Point3& pos) { float linVel[3]; |