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-06-23 16:02:28 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2015-06-28 13:54:53 +0300
commit9f48aa45adb34e03f42d8960fa6d47c5e8b061ab (patch)
tree85573468ed4c7bc2d5e632df288582851ad1b8ce /source/gameengine/Physics/common
parentc5c2883ce039a35945282b770ad77f461cdf05ad (diff)
BGE: added clamping of angular velocity.
Angular velocity clamping was missing from the BGE. It is implemented similarly to the linear velocity clamping. It is needed to be able to drive physical simulations of systems that have a limited rotational speed. Reviewed by: campbellbarton, panzergame, ton Differential Revision: https://developer.blender.org/D1365
Diffstat (limited to 'source/gameengine/Physics/common')
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsController.h5
-rw-r--r--source/gameengine/Physics/common/PHY_Pro.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h
index 3e2337f01ea..62b163536dd 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsController.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h
@@ -125,6 +125,11 @@ class PHY_IPhysicsController : public PHY_IController
virtual float GetLinVelocityMax() const=0;
virtual void SetLinVelocityMax(float val) = 0;
+ virtual void SetAngularVelocityMin(float val) = 0;
+ virtual float GetAngularVelocityMin() const = 0;
+ virtual void SetAngularVelocityMax(float val) = 0;
+ virtual float GetAngularVelocityMax() const = 0;
+
MT_Vector3 GetWorldPosition(MT_Vector3& localpos);
// Shape control
diff --git a/source/gameengine/Physics/common/PHY_Pro.h b/source/gameengine/Physics/common/PHY_Pro.h
index 7c5d9c9638e..c9b91b06a3c 100644
--- a/source/gameengine/Physics/common/PHY_Pro.h
+++ b/source/gameengine/Physics/common/PHY_Pro.h
@@ -43,6 +43,8 @@ struct PHY_ShapeProps {
MT_Scalar m_friction_scaling[3]; // Scaling for anisotropic friction. Component in range [0, 1]
MT_Scalar m_clamp_vel_min; // Clamp the minimum velocity, this ensures an object moves at a minimum speed unless its stationary
MT_Scalar m_clamp_vel_max; // Clamp max velocity
+ MT_Scalar m_clamp_angvel_min; // Clamp the minimum angular velocity.
+ MT_Scalar m_clamp_angvel_max; // Clamp the maximum angular velocity.
bool m_do_anisotropic; // Should I do anisotropic friction?
bool m_do_fh; // Should the object have a linear Fh spring?
bool m_do_rot_fh; // Should the object have an angular Fh spring?