Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/rigidbody.c
| Context not available. | |||||
| #include <math.h> | #include <math.h> | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| Context not available. | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| static CLG_LogRef LOG = { "bke.rigidbody" }; | |||||
| /* ************************************** */ | /* ************************************** */ | ||||
| /* Memory Management */ | /* Memory Management */ | ||||
| Context not available. | |||||
| totvert = (mesh) ? mesh->totvert : 0; | totvert = (mesh) ? mesh->totvert : 0; | ||||
| } | } | ||||
| else { | else { | ||||
| printf("ERROR: cannot make Convex Hull collision shape for non-Mesh object\n"); | CLOG_ERROR(&LOG, "cannot make Convex Hull collision shape for non-Mesh object"); | ||||
| } | } | ||||
| if (totvert) { | if (totvert) { | ||||
| shape = RB_shape_new_convex_hull((float *)mvert, sizeof(MVert), totvert, margin, can_embed); | shape = RB_shape_new_convex_hull((float *)mvert, sizeof(MVert), totvert, margin, can_embed); | ||||
| } | } | ||||
| else { | else { | ||||
| printf("ERROR: no vertices to define Convex Hull collision shape with\n"); | CLOG_ERROR(&LOG, "no vertices to define Convex Hull collision shape with"); | ||||
| } | } | ||||
| return shape; | return shape; | ||||
| Context not available. | |||||
| /* sanity checking - potential case when no data will be present */ | /* sanity checking - potential case when no data will be present */ | ||||
| if ((totvert == 0) || (tottri == 0)) { | if ((totvert == 0) || (tottri == 0)) { | ||||
| printf("WARNING: no geometry data converted for Mesh Collision Shape (ob = %s)\n", ob->id.name + 2); | CLOG_WARN(&LOG, "no geometry data converted for Mesh Collision Shape (ob = %s)", ob->id.name + 2); | ||||
| } | } | ||||
| else { | else { | ||||
| rbMeshData *mdata; | rbMeshData *mdata; | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| printf("ERROR: cannot make Triangular Mesh collision shape for non-Mesh object\n"); | CLOG_ERROR(&LOG, "cannot make Triangular Mesh collision shape for non-Mesh object"); | ||||
| } | } | ||||
| return shape; | return shape; | ||||
| Context not available. | |||||