浏览代码

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