Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2015-01-15 20:27:47 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2015-01-15 20:37:22 +0300
commited8dc78691063f37eb411d1b2e095183a0a94dd5 (patch)
treecbfb817125eb8c97fd1c0a8442af6f73e2b691ee /source/gameengine/Physics/common
parentb675418d0143ada5638b8074f86939224d1f23d2 (diff)
BGE physics: get/set linear and angular damping
This patch adds the following R/W properties and method to `KX_GameObject`: - `linearDamping` -- get/set linear damping - `angluarDamping` -- get/set angular damping - `setDamping(linear, angular)` -- set both simultaneously These allow runtime changes to the same properties that are accessible at design time in Blender's UI via `game.damping` and `game.rotation_damping`. The names of the properties were chosen to mirror the internal names of the BGE physics engine, as these are (AFAIK) also the commonly used names in physics literature. Reviewers: campbellbarton Projects: #game_physics Differential Revision: https://developer.blender.org/D936
Diffstat (limited to 'source/gameengine/Physics/common')
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsController.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h
index f9975484fa7..1717f8d90cb 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsController.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h
@@ -89,6 +89,12 @@ class PHY_IPhysicsController : public PHY_IController
virtual void SetLinearVelocity(const MT_Vector3& lin_vel,bool local)=0;
virtual void ResolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) = 0;
+ virtual float GetLinearDamping() const=0;
+ virtual float GetAngularDamping() const=0;
+ virtual void SetLinearDamping(float damping)=0;
+ virtual void SetAngularDamping(float damping)=0;
+ virtual void SetDamping(float linear, float angular)=0;
+
virtual void SuspendDynamics(bool ghost=false)=0;
virtual void RestoreDynamics()=0;