MCPcopy Create free account
hub / github.com/defold/defold / GetCollisionShapes3D

Function GetCollisionShapes3D

engine/physics/src/physics/physics_3d.cpp:860–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858 }
859
860 uint32_t GetCollisionShapes3D(HCollisionObject3D collision_object, HCollisionShape3D* out_buffer, uint32_t buffer_size)
861 {
862 btCollisionShape* shape = GetCollisionObject(collision_object)->getCollisionShape();
863 uint32_t n = 1;
864 if (shape->isCompound())
865 {
866 btCompoundShape* compound = (btCompoundShape*)shape;
867 n = compound->getNumChildShapes();
868 for (uint32_t i = 0; i < n && i < buffer_size; ++i)
869 {
870 out_buffer[i] = compound->getChildShape(i);
871 }
872 }
873 else if (buffer_size > 0)
874 {
875 out_buffer[0] = shape;
876 }
877 return n;
878 }
879
880 void SetCollisionObjectUserData3D(HCollisionObject3D collision_object, void* user_data)
881 {

Callers 1

ReplaceAndDeleteShape3DFunction · 0.50

Calls 5

getCollisionShapeMethod · 0.80
isCompoundMethod · 0.80
GetCollisionObjectFunction · 0.70
getNumChildShapesMethod · 0.45
getChildShapeMethod · 0.45

Tested by

no test coverage detected