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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-02-10 10:49:34 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-02-10 10:56:25 +0300
commit6971bd9a4fbb744386a5ab781172532d0aa4d4c6 (patch)
treeb416eabc62503626f113ee424b31304c56ae9bd8 /source/blender/blenkernel/intern/rigidbody.c
parent25412d8ae21f36cb8dd58810ea6700705553f83b (diff)
Fix T43611: Collision shape of rigid bodies changes inadvertently
The issue was caused by the fix for T34108, which modified DNA in order to get a fallback box collision shape. Not sue why it's needed, we can just get box shape directly, without modifying user's settings.
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 3bf5c4cc47e..aaf54b82f32 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -438,6 +438,10 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
new_shape = rigidbody_get_shape_trimesh_from_mesh(ob);
break;
}
+ /* use box shape if we can't fall back to old shape */
+ if (new_shape == NULL && rbo->physics_shape == NULL) {
+ new_shape = RB_shape_new_box(size[0], size[1], size[2]);
+ }
/* assign new collision shape if creation was successful */
if (new_shape) {
if (rbo->physics_shape)
@@ -445,11 +449,6 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
rbo->physics_shape = new_shape;
RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
}
- /* use box shape if we can't fall back to old shape */
- else if (rbo->physics_shape == NULL) {
- rbo->shape = RB_SHAPE_BOX;
- rigidbody_validate_sim_shape(ob, true);
- }
}
/* --------------------- */