[Bf-blender-cvs] [8c97b99daf7] fracture_modifier: Merge remote-tracking branch 'refs/remotes/origin/blender-v2.79-release' into fracture_modifier
Martin Felke
noreply at git.blender.org
Tue Sep 12 13:27:36 CEST 2017
Commit: 8c97b99daf75f1d7b63a6e5aba493660366765e7
Author: Martin Felke
Date: Tue Sep 12 13:25:40 2017 +0200
Branches: fracture_modifier
https://developer.blender.org/rB8c97b99daf75f1d7b63a6e5aba493660366765e7
Merge remote-tracking branch 'refs/remotes/origin/blender-v2.79-release' into fracture_modifier
Conflicts:
source/blender/blenkernel/intern/rigidbody.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/rigidbody.c
index f74202095be,f7a7f2a0ad5..95ca54e7ef3
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@@ -368,15 -434,9 +486,15 @@@ static void rigidbody_validate_sim_shap
if (!(rbo->flag & RBO_FLAG_USE_MARGIN) && has_volume)
hull_margin = 0.04f;
+ if (ob->type == OB_MESH && ob->data) {
- new_shape = rigidbody_get_shape_convexhull_from_mesh((Mesh *)ob->data, hull_margin, &can_embed);
+ new_shape = rigidbody_get_shape_convexhull_from_mesh(ob, hull_margin, &can_embed);
+ }
+ else {
+ printf("ERROR: cannot make Convex Hull collision shape for non-Mesh object\n");
+ }
+
if (!(rbo->flag & RBO_FLAG_USE_MARGIN))
- rbo->margin = (can_embed && has_volume) ? 0.04f : 0.0f; /* RB_TODO ideally we shouldn't directly change the margin here */
+ rbo->margin = (can_embed && has_volume) ? 0.04f : 0.0f; /* RB_TODO ideally we shouldn't directly change the margin here */
break;
case RB_SHAPE_TRIMESH:
new_shape = rigidbody_get_shape_trimesh_from_mesh(ob);
@@@ -400,9 -636,9 +694,9 @@@ void BKE_rigidbody_calc_center_of_mass(
/**
* Create physics sim representation of object given RigidBody settings
*
- * < rebuild: even if an instance already exists, replace it
+ * \param rebuild Even if an instance already exists, replace it
*/
-static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool rebuild)
+static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool rebuild, bool transfer_speeds)
{
RigidBodyOb *rbo = (ob) ? ob->rigidbody_object : NULL;
float loc[3];
@@@ -2249,26 -1613,11 +2543,21 @@@ void BKE_rigidbody_do_simulation(Scene
// RB_TODO deal with interpolated, old and baked results
bool can_simulate = (ctime == rbw->ltime + 1) && !(cache->flag & PTCACHE_BAKED);
- //why this ? this breaks the working old behavior... so deactivating it here again
- /*if (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0) {
- rbw->ltime = cache->startframe;
- }*/
-
- if (BKE_ptcache_read(&pid, ctime, can_simulate)) {
+ if (BKE_ptcache_read(&pid, ctime, can_simulate) == PTCACHE_READ_EXACT) {
BKE_ptcache_validate(cache, (int)ctime);
+
rbw->ltime = ctime;
+
return;
}
+ else if (rbw->ltime == startframe)
+ {
+ /*bool did_it = */restoreKinematic(rbw);
+ //if (did_it)
+
+ //make 1st run like later runs... hack...
+ rigidbody_update_simulation(scene, rbw, true);
+ }
/* advance simulation, we can only step one frame forward */
if (can_simulate) {
More information about the Bf-blender-cvs
mailing list