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:
authorSergej Reich <sergej.reich@googlemail.com>2013-02-24 03:04:07 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-02-24 03:04:07 +0400
commitc82213359aa8bc2a762dc0a76c813d46c159a291 (patch)
tree312fc8aa5a246025d8d6d519b83c266d3a2b861a /source/blender/makesdna/DNA_rigidbody_types.h
parent47bd908e014412b4339ca4bca0a3556d9bd7fcd2 (diff)
rigidbody: Add motor constraint
It's implemented as a separate constraint instead of adding properties to the existing constraints. Motors only apply linear and angular impulses and don't limit the movement of rigid bodies, so it's best to use them in conjunction with other constraints to limit the degrees of freedom. Thanks to Markus Kasten (markus111) for the initial patch.
Diffstat (limited to 'source/blender/makesdna/DNA_rigidbody_types.h')
-rw-r--r--source/blender/makesdna/DNA_rigidbody_types.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index 01a680e558a..c144bc4e588 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -221,6 +221,12 @@ typedef struct RigidBodyCon {
float spring_damping_y;
float spring_damping_z;
+ /* motor settings */
+ float motor_lin_target_velocity; /* linear velocity the motor tries to hold */
+ float motor_ang_target_velocity; /* angular velocity the motor tries to hold */
+ float motor_lin_max_impulse; /* maximum force used to reach linear target velocity */
+ float motor_ang_max_impulse; /* maximum force used to reach angular target velocity */
+
/* References to Physics Sim object. Exist at runtime only */
void *physics_constraint; /* Physics object representation (i.e. btTypedConstraint) */
} RigidBodyCon;
@@ -249,7 +255,9 @@ typedef enum eRigidBodyCon_Type {
/* similar to slider but also allows rotation around slider axis */
RBC_TYPE_PISTON,
/* Simplified spring constraint with only once axis that's automatically placed between the connected bodies */
- RBC_TYPE_SPRING
+ RBC_TYPE_SPRING,
+ /* dirves bodies by applying linear and angular forces */
+ RBC_TYPE_MOTOR
} eRigidBodyCon_Type;
/* Flags for RigidBodyCon */
@@ -274,7 +282,10 @@ typedef enum eRigidBodyCon_Flag {
/* springs */
RBC_FLAG_USE_SPRING_X = (1 << 11),
RBC_FLAG_USE_SPRING_Y = (1 << 12),
- RBC_FLAG_USE_SPRING_Z = (1 << 13)
+ RBC_FLAG_USE_SPRING_Z = (1 << 13),
+ /* motors */
+ RBC_FLAG_USE_MOTOR_LIN = (1 << 14),
+ RBC_FLAG_USE_MOTOR_ANG = (1 << 15)
} eRigidBodyCon_Flag;
/* ******************************** */