Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/rigidbody.c
| Show First 20 Lines • Show All 326 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* ************************************** */ | /* ************************************** */ | ||||
| /* Setup Utilities - Validate Sim Instances */ | /* Setup Utilities - Validate Sim Instances */ | ||||
| /* get the appropriate evaluated mesh based on rigid body mesh source */ | /* get the appropriate evaluated mesh based on rigid body mesh source */ | ||||
| static Mesh *rigidbody_get_mesh(Object *ob) | static Mesh *rigidbody_get_mesh(Object *ob) | ||||
| { | { | ||||
| BLI_assert(ob->type == OB_MESH); | |||||
| switch (ob->rigidbody_object->mesh_source) { | switch (ob->rigidbody_object->mesh_source) { | ||||
| case RBO_MESH_DEFORM: | case RBO_MESH_DEFORM: | ||||
| return ob->runtime.mesh_deform_eval; | return ob->runtime.mesh_deform_eval; | ||||
| case RBO_MESH_FINAL: | case RBO_MESH_FINAL: | ||||
| return ob->runtime.mesh_eval; | return BKE_object_get_evaluated_mesh(ob); | ||||
| case RBO_MESH_BASE: | case RBO_MESH_BASE: | ||||
| /* This mesh may be used for computing looptris, which should be done | /* This mesh may be used for computing looptris, which should be done | ||||
| * on the original; otherwise every time the CoW is recreated it will | * on the original; otherwise every time the CoW is recreated it will | ||||
| * have to be recomputed. */ | * have to be recomputed. */ | ||||
| BLI_assert(ob->rigidbody_object->mesh_source == RBO_MESH_BASE); | BLI_assert(ob->rigidbody_object->mesh_source == RBO_MESH_BASE); | ||||
| return ob->runtime.mesh_orig; | return (Mesh *)ob->runtime.data_orig; | ||||
| } | } | ||||
| /* Just return something sensible so that at least Blender won't crash. */ | /* Just return something sensible so that at least Blender won't crash. */ | ||||
| BLI_assert(!"Unknown mesh source"); | BLI_assert(!"Unknown mesh source"); | ||||
| return ob->runtime.mesh_eval; | return BKE_object_get_evaluated_mesh(ob); | ||||
| } | } | ||||
| /* create collision shape of mesh - convex hull */ | /* create collision shape of mesh - convex hull */ | ||||
| static rbCollisionShape *rigidbody_get_shape_convexhull_from_mesh(Object *ob, | static rbCollisionShape *rigidbody_get_shape_convexhull_from_mesh(Object *ob, | ||||
| float margin, | float margin, | ||||
| bool *can_embed) | bool *can_embed) | ||||
| { | { | ||||
| rbCollisionShape *shape = NULL; | rbCollisionShape *shape = NULL; | ||||
| ▲ Show 20 Lines • Show All 1,831 Lines • Show Last 20 Lines | |||||