Преглед изворни кода

Bind `TwoBodyConstraint` API

Lucien Greathouse пре 5 месеци
родитељ
комит
9ceb2d6007
2 измењених фајлова са 22 додато и 0 уклоњено
  1. 6 0
      JoltC/Functions.h
  2. 16 0
      JoltCImpl/JoltC.cpp

+ 6 - 0
JoltC/Functions.h

@@ -613,6 +613,12 @@ JPC_API void JPC_Constraint_NotifyShapeChanged(JPC_Constraint* self, JPC_BodyID
 
 typedef struct JPC_TwoBodyConstraint JPC_TwoBodyConstraint;
 
+JPC_API JPC_Body* JPC_TwoBodyConstraint_GetBody1(JPC_TwoBodyConstraint* self);
+JPC_API JPC_Body* JPC_TwoBodyConstraint_GetBody2(JPC_TwoBodyConstraint* self);
+
+JPC_API JPC_Mat44 JPC_TwoBodyConstraint_GetConstraintToBody1Matrix(JPC_TwoBodyConstraint* self);
+JPC_API JPC_Mat44 JPC_TwoBodyConstraint_GetConstraintToBody2Matrix(JPC_TwoBodyConstraint* self);
+
 ////////////////////////////////////////////////////////////////////////////////
 // ConstraintSettings
 

+ 16 - 0
JoltCImpl/JoltC.cpp

@@ -864,6 +864,22 @@ JPC_API void JPC_Constraint_NotifyShapeChanged(JPC_Constraint* self, JPC_BodyID
 
 OPAQUE_WRAPPER(JPC_TwoBodyConstraint, JPH::TwoBodyConstraint);
 
+JPC_API JPC_Body* JPC_TwoBodyConstraint_GetBody1(JPC_TwoBodyConstraint* self) {
+	return to_jpc(to_jph(self)->GetBody1());
+}
+
+JPC_API JPC_Body* JPC_TwoBodyConstraint_GetBody2(JPC_TwoBodyConstraint* self) {
+	return to_jpc(to_jph(self)->GetBody2());
+}
+
+JPC_API JPC_Mat44 JPC_TwoBodyConstraint_GetConstraintToBody1Matrix(JPC_TwoBodyConstraint* self) {
+	return to_jpc(to_jph(self)->GetConstraintToBody1Matrix());
+}
+
+JPC_API JPC_Mat44 JPC_TwoBodyConstraint_GetConstraintToBody2Matrix(JPC_TwoBodyConstraint* self) {
+	return to_jpc(to_jph(self)->GetConstraintToBody2Matrix());
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // ConstraintSettings