Browse Source

Add stub version of CompoundShape::GetSubShape

Lucien Greathouse 4 months ago
parent
commit
0bbb80f4ce
2 changed files with 12 additions and 0 deletions
  1. 5 0
      JoltC/Functions.h
  2. 7 0
      JoltCImpl/JoltC.cpp

+ 5 - 0
JoltC/Functions.h

@@ -218,6 +218,11 @@ JPC_API JPC_Vec3 JPC_Shape_GetCenterOfMass(const JPC_Shape* self);
 
 typedef struct JPC_CompoundShape JPC_CompoundShape;
 
+// FIXME: The real API should return a new type, JPC_CompoundShape_SubShape*
+JPC_API const JPC_Shape* JPC_CompoundShape_GetSubShape_Shape(
+	const JPC_CompoundShape* self,
+	uint inIdx);
+
 JPC_API uint32_t JPC_CompoundShape_GetSubShapeIndexFromID(
 	const JPC_CompoundShape* self,
 	JPC_SubShapeID inSubShapeID,

+ 7 - 0
JoltCImpl/JoltC.cpp

@@ -1190,6 +1190,13 @@ JPC_API JPC_Vec3 JPC_Shape_GetCenterOfMass(const JPC_Shape* self) {
 ////////////////////////////////////////////////////////////////////////////////
 // CompoundShape
 
+JPC_API const JPC_Shape* JPC_CompoundShape_GetSubShape_Shape(
+	const JPC_CompoundShape* self,
+	uint inIdx)
+{
+	return to_jpc(to_jph(self)->GetSubShape(inIdx).mShape.GetPtr());
+}
+
 JPC_API uint32_t JPC_CompoundShape_GetSubShapeIndexFromID(
 	const JPC_CompoundShape* self,
 	JPC_SubShapeID inSubShapeID,