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:
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 3d38f15db25..60ae37da09a 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -292,7 +292,7 @@ static rbCollisionShape *rigidbody_get_shape_trimesh_from_mesh(Object *ob)
int totvert;
int tottri;
const MLoop *mloop;
-
+
mesh = rigidbody_get_mesh(ob);
/* ensure mesh validity, then grab data */
@@ -315,7 +315,7 @@ static rbCollisionShape *rigidbody_get_shape_trimesh_from_mesh(Object *ob)
/* init mesh data for collision shape */
mdata = RB_trimesh_data_new(tottri, totvert);
-
+
RB_trimesh_add_vertices(mdata, (float *)mvert, totvert, sizeof(MVert));
/* loop over all faces, adding them as triangles to the collision shape
@@ -334,7 +334,7 @@ static rbCollisionShape *rigidbody_get_shape_trimesh_from_mesh(Object *ob)
RB_trimesh_add_triangle_indices(mdata, i, UNPACK3(vtri));
}
}
-
+
RB_trimesh_finish(mdata);
/* construct collision shape
@@ -520,17 +520,17 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol)
const MLoopTri *lt = NULL;
int totvert, tottri = 0;
const MLoop *mloop = NULL;
-
+
/* ensure mesh validity, then grab data */
if (mesh == NULL)
return;
-
+
mvert = mesh->mvert;
totvert = mesh->totvert;
lt = BKE_mesh_runtime_looptri_ensure(mesh);
tottri = mesh->runtime.looptris.len;
mloop = mesh->mloop;
-
+
if (totvert > 0 && tottri > 0) {
BKE_mesh_calc_volume(mvert, totvert, lt, tottri, mloop, &volume, NULL);
}
@@ -598,17 +598,17 @@ void BKE_rigidbody_calc_center_of_mass(Object *ob, float r_center[3])
const MLoopTri *looptri;
int totvert, tottri;
const MLoop *mloop;
-
+
/* ensure mesh validity, then grab data */
if (mesh == NULL)
return;
-
+
mvert = mesh->mvert;
totvert = mesh->totvert;
looptri = BKE_mesh_runtime_looptri_ensure(mesh);
tottri = mesh->runtime.looptris.len;
mloop = mesh->mloop;
-
+
if (totvert > 0 && tottri > 0) {
BKE_mesh_calc_volume(mvert, totvert, looptri, tottri, mloop, NULL, r_center);
}
@@ -1328,7 +1328,7 @@ static void rigidbody_update_simulation(Depsgraph *depsgraph, Scene *scene, Rigi
/* XXX TODO For rebuild: remove all constraints first.
* Otherwise we can end up deleting objects that are still
* referenced by constraints, corrupting bullet's internal list.
- *
+ *
* Memory management needs redesign here, this is just a dirty workaround.
*/
if (rebuild && rbw->constraints) {
@@ -1389,7 +1389,7 @@ static void rigidbody_update_simulation(Depsgraph *depsgraph, Scene *scene, Rigi
}
}
FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
-
+
/* update constraints */
if (rbw->constraints == NULL) /* no constraints, move on */
return;