From ec640510a8c8ef5de8daea907da2351ef1988915 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 14 Jul 2018 17:01:02 +0300 Subject: Fix T55958: allow the user to select between spring and spring2. The old springs with damping 1.0 operate in a special way that is more similar to plastic deformation than a spring. Some users rely on that, so let the user choose which implementation to use. This also restores full backward compatibility with 2.79. Reviewers: sergof Differential Revision: https://developer.blender.org/D3544 --- source/blender/makesdna/DNA_rigidbody_types.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (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 1cd3a22fbe0..19e49644816 100644 --- a/source/blender/makesdna/DNA_rigidbody_types.h +++ b/source/blender/makesdna/DNA_rigidbody_types.h @@ -203,7 +203,8 @@ typedef struct RigidBodyCon { int flag; /* (eRigidBodyCon_Flag) */ float breaking_threshold; /* breaking impulse threshold */ - float pad; + char spring_type; /* spring implementation to use */ + char pad[3]; /* limits */ /* translation limits */ @@ -273,9 +274,15 @@ typedef enum eRigidBodyCon_Type { /* Simplified spring constraint with only once axis that's automatically placed between the connected bodies */ RBC_TYPE_SPRING, /* dirves bodies by applying linear and angular forces */ - RBC_TYPE_MOTOR + RBC_TYPE_MOTOR, } eRigidBodyCon_Type; +/* Spring implementation type for RigidBodyOb */ +typedef enum eRigidBodyCon_SpringType { + RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */ + RBC_SPRING_TYPE2, /* btGeneric6DofSpring2Constraint */ +} eRigidBodyCon_SpringType; + /* Flags for RigidBodyCon */ typedef enum eRigidBodyCon_Flag { /* constraint influences rigid body motion */ -- cgit v1.2.3