Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 25 Jul 2018 19:12:04 +0000 (21:12 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 25 Jul 2018 19:12:04 +0000 (21:12 +0200)
Conflicts:
source/blender/blenkernel/intern/rigidbody.c

1  2 
release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
source/blender/blenkernel/intern/rigidbody.c
source/blender/blenlib/intern/math_geom.c
source/blender/makesdna/DNA_rigidbody_types.h
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_rigidbody.c

@@@ -716,8 -700,36 +716,37 @@@ static void rigidbody_validate_sim_obje
  
  /* --------------------- */
  
 -static void rigidbody_constraint_set_limits(RigidBodyCon *rbc, void (*set_limits)(rbConstraint*,int,float,float))
+ static void rigidbody_constraint_init_spring(
+       RigidBodyCon *rbc, void (*set_spring)(rbConstraint*,int,int),
+       void (*set_stiffness)(rbConstraint*,int,float), void (*set_damping)(rbConstraint*,int,float)
+ ) {
+       set_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->flag & RBC_FLAG_USE_SPRING_X);
+       set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_stiffness_x);
+       set_damping(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_damping_x);
+       set_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->flag & RBC_FLAG_USE_SPRING_Y);
+       set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->spring_stiffness_y);
+       set_damping(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->spring_damping_y);
+       set_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->flag & RBC_FLAG_USE_SPRING_Z);
+       set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->spring_stiffness_z);
+       set_damping(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->spring_damping_z);
+       set_spring(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->flag & RBC_FLAG_USE_SPRING_ANG_X);
+       set_stiffness(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->spring_stiffness_ang_x);
+       set_damping(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->spring_damping_ang_x);
+       set_spring(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->flag & RBC_FLAG_USE_SPRING_ANG_Y);
+       set_stiffness(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->spring_stiffness_ang_y);
+       set_damping(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->spring_damping_ang_y);
+       set_spring(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->flag & RBC_FLAG_USE_SPRING_ANG_Z);
+       set_stiffness(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_stiffness_ang_z);
+       set_damping(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_damping_ang_z);
+ }
 +static void rigidbody_constraint_set_limits(
 +        RigidBodyCon *rbc, void (*set_limits)(rbConstraint *, int, float, float))
  {
        if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X)
                set_limits(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper);