From c48238fac6c3a8a767c290ebb1c5e22b18d9bfe9 Mon Sep 17 00:00:00 2001 From: Sergej Reich Date: Wed, 23 Jan 2013 05:57:01 +0000 Subject: rigidbody: Add generic spring constraint Behaves like the generic constraint but has optional spring on each axis. TODO: Add option to set rest length. Patch by Markus Kasten (markus111), thanks! --- source/blender/makesdna/DNA_rigidbody_types.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/makesdna/DNA_rigidbody_types.h') diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h index 5b7ffe4209c..e24b24deece 100644 --- a/source/blender/makesdna/DNA_rigidbody_types.h +++ b/source/blender/makesdna/DNA_rigidbody_types.h @@ -207,6 +207,15 @@ typedef struct RigidBodyCon { float limit_ang_z_lower; /* lower limit for z axis rotation */ float limit_ang_z_upper; /* upper limit for z axis rotation */ + /* spring settings */ + /* RB_TODO document spring properties */ + float spring_stiffness_x; + float spring_stiffness_y; + float spring_stiffness_z; + float spring_damping_x; + float spring_damping_y; + float spring_damping_z; + /* References to Physics Sim object. Exist at runtime only */ void *physics_constraint; /* Physics object representation (i.e. btTypedConstraint) */ } RigidBodyCon; @@ -257,6 +266,10 @@ typedef enum eRigidBodyCon_Flag { RBC_FLAG_USE_LIMIT_ANG_X = (1<<8), RBC_FLAG_USE_LIMIT_ANG_Y = (1<<9), RBC_FLAG_USE_LIMIT_ANG_Z = (1<<10), + /* springs */ + RBC_FLAG_USE_SPRING_X = (1<<11), + RBC_FLAG_USE_SPRING_Y = (1<<12), + RBC_FLAG_USE_SPRING_Z = (1<<13) } eRigidBodyCon_Flag; /* ******************************** */ -- cgit v1.2.3