// Jolt Physics HashLink C Bindings // Auto-generated structure based on jolt.idl #ifdef EMSCRIPTEN #include #define HL_PRIM #define HL_NAME(n) EMSCRIPTEN_KEEPALIVE ej_##n #define DEFINE_PRIM(ret, name, args) #define DEFINE_PRIM_PROP(...) #else #define HL_NAME(x) jolt_##x #include #define _IDL _BYTES #define _OPT(t) vdynamic * #define _GET_OPT(value,t) (value)->v.t #endif // Suppress C4005 macro redefinition warnings (JPH_PLATFORM_WINDOWS defined both on command line and in Core.h) #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4005) #endif // Disable Jolt debug asserts - they use __debugbreak() which crashes without a debugger attached // JPH_NO_DEBUG prevents JPH_DEBUG which prevents JPH_ENABLE_ASSERTS from being auto-defined #define JPH_NO_DEBUG // Jolt includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER #pragma warning(pop) // Suppress C4244 double-to-float conversion warnings in our RVec3 bindings #pragma warning(disable: 4244) #endif JPH_SUPPRESS_WARNINGS using namespace JPH; // Memory management macros for HashLink // _ref(t) is the type used in function signatures // alloc_ref wraps a pointer for HL // _unref extracts the pointer #define _ref(t) t #define alloc_ref(r, _) r #define alloc_ref_const(r,_) r #define _unref(v) v #define free_ref(v) delete (v) #define HL_CONST const // Broad phase layers namespace Layers { static constexpr ObjectLayer NON_MOVING = 0; static constexpr ObjectLayer MOVING = 1; static constexpr ObjectLayer NUM_LAYERS = 2; }; namespace BroadPhaseLayers { static constexpr BroadPhaseLayer NON_MOVING(0); static constexpr BroadPhaseLayer MOVING(1); static constexpr uint NUM_LAYERS(2); }; // BroadPhaseLayerInterface implementation class BPLayerInterfaceImpl final : public BroadPhaseLayerInterface { public: BPLayerInterfaceImpl() { mObjectToBroadPhase[Layers::NON_MOVING] = BroadPhaseLayers::NON_MOVING; mObjectToBroadPhase[Layers::MOVING] = BroadPhaseLayers::MOVING; } virtual uint GetNumBroadPhaseLayers() const override { return BroadPhaseLayers::NUM_LAYERS; } virtual BroadPhaseLayer GetBroadPhaseLayer(ObjectLayer inLayer) const override { JPH_ASSERT(inLayer < Layers::NUM_LAYERS); return mObjectToBroadPhase[inLayer]; } #if defined(JPH_EXTERNAL_PROFILE) || defined(JPH_PROFILE_ENABLED) virtual const char* GetBroadPhaseLayerName(BroadPhaseLayer inLayer) const override { switch ((BroadPhaseLayer::Type)inLayer) { case (BroadPhaseLayer::Type)BroadPhaseLayers::NON_MOVING: return "NON_MOVING"; case (BroadPhaseLayer::Type)BroadPhaseLayers::MOVING: return "MOVING"; default: return "INVALID"; } } #endif private: BroadPhaseLayer mObjectToBroadPhase[Layers::NUM_LAYERS]; }; // ObjectVsBroadPhaseLayerFilter implementation class ObjectVsBroadPhaseLayerFilterImpl : public ObjectVsBroadPhaseLayerFilter { public: virtual bool ShouldCollide(ObjectLayer inLayer1, BroadPhaseLayer inLayer2) const override { switch (inLayer1) { case Layers::NON_MOVING: return inLayer2 == BroadPhaseLayers::MOVING; case Layers::MOVING: return true; default: JPH_ASSERT(false); return false; } } }; // ObjectLayerPairFilter implementation class ObjectLayerPairFilterImpl : public ObjectLayerPairFilter { public: virtual bool ShouldCollide(ObjectLayer inObject1, ObjectLayer inObject2) const override { switch (inObject1) { case Layers::NON_MOVING: return inObject2 == Layers::MOVING; case Layers::MOVING: return true; default: JPH_ASSERT(false); return false; } } }; // Global instances static BPLayerInterfaceImpl* g_broad_phase_layer_interface = nullptr; static ObjectVsBroadPhaseLayerFilterImpl* g_object_vs_broadphase_layer_filter = nullptr; static ObjectLayerPairFilterImpl* g_object_vs_object_layer_filter = nullptr; static TempAllocatorImpl* g_temp_allocator = nullptr; static JobSystemThreadPool* g_job_system = nullptr; extern "C" { // ============= Initialization ============= static bool g_jolt_initialized = false; HL_PRIM void HL_NAME(Init)() { if (g_jolt_initialized) return; g_jolt_initialized = true; // Register allocation hook RegisterDefaultAllocator(); // Install callbacks Trace = [](const char* inFMT, ...) {}; JPH_IF_ENABLE_ASSERTS(AssertFailed = [](const char* inExpression, const char* inMessage, const char* inFile, uint inLine) { return false; };) // Create factory Factory::sInstance = new Factory(); // Register types RegisterTypes(); // Create global helpers g_temp_allocator = new TempAllocatorImpl(64 * 1024 * 1024); g_job_system = new JobSystemThreadPool(cMaxPhysicsJobs, cMaxPhysicsBarriers, thread::hardware_concurrency() - 1); g_broad_phase_layer_interface = new BPLayerInterfaceImpl(); g_object_vs_broadphase_layer_filter = new ObjectVsBroadPhaseLayerFilterImpl(); g_object_vs_object_layer_filter = new ObjectLayerPairFilterImpl(); } DEFINE_PRIM(_VOID, Init, _NO_ARG); HL_PRIM void HL_NAME(Shutdown)() { UnregisterTypes(); delete Factory::sInstance; Factory::sInstance = nullptr; delete g_temp_allocator; delete g_job_system; delete g_broad_phase_layer_interface; delete g_object_vs_broadphase_layer_filter; delete g_object_vs_object_layer_filter; g_temp_allocator = nullptr; g_job_system = nullptr; g_broad_phase_layer_interface = nullptr; g_object_vs_broadphase_layer_filter = nullptr; g_object_vs_object_layer_filter = nullptr; } DEFINE_PRIM(_VOID, Shutdown, _NO_ARG); // ============= Vec3 ============= HL_PRIM _ref(Vec3)* HL_NAME(Vec3_new0)() { return alloc_ref(new Vec3(), Vec3); } DEFINE_PRIM(_IDL, Vec3_new0, _NO_ARG); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_new3)(float x, float y, float z) { return alloc_ref(new Vec3(x, y, z), Vec3); } DEFINE_PRIM(_IDL, Vec3_new3, _F32 _F32 _F32); HL_PRIM void HL_NAME(Vec3_delete)(_ref(Vec3)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, Vec3_delete, _IDL); HL_PRIM float HL_NAME(Vec3_GetX0)(_ref(Vec3)* _this) { return _unref(_this)->GetX(); } DEFINE_PRIM(_F32, Vec3_GetX0, _IDL); HL_PRIM float HL_NAME(Vec3_GetY0)(_ref(Vec3)* _this) { return _unref(_this)->GetY(); } DEFINE_PRIM(_F32, Vec3_GetY0, _IDL); HL_PRIM float HL_NAME(Vec3_GetZ0)(_ref(Vec3)* _this) { return _unref(_this)->GetZ(); } DEFINE_PRIM(_F32, Vec3_GetZ0, _IDL); HL_PRIM void HL_NAME(Vec3_SetX1)(_ref(Vec3)* _this, float x) { _unref(_this)->SetX(x); } DEFINE_PRIM(_VOID, Vec3_SetX1, _IDL _F32); HL_PRIM void HL_NAME(Vec3_SetY1)(_ref(Vec3)* _this, float y) { _unref(_this)->SetY(y); } DEFINE_PRIM(_VOID, Vec3_SetY1, _IDL _F32); HL_PRIM void HL_NAME(Vec3_SetZ1)(_ref(Vec3)* _this, float z) { _unref(_this)->SetZ(z); } DEFINE_PRIM(_VOID, Vec3_SetZ1, _IDL _F32); HL_PRIM float HL_NAME(Vec3_Length0)(_ref(Vec3)* _this) { return _unref(_this)->Length(); } DEFINE_PRIM(_F32, Vec3_Length0, _IDL); HL_PRIM float HL_NAME(Vec3_LengthSq0)(_ref(Vec3)* _this) { return _unref(_this)->LengthSq(); } DEFINE_PRIM(_F32, Vec3_LengthSq0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_Normalized0)(_ref(Vec3)* _this) { return alloc_ref(new Vec3(_unref(_this)->Normalized()), Vec3); } DEFINE_PRIM(_IDL, Vec3_Normalized0, _IDL); HL_PRIM float HL_NAME(Vec3_Dot1)(_ref(Vec3)* _this, _ref(Vec3)* other) { return _unref(_this)->Dot(*_unref(other)); } DEFINE_PRIM(_F32, Vec3_Dot1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_Cross1)(_ref(Vec3)* _this, _ref(Vec3)* other) { return alloc_ref(new Vec3(_unref(_this)->Cross(*_unref(other))), Vec3); } DEFINE_PRIM(_IDL, Vec3_Cross1, _IDL _IDL); HL_PRIM void HL_NAME(Vec3_Set3)(_ref(Vec3)* _this, float x, float y, float z) { *_unref(_this) = Vec3(x, y, z); } DEFINE_PRIM(_VOID, Vec3_Set3, _IDL _F32 _F32 _F32); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_Add1)(_ref(Vec3)* _this, _ref(Vec3)* other) { return alloc_ref(new Vec3(*_unref(_this) + *_unref(other)), Vec3); } DEFINE_PRIM(_IDL, Vec3_Add1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_Sub1)(_ref(Vec3)* _this, _ref(Vec3)* other) { return alloc_ref(new Vec3(*_unref(_this) - *_unref(other)), Vec3); } DEFINE_PRIM(_IDL, Vec3_Sub1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_Mul1)(_ref(Vec3)* _this, float scalar) { return alloc_ref(new Vec3(*_unref(_this) * scalar), Vec3); } DEFINE_PRIM(_IDL, Vec3_Mul1, _IDL _F32); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_Div1)(_ref(Vec3)* _this, float scalar) { return alloc_ref(new Vec3(*_unref(_this) / scalar), Vec3); } DEFINE_PRIM(_IDL, Vec3_Div1, _IDL _F32); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_sZero0)() { return alloc_ref(new Vec3(Vec3::sZero()), Vec3); } DEFINE_PRIM(_IDL, Vec3_sZero0, _NO_ARG); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_sOne0)() { return alloc_ref(new Vec3(Vec3::sReplicate(1.0f)), Vec3); } DEFINE_PRIM(_IDL, Vec3_sOne0, _NO_ARG); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_sAxisX0)() { return alloc_ref(new Vec3(Vec3::sAxisX()), Vec3); } DEFINE_PRIM(_IDL, Vec3_sAxisX0, _NO_ARG); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_sAxisY0)() { return alloc_ref(new Vec3(Vec3::sAxisY()), Vec3); } DEFINE_PRIM(_IDL, Vec3_sAxisY0, _NO_ARG); HL_PRIM _ref(Vec3)* HL_NAME(Vec3_sAxisZ0)() { return alloc_ref(new Vec3(Vec3::sAxisZ()), Vec3); } DEFINE_PRIM(_IDL, Vec3_sAxisZ0, _NO_ARG); // ============= RVec3 ============= HL_PRIM _ref(RVec3)* HL_NAME(RVec3_new0)() { return alloc_ref(new RVec3(), RVec3); } DEFINE_PRIM(_IDL, RVec3_new0, _NO_ARG); HL_PRIM _ref(RVec3)* HL_NAME(RVec3_new3)(double x, double y, double z) { return alloc_ref(new RVec3((Real)x, (Real)y, (Real)z), RVec3); } DEFINE_PRIM(_IDL, RVec3_new3, _F64 _F64 _F64); HL_PRIM void HL_NAME(RVec3_delete)(_ref(RVec3)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, RVec3_delete, _IDL); HL_PRIM double HL_NAME(RVec3_GetX0)(_ref(RVec3)* _this) { return _unref(_this)->GetX(); } DEFINE_PRIM(_F64, RVec3_GetX0, _IDL); HL_PRIM double HL_NAME(RVec3_GetY0)(_ref(RVec3)* _this) { return _unref(_this)->GetY(); } DEFINE_PRIM(_F64, RVec3_GetY0, _IDL); HL_PRIM double HL_NAME(RVec3_GetZ0)(_ref(RVec3)* _this) { return _unref(_this)->GetZ(); } DEFINE_PRIM(_F64, RVec3_GetZ0, _IDL); HL_PRIM void HL_NAME(RVec3_SetX1)(_ref(RVec3)* _this, double x) { _unref(_this)->SetX((Real)x); } DEFINE_PRIM(_VOID, RVec3_SetX1, _IDL _F64); HL_PRIM void HL_NAME(RVec3_SetY1)(_ref(RVec3)* _this, double y) { _unref(_this)->SetY((Real)y); } DEFINE_PRIM(_VOID, RVec3_SetY1, _IDL _F64); HL_PRIM void HL_NAME(RVec3_SetZ1)(_ref(RVec3)* _this, double z) { _unref(_this)->SetZ((Real)z); } DEFINE_PRIM(_VOID, RVec3_SetZ1, _IDL _F64); HL_PRIM void HL_NAME(RVec3_Set3)(_ref(RVec3)* _this, double x, double y, double z) { *_unref(_this) = RVec3((Real)x, (Real)y, (Real)z); } DEFINE_PRIM(_VOID, RVec3_Set3, _IDL _F64 _F64 _F64); HL_PRIM double HL_NAME(RVec3_Length0)(_ref(RVec3)* _this) { return _unref(_this)->Length(); } DEFINE_PRIM(_F64, RVec3_Length0, _IDL); HL_PRIM double HL_NAME(RVec3_LengthSq0)(_ref(RVec3)* _this) { return _unref(_this)->LengthSq(); } DEFINE_PRIM(_F64, RVec3_LengthSq0, _IDL); HL_PRIM _ref(RVec3)* HL_NAME(RVec3_Normalized0)(_ref(RVec3)* _this) { return alloc_ref(new RVec3(_unref(_this)->Normalized()), RVec3); } DEFINE_PRIM(_IDL, RVec3_Normalized0, _IDL); HL_PRIM _ref(RVec3)* HL_NAME(RVec3_sZeroR0)() { return alloc_ref(new RVec3(RVec3::sZero()), RVec3); } DEFINE_PRIM(_IDL, RVec3_sZeroR0, _NO_ARG); // ============= Quat ============= HL_PRIM _ref(Quat)* HL_NAME(Quat_new0)() { return alloc_ref(new Quat(Quat::sIdentity()), Quat); } DEFINE_PRIM(_IDL, Quat_new0, _NO_ARG); HL_PRIM _ref(Quat)* HL_NAME(Quat_new4)(float x, float y, float z, float w) { return alloc_ref(new Quat(x, y, z, w), Quat); } DEFINE_PRIM(_IDL, Quat_new4, _F32 _F32 _F32 _F32); HL_PRIM void HL_NAME(Quat_delete)(_ref(Quat)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, Quat_delete, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Quat_sIdentity0)() { return alloc_ref(new Quat(Quat::sIdentity()), Quat); } DEFINE_PRIM(_IDL, Quat_sIdentity0, _NO_ARG); HL_PRIM float HL_NAME(Quat_GetX0)(_ref(Quat)* _this) { return _unref(_this)->GetX(); } DEFINE_PRIM(_F32, Quat_GetX0, _IDL); HL_PRIM float HL_NAME(Quat_GetY0)(_ref(Quat)* _this) { return _unref(_this)->GetY(); } DEFINE_PRIM(_F32, Quat_GetY0, _IDL); HL_PRIM float HL_NAME(Quat_GetZ0)(_ref(Quat)* _this) { return _unref(_this)->GetZ(); } DEFINE_PRIM(_F32, Quat_GetZ0, _IDL); HL_PRIM float HL_NAME(Quat_GetW0)(_ref(Quat)* _this) { return _unref(_this)->GetW(); } DEFINE_PRIM(_F32, Quat_GetW0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Quat_Normalized0)(_ref(Quat)* _this) { return alloc_ref(new Quat(_unref(_this)->Normalized()), Quat); } DEFINE_PRIM(_IDL, Quat_Normalized0, _IDL); HL_PRIM float HL_NAME(Quat_Length0)(_ref(Quat)* _this) { return _unref(_this)->Length(); } DEFINE_PRIM(_F32, Quat_Length0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Quat_Conjugated0)(_ref(Quat)* _this) { return alloc_ref(new Quat(_unref(_this)->Conjugated()), Quat); } DEFINE_PRIM(_IDL, Quat_Conjugated0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Quat_Inversed0)(_ref(Quat)* _this) { return alloc_ref(new Quat(_unref(_this)->Inversed()), Quat); } DEFINE_PRIM(_IDL, Quat_Inversed0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Quat_MulQuat1)(_ref(Quat)* _this, _ref(Quat)* other) { Quat result = *_unref(_this) * *_unref(other); return alloc_ref(new Quat(result), Quat); } DEFINE_PRIM(_IDL, Quat_MulQuat1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Quat_MulVec31)(_ref(Quat)* _this, _ref(Vec3)* v) { Vec3 result = *_unref(_this) * *_unref(v); return alloc_ref(new Vec3(result), Vec3); } DEFINE_PRIM(_IDL, Quat_MulVec31, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Quat_GetEulerAngles0)(_ref(Quat)* _this) { Vec3 angles = _unref(_this)->GetEulerAngles(); return alloc_ref(new Vec3(angles), Vec3); } DEFINE_PRIM(_IDL, Quat_GetEulerAngles0, _IDL); HL_PRIM void HL_NAME(Quat_SetX1)(_ref(Quat)* _this, float x) { *_unref(_this) = Quat(x, _unref(_this)->GetY(), _unref(_this)->GetZ(), _unref(_this)->GetW()); } DEFINE_PRIM(_VOID, Quat_SetX1, _IDL _F32); HL_PRIM void HL_NAME(Quat_SetY1)(_ref(Quat)* _this, float y) { *_unref(_this) = Quat(_unref(_this)->GetX(), y, _unref(_this)->GetZ(), _unref(_this)->GetW()); } DEFINE_PRIM(_VOID, Quat_SetY1, _IDL _F32); HL_PRIM void HL_NAME(Quat_SetZ1)(_ref(Quat)* _this, float z) { *_unref(_this) = Quat(_unref(_this)->GetX(), _unref(_this)->GetY(), z, _unref(_this)->GetW()); } DEFINE_PRIM(_VOID, Quat_SetZ1, _IDL _F32); HL_PRIM void HL_NAME(Quat_SetW1)(_ref(Quat)* _this, float w) { *_unref(_this) = Quat(_unref(_this)->GetX(), _unref(_this)->GetY(), _unref(_this)->GetZ(), w); } DEFINE_PRIM(_VOID, Quat_SetW1, _IDL _F32); HL_PRIM void HL_NAME(Quat_Set4)(_ref(Quat)* _this, float x, float y, float z, float w) { *_unref(_this) = Quat(x, y, z, w); } DEFINE_PRIM(_VOID, Quat_Set4, _IDL _F32 _F32 _F32 _F32); HL_PRIM _ref(Quat)* HL_NAME(Quat_sRotation2)(_ref(Vec3)* axis, float angle) { return alloc_ref(new Quat(Quat::sRotation(*_unref(axis), angle)), Quat); } DEFINE_PRIM(_IDL, Quat_sRotation2, _IDL _F32); HL_PRIM _ref(Quat)* HL_NAME(Quat_sEulerAngles1)(_ref(Vec3)* angles) { return alloc_ref(new Quat(Quat::sEulerAngles(*_unref(angles))), Quat); } DEFINE_PRIM(_IDL, Quat_sEulerAngles1, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Quat_SLERP2)(_ref(Quat)* _this, _ref(Quat)* other, float t) { return alloc_ref(new Quat(_unref(_this)->SLERP(*_unref(other), t)), Quat); } DEFINE_PRIM(_IDL, Quat_SLERP2, _IDL _IDL _F32); // ============= PhysicsSystem ============= HL_PRIM _ref(PhysicsSystem)* HL_NAME(PhysicsSystem_new0)() { return alloc_ref(new PhysicsSystem(), PhysicsSystem); } DEFINE_PRIM(_IDL, PhysicsSystem_new0, _NO_ARG); HL_PRIM void HL_NAME(PhysicsSystem_delete)(_ref(PhysicsSystem)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, PhysicsSystem_delete, _IDL); HL_PRIM void HL_NAME(PhysicsSystem_Init4)(_ref(PhysicsSystem)* _this, int maxBodies, int numBodyMutexes, int maxBodyPairs, int maxContactConstraints) { _unref(_this)->Init(maxBodies, numBodyMutexes, maxBodyPairs, maxContactConstraints, *g_broad_phase_layer_interface, *g_object_vs_broadphase_layer_filter, *g_object_vs_object_layer_filter); } DEFINE_PRIM(_VOID, PhysicsSystem_Init4, _IDL _I32 _I32 _I32 _I32); HL_PRIM void HL_NAME(PhysicsSystem_OptimizeBroadPhase0)(_ref(PhysicsSystem)* _this) { _unref(_this)->OptimizeBroadPhase(); } DEFINE_PRIM(_VOID, PhysicsSystem_OptimizeBroadPhase0, _IDL); HL_PRIM int HL_NAME(PhysicsSystem_Update2)(_ref(PhysicsSystem)* _this, float deltaTime, int collisionSteps) { return (int)_unref(_this)->Update(deltaTime, collisionSteps, g_temp_allocator, g_job_system); } DEFINE_PRIM(_I32, PhysicsSystem_Update2, _IDL _F32 _I32); HL_PRIM _ref(BodyInterface)* HL_NAME(PhysicsSystem_GetBodyInterface0)(_ref(PhysicsSystem)* _this) { return &_unref(_this)->GetBodyInterface(); } DEFINE_PRIM(_IDL, PhysicsSystem_GetBodyInterface0, _IDL); HL_PRIM void HL_NAME(PhysicsSystem_SetGravity1)(_ref(PhysicsSystem)* _this, _ref(Vec3)* gravity) { _unref(_this)->SetGravity(*_unref(gravity)); } DEFINE_PRIM(_VOID, PhysicsSystem_SetGravity1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(PhysicsSystem_GetGravity0)(_ref(PhysicsSystem)* _this) { return alloc_ref(new Vec3(_unref(_this)->GetGravity()), Vec3); } DEFINE_PRIM(_IDL, PhysicsSystem_GetGravity0, _IDL); HL_PRIM int HL_NAME(PhysicsSystem_GetNumBodies0)(_ref(PhysicsSystem)* _this) { return (int)_unref(_this)->GetNumBodies(); } DEFINE_PRIM(_I32, PhysicsSystem_GetNumBodies0, _IDL); HL_PRIM int HL_NAME(PhysicsSystem_GetNumActiveBodies1)(_ref(PhysicsSystem)* _this, int bodyType) { return (int)_unref(_this)->GetNumActiveBodies((EBodyType)bodyType); } DEFINE_PRIM(_I32, PhysicsSystem_GetNumActiveBodies1, _IDL _I32); HL_PRIM int HL_NAME(PhysicsSystem_GetNumActiveBodies0)(_ref(PhysicsSystem)* _this) { return (int)_unref(_this)->GetNumActiveBodies(EBodyType::RigidBody); } DEFINE_PRIM(_I32, PhysicsSystem_GetNumActiveBodies0, _IDL); HL_PRIM int HL_NAME(PhysicsSystem_GetMaxBodies0)(_ref(PhysicsSystem)* _this) { return (int)_unref(_this)->GetMaxBodies(); } DEFINE_PRIM(_I32, PhysicsSystem_GetMaxBodies0, _IDL); HL_PRIM _ref(BodyInterface)* HL_NAME(PhysicsSystem_GetBodyInterfaceNoLock0)(_ref(PhysicsSystem)* _this) { return &_unref(_this)->GetBodyInterfaceNoLock(); } DEFINE_PRIM(_IDL, PhysicsSystem_GetBodyInterfaceNoLock0, _IDL); // ============= Shapes ============= HL_PRIM _ref(BoxShape)* HL_NAME(BoxShape_new1)(_ref(Vec3)* halfExtent) { return alloc_ref(new BoxShape(*_unref(halfExtent)), BoxShape); } DEFINE_PRIM(_IDL, BoxShape_new1, _IDL); HL_PRIM _ref(SphereShape)* HL_NAME(SphereShape_new1)(float radius) { return alloc_ref(new SphereShape(radius), SphereShape); } DEFINE_PRIM(_IDL, SphereShape_new1, _F32); HL_PRIM _ref(CapsuleShape)* HL_NAME(CapsuleShape_new2)(float halfHeight, float radius) { return alloc_ref(new CapsuleShape(halfHeight, radius), CapsuleShape); } DEFINE_PRIM(_IDL, CapsuleShape_new2, _F32 _F32); HL_PRIM _ref(CylinderShape)* HL_NAME(CylinderShape_new2)(float halfHeight, float radius) { return alloc_ref(new CylinderShape(halfHeight, radius), CylinderShape); } DEFINE_PRIM(_IDL, CylinderShape_new2, _F32 _F32); // ============= ConvexHullShape ============= HL_PRIM _ref(ConvexHullShapeSettings)* HL_NAME(ConvexHullShapeSettings_new)() { return alloc_ref(new ConvexHullShapeSettings(), ConvexHullShapeSettings); } DEFINE_PRIM(_IDL, ConvexHullShapeSettings_new, _NO_ARG); HL_PRIM void HL_NAME(ConvexHullShapeSettings_delete)(_ref(ConvexHullShapeSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, ConvexHullShapeSettings_delete, _IDL); HL_PRIM void HL_NAME(ConvexHullShapeSettings_AddPoint)(_ref(ConvexHullShapeSettings)* _this, float x, float y, float z) { _unref(_this)->mPoints.push_back(Vec3(x, y, z)); } DEFINE_PRIM(_VOID, ConvexHullShapeSettings_AddPoint, _IDL _F32 _F32 _F32); HL_PRIM _ref(Shape)* HL_NAME(ConvexHullShapeSettings_Create)(_ref(ConvexHullShapeSettings)* _this) { auto result = _unref(_this)->Create(); if (result.HasError()) { return nullptr; } Shape* shape = const_cast(result.Get().GetPtr()); shape->AddRef(); return shape; } DEFINE_PRIM(_IDL, ConvexHullShapeSettings_Create, _IDL); // ============= MeshShape ============= HL_PRIM _ref(MeshShapeSettings)* HL_NAME(MeshShapeSettings_new)() { return alloc_ref(new MeshShapeSettings(), MeshShapeSettings); } DEFINE_PRIM(_IDL, MeshShapeSettings_new, _NO_ARG); HL_PRIM void HL_NAME(MeshShapeSettings_delete)(_ref(MeshShapeSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, MeshShapeSettings_delete, _IDL); HL_PRIM void HL_NAME(MeshShapeSettings_AddVertex)(_ref(MeshShapeSettings)* _this, float x, float y, float z) { _unref(_this)->mTriangleVertices.push_back(Float3(x, y, z)); } DEFINE_PRIM(_VOID, MeshShapeSettings_AddVertex, _IDL _F32 _F32 _F32); HL_PRIM void HL_NAME(MeshShapeSettings_AddTriangle)(_ref(MeshShapeSettings)* _this, int i0, int i1, int i2) { IndexedTriangle tri; tri.mIdx[0] = i0; tri.mIdx[1] = i1; tri.mIdx[2] = i2; tri.mMaterialIndex = 0; _unref(_this)->mIndexedTriangles.push_back(tri); } DEFINE_PRIM(_VOID, MeshShapeSettings_AddTriangle, _IDL _I32 _I32 _I32); HL_PRIM _ref(Shape)* HL_NAME(MeshShapeSettings_Create)(_ref(MeshShapeSettings)* _this) { auto result = _unref(_this)->Create(); if (result.HasError()) { return nullptr; } Shape* shape = const_cast(result.Get().GetPtr()); shape->AddRef(); return shape; } DEFINE_PRIM(_IDL, MeshShapeSettings_Create, _IDL); // ============= HeightFieldShape ============= HL_PRIM _ref(HeightFieldShapeSettings)* HL_NAME(HeightFieldShapeSettings_new)(int sampleCount) { auto settings = new HeightFieldShapeSettings(); settings->mSampleCount = sampleCount; settings->mHeightSamples.resize(sampleCount * sampleCount); return alloc_ref(settings, HeightFieldShapeSettings); } DEFINE_PRIM(_IDL, HeightFieldShapeSettings_new, _I32); HL_PRIM void HL_NAME(HeightFieldShapeSettings_delete)(_ref(HeightFieldShapeSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, HeightFieldShapeSettings_delete, _IDL); HL_PRIM void HL_NAME(HeightFieldShapeSettings_SetHeight)(_ref(HeightFieldShapeSettings)* _this, int x, int y, float height) { int sampleCount = _unref(_this)->mSampleCount; if (x >= 0 && x < sampleCount && y >= 0 && y < sampleCount) { _unref(_this)->mHeightSamples[y * sampleCount + x] = height; } } DEFINE_PRIM(_VOID, HeightFieldShapeSettings_SetHeight, _IDL _I32 _I32 _F32); HL_PRIM void HL_NAME(HeightFieldShapeSettings_SetOffset)(_ref(HeightFieldShapeSettings)* _this, float x, float y, float z) { _unref(_this)->mOffset = Vec3(x, y, z); } DEFINE_PRIM(_VOID, HeightFieldShapeSettings_SetOffset, _IDL _F32 _F32 _F32); HL_PRIM void HL_NAME(HeightFieldShapeSettings_SetScale)(_ref(HeightFieldShapeSettings)* _this, float x, float y, float z) { _unref(_this)->mScale = Vec3(x, y, z); } DEFINE_PRIM(_VOID, HeightFieldShapeSettings_SetScale, _IDL _F32 _F32 _F32); HL_PRIM _ref(Shape)* HL_NAME(HeightFieldShapeSettings_Create)(_ref(HeightFieldShapeSettings)* _this) { auto result = _unref(_this)->Create(); if (result.HasError()) { return nullptr; } Shape* shape = const_cast(result.Get().GetPtr()); shape->AddRef(); return shape; } DEFINE_PRIM(_IDL, HeightFieldShapeSettings_Create, _IDL); // ============= BodyCreationSettings ============= HL_PRIM _ref(BodyCreationSettings)* HL_NAME(BodyCreationSettings_new5)( _ref(Shape)* shape, _ref(RVec3)* position, _ref(Quat)* rotation, int motionType, int objectLayer) { return alloc_ref(new BodyCreationSettings( _unref(shape), *_unref(position), *_unref(rotation), (EMotionType)motionType, (ObjectLayer)objectLayer ), BodyCreationSettings); } DEFINE_PRIM(_IDL, BodyCreationSettings_new5, _IDL _IDL _IDL _I32 _I32); HL_PRIM void HL_NAME(BodyCreationSettings_delete)(_ref(BodyCreationSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, BodyCreationSettings_delete, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mFriction)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mFriction = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mFriction, _IDL _F32); HL_PRIM void HL_NAME(BodyCreationSettings_set_mRestitution)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mRestitution = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mRestitution, _IDL _F32); HL_PRIM void HL_NAME(BodyCreationSettings_set_mLinearDamping)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mLinearDamping = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mLinearDamping, _IDL _F32); HL_PRIM void HL_NAME(BodyCreationSettings_set_mAngularDamping)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mAngularDamping = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mAngularDamping, _IDL _F32); HL_PRIM void HL_NAME(BodyCreationSettings_set_mGravityFactor)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mGravityFactor = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mGravityFactor, _IDL _F32); HL_PRIM float HL_NAME(BodyCreationSettings_get_mFriction)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mFriction; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mFriction, _IDL); HL_PRIM float HL_NAME(BodyCreationSettings_get_mRestitution)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mRestitution; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mRestitution, _IDL); HL_PRIM float HL_NAME(BodyCreationSettings_get_mLinearDamping)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mLinearDamping; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mLinearDamping, _IDL); HL_PRIM float HL_NAME(BodyCreationSettings_get_mAngularDamping)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mAngularDamping; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mAngularDamping, _IDL); HL_PRIM float HL_NAME(BodyCreationSettings_get_mGravityFactor)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mGravityFactor; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mGravityFactor, _IDL); HL_PRIM float HL_NAME(BodyCreationSettings_get_mMaxLinearVelocity)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mMaxLinearVelocity; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mMaxLinearVelocity, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mMaxLinearVelocity)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mMaxLinearVelocity = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mMaxLinearVelocity, _IDL _F32); HL_PRIM float HL_NAME(BodyCreationSettings_get_mMaxAngularVelocity)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mMaxAngularVelocity; } DEFINE_PRIM(_F32, BodyCreationSettings_get_mMaxAngularVelocity, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mMaxAngularVelocity)(_ref(BodyCreationSettings)* _this, float value) { _unref(_this)->mMaxAngularVelocity = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mMaxAngularVelocity, _IDL _F32); HL_PRIM bool HL_NAME(BodyCreationSettings_get_mAllowSleeping)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mAllowSleeping; } DEFINE_PRIM(_BOOL, BodyCreationSettings_get_mAllowSleeping, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mAllowSleeping)(_ref(BodyCreationSettings)* _this, bool value) { _unref(_this)->mAllowSleeping = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mAllowSleeping, _IDL _BOOL); HL_PRIM bool HL_NAME(BodyCreationSettings_get_mIsSensor)(_ref(BodyCreationSettings)* _this) { return _unref(_this)->mIsSensor; } DEFINE_PRIM(_BOOL, BodyCreationSettings_get_mIsSensor, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mIsSensor)(_ref(BodyCreationSettings)* _this, bool value) { _unref(_this)->mIsSensor = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mIsSensor, _IDL _BOOL); // ============= BodyInterface ============= HL_PRIM _ref(Body)* HL_NAME(BodyInterface_CreateBody1)(_ref(BodyInterface)* _this, _ref(BodyCreationSettings)* settings) { return _unref(_this)->CreateBody(*_unref(settings)); } DEFINE_PRIM(_IDL, BodyInterface_CreateBody1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddBody2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, int activation) { _unref(_this)->AddBody(*_unref(bodyId), (EActivation)activation); } DEFINE_PRIM(_VOID, BodyInterface_AddBody2, _IDL _IDL _I32); HL_PRIM void HL_NAME(BodyInterface_RemoveBody1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { _unref(_this)->RemoveBody(*_unref(bodyId)); } DEFINE_PRIM(_VOID, BodyInterface_RemoveBody1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_DestroyBody1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { _unref(_this)->DestroyBody(*_unref(bodyId)); } DEFINE_PRIM(_VOID, BodyInterface_DestroyBody1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_ActivateBody1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { _unref(_this)->ActivateBody(*_unref(bodyId)); } DEFINE_PRIM(_VOID, BodyInterface_ActivateBody1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_DeactivateBody1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { _unref(_this)->DeactivateBody(*_unref(bodyId)); } DEFINE_PRIM(_VOID, BodyInterface_DeactivateBody1, _IDL _IDL); HL_PRIM bool HL_NAME(BodyInterface_IsActive1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return _unref(_this)->IsActive(*_unref(bodyId)); } DEFINE_PRIM(_BOOL, BodyInterface_IsActive1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(BodyInterface_GetPosition1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { RVec3 pos = _unref(_this)->GetPosition(*_unref(bodyId)); return alloc_ref(new RVec3(pos), RVec3); } DEFINE_PRIM(_IDL, BodyInterface_GetPosition1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetPosition3)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(RVec3)* position, int activation) { _unref(_this)->SetPosition(*_unref(bodyId), *_unref(position), (EActivation)activation); } DEFINE_PRIM(_VOID, BodyInterface_SetPosition3, _IDL _IDL _IDL _I32); HL_PRIM _ref(Quat)* HL_NAME(BodyInterface_GetRotation1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { Quat rot = _unref(_this)->GetRotation(*_unref(bodyId)); return alloc_ref(new Quat(rot), Quat); } DEFINE_PRIM(_IDL, BodyInterface_GetRotation1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetRotation3)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Quat)* rotation, int activation) { _unref(_this)->SetRotation(*_unref(bodyId), *_unref(rotation), (EActivation)activation); } DEFINE_PRIM(_VOID, BodyInterface_SetRotation3, _IDL _IDL _IDL _I32); HL_PRIM _ref(Vec3)* HL_NAME(BodyInterface_GetLinearVelocity1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { Vec3 vel = _unref(_this)->GetLinearVelocity(*_unref(bodyId)); return alloc_ref(new Vec3(vel), Vec3); } DEFINE_PRIM(_IDL, BodyInterface_GetLinearVelocity1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetLinearVelocity2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* velocity) { _unref(_this)->SetLinearVelocity(*_unref(bodyId), *_unref(velocity)); } DEFINE_PRIM(_VOID, BodyInterface_SetLinearVelocity2, _IDL _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(BodyInterface_GetAngularVelocity1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { Vec3 vel = _unref(_this)->GetAngularVelocity(*_unref(bodyId)); return alloc_ref(new Vec3(vel), Vec3); } DEFINE_PRIM(_IDL, BodyInterface_GetAngularVelocity1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetAngularVelocity2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* velocity) { _unref(_this)->SetAngularVelocity(*_unref(bodyId), *_unref(velocity)); } DEFINE_PRIM(_VOID, BodyInterface_SetAngularVelocity2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddForce2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* force) { _unref(_this)->AddForce(*_unref(bodyId), *_unref(force)); } DEFINE_PRIM(_VOID, BodyInterface_AddForce2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddTorque2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* torque) { _unref(_this)->AddTorque(*_unref(bodyId), *_unref(torque)); } DEFINE_PRIM(_VOID, BodyInterface_AddTorque2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddImpulse2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* impulse) { _unref(_this)->AddImpulse(*_unref(bodyId), *_unref(impulse)); } DEFINE_PRIM(_VOID, BodyInterface_AddImpulse2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddAngularImpulse2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* impulse) { _unref(_this)->AddAngularImpulse(*_unref(bodyId), *_unref(impulse)); } DEFINE_PRIM(_VOID, BodyInterface_AddAngularImpulse2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetFriction2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, float friction) { _unref(_this)->SetFriction(*_unref(bodyId), friction); } DEFINE_PRIM(_VOID, BodyInterface_SetFriction2, _IDL _IDL _F32); HL_PRIM float HL_NAME(BodyInterface_GetFriction1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return _unref(_this)->GetFriction(*_unref(bodyId)); } DEFINE_PRIM(_F32, BodyInterface_GetFriction1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetRestitution2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, float restitution) { _unref(_this)->SetRestitution(*_unref(bodyId), restitution); } DEFINE_PRIM(_VOID, BodyInterface_SetRestitution2, _IDL _IDL _F32); HL_PRIM float HL_NAME(BodyInterface_GetRestitution1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return _unref(_this)->GetRestitution(*_unref(bodyId)); } DEFINE_PRIM(_F32, BodyInterface_GetRestitution1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetGravityFactor2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, float factor) { _unref(_this)->SetGravityFactor(*_unref(bodyId), factor); } DEFINE_PRIM(_VOID, BodyInterface_SetGravityFactor2, _IDL _IDL _F32); HL_PRIM float HL_NAME(BodyInterface_GetGravityFactor1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return _unref(_this)->GetGravityFactor(*_unref(bodyId)); } DEFINE_PRIM(_F32, BodyInterface_GetGravityFactor1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddForceAtPosition3)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* force, _ref(RVec3)* position) { _unref(_this)->AddForce(*_unref(bodyId), *_unref(force), *_unref(position)); } DEFINE_PRIM(_VOID, BodyInterface_AddForceAtPosition3, _IDL _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddImpulseAtPosition3)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* impulse, _ref(RVec3)* position) { _unref(_this)->AddImpulse(*_unref(bodyId), *_unref(impulse), *_unref(position)); } DEFINE_PRIM(_VOID, BodyInterface_AddImpulseAtPosition3, _IDL _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddLinearVelocity2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* velocity) { _unref(_this)->AddLinearVelocity(*_unref(bodyId), *_unref(velocity)); } DEFINE_PRIM(_VOID, BodyInterface_AddLinearVelocity2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_AddLinearAndAngularVelocity3)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Vec3)* linearVelocity, _ref(Vec3)* angularVelocity) { _unref(_this)->AddLinearAndAngularVelocity(*_unref(bodyId), *_unref(linearVelocity), *_unref(angularVelocity)); } DEFINE_PRIM(_VOID, BodyInterface_AddLinearAndAngularVelocity3, _IDL _IDL _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(BodyInterface_GetCenterOfMassPosition1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { RVec3 pos = _unref(_this)->GetCenterOfMassPosition(*_unref(bodyId)); return alloc_ref(new RVec3(pos), RVec3); } DEFINE_PRIM(_IDL, BodyInterface_GetCenterOfMassPosition1, _IDL _IDL); HL_PRIM int HL_NAME(BodyInterface_GetMotionType1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return (int)_unref(_this)->GetMotionType(*_unref(bodyId)); } DEFINE_PRIM(_I32, BodyInterface_GetMotionType1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetMotionType3)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, int motionType, int activation) { _unref(_this)->SetMotionType(*_unref(bodyId), (EMotionType)motionType, (EActivation)activation); } DEFINE_PRIM(_VOID, BodyInterface_SetMotionType3, _IDL _IDL _I32 _I32); HL_PRIM _ref(Shape)* HL_NAME(BodyInterface_GetShape1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return const_cast(_unref(_this)->GetShape(*_unref(bodyId)).GetPtr()); } DEFINE_PRIM(_IDL, BodyInterface_GetShape1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetShape4)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(Shape)* shape, bool updateMassProperties, int activation) { _unref(_this)->SetShape(*_unref(bodyId), _unref(shape), updateMassProperties, (EActivation)activation); } DEFINE_PRIM(_VOID, BodyInterface_SetShape4, _IDL _IDL _IDL _BOOL _I32); HL_PRIM bool HL_NAME(BodyInterface_IsAdded1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return _unref(_this)->IsAdded(*_unref(bodyId)); } DEFINE_PRIM(_BOOL, BodyInterface_IsAdded1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetPositionAndRotation4)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(RVec3)* position, _ref(Quat)* rotation, int activation) { _unref(_this)->SetPositionAndRotation(*_unref(bodyId), *_unref(position), *_unref(rotation), (EActivation)activation); } DEFINE_PRIM(_VOID, BodyInterface_SetPositionAndRotation4, _IDL _IDL _IDL _IDL _I32); HL_PRIM void HL_NAME(BodyInterface_MoveKinematic4)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, _ref(RVec3)* targetPosition, _ref(Quat)* targetRotation, float deltaTime) { _unref(_this)->MoveKinematic(*_unref(bodyId), *_unref(targetPosition), *_unref(targetRotation), deltaTime); } DEFINE_PRIM(_VOID, BodyInterface_MoveKinematic4, _IDL _IDL _IDL _IDL _F32); HL_PRIM int HL_NAME(BodyInterface_GetUserData1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { return (int)_unref(_this)->GetUserData(*_unref(bodyId)); } DEFINE_PRIM(_I32, BodyInterface_GetUserData1, _IDL _IDL); HL_PRIM void HL_NAME(BodyInterface_SetUserData2)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId, int userData) { _unref(_this)->SetUserData(*_unref(bodyId), (uint64)userData); } DEFINE_PRIM(_VOID, BodyInterface_SetUserData2, _IDL _IDL _I32); HL_PRIM void HL_NAME(BodyInterface_delete)(_ref(BodyInterface)* _this) { } DEFINE_PRIM(_VOID, BodyInterface_delete, _IDL); // ============= Body ============= HL_PRIM _ref(BodyID)* HL_NAME(Body_GetID0)(_ref(Body)* _this) { return alloc_ref(new BodyID(_unref(_this)->GetID()), BodyID); } DEFINE_PRIM(_IDL, Body_GetID0, _IDL); HL_PRIM bool HL_NAME(Body_IsActive0)(_ref(Body)* _this) { return _unref(_this)->IsActive(); } DEFINE_PRIM(_BOOL, Body_IsActive0, _IDL); HL_PRIM bool HL_NAME(Body_IsStatic0)(_ref(Body)* _this) { return _unref(_this)->IsStatic(); } DEFINE_PRIM(_BOOL, Body_IsStatic0, _IDL); HL_PRIM bool HL_NAME(Body_IsDynamic0)(_ref(Body)* _this) { return _unref(_this)->IsDynamic(); } DEFINE_PRIM(_BOOL, Body_IsDynamic0, _IDL); HL_PRIM bool HL_NAME(Body_IsKinematic0)(_ref(Body)* _this) { return _unref(_this)->IsKinematic(); } DEFINE_PRIM(_BOOL, Body_IsKinematic0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Body_GetLinearVelocity0)(_ref(Body)* _this) { Vec3 vel = _unref(_this)->GetLinearVelocity(); return alloc_ref(new Vec3(vel), Vec3); } DEFINE_PRIM(_IDL, Body_GetLinearVelocity0, _IDL); HL_PRIM void HL_NAME(Body_SetLinearVelocity1)(_ref(Body)* _this, _ref(Vec3)* velocity) { _unref(_this)->SetLinearVelocity(*_unref(velocity)); } DEFINE_PRIM(_VOID, Body_SetLinearVelocity1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Body_GetAngularVelocity0)(_ref(Body)* _this) { Vec3 vel = _unref(_this)->GetAngularVelocity(); return alloc_ref(new Vec3(vel), Vec3); } DEFINE_PRIM(_IDL, Body_GetAngularVelocity0, _IDL); HL_PRIM void HL_NAME(Body_SetAngularVelocity1)(_ref(Body)* _this, _ref(Vec3)* velocity) { _unref(_this)->SetAngularVelocity(*_unref(velocity)); } DEFINE_PRIM(_VOID, Body_SetAngularVelocity1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(Body_GetPosition0)(_ref(Body)* _this) { RVec3 pos = _unref(_this)->GetPosition(); return alloc_ref(new RVec3(pos), RVec3); } DEFINE_PRIM(_IDL, Body_GetPosition0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Body_GetRotation0)(_ref(Body)* _this) { Quat rot = _unref(_this)->GetRotation(); return alloc_ref(new Quat(rot), Quat); } DEFINE_PRIM(_IDL, Body_GetRotation0, _IDL); HL_PRIM _ref(RVec3)* HL_NAME(Body_GetCenterOfMassPosition0)(_ref(Body)* _this) { RVec3 pos = _unref(_this)->GetCenterOfMassPosition(); return alloc_ref(new RVec3(pos), RVec3); } DEFINE_PRIM(_IDL, Body_GetCenterOfMassPosition0, _IDL); HL_PRIM void HL_NAME(Body_AddForce1)(_ref(Body)* _this, _ref(Vec3)* force) { _unref(_this)->AddForce(*_unref(force)); } DEFINE_PRIM(_VOID, Body_AddForce1, _IDL _IDL); HL_PRIM void HL_NAME(Body_AddForceAtPosition2)(_ref(Body)* _this, _ref(Vec3)* force, _ref(RVec3)* position) { _unref(_this)->AddForce(*_unref(force), *_unref(position)); } DEFINE_PRIM(_VOID, Body_AddForceAtPosition2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(Body_AddTorque1)(_ref(Body)* _this, _ref(Vec3)* torque) { _unref(_this)->AddTorque(*_unref(torque)); } DEFINE_PRIM(_VOID, Body_AddTorque1, _IDL _IDL); HL_PRIM void HL_NAME(Body_AddImpulse1)(_ref(Body)* _this, _ref(Vec3)* impulse) { _unref(_this)->AddImpulse(*_unref(impulse)); } DEFINE_PRIM(_VOID, Body_AddImpulse1, _IDL _IDL); HL_PRIM void HL_NAME(Body_AddImpulseAtPosition2)(_ref(Body)* _this, _ref(Vec3)* impulse, _ref(RVec3)* position) { _unref(_this)->AddImpulse(*_unref(impulse), *_unref(position)); } DEFINE_PRIM(_VOID, Body_AddImpulseAtPosition2, _IDL _IDL _IDL); HL_PRIM void HL_NAME(Body_AddAngularImpulse1)(_ref(Body)* _this, _ref(Vec3)* impulse) { _unref(_this)->AddAngularImpulse(*_unref(impulse)); } DEFINE_PRIM(_VOID, Body_AddAngularImpulse1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Body_GetAccumulatedForce0)(_ref(Body)* _this) { Vec3 force = _unref(_this)->GetAccumulatedForce(); return alloc_ref(new Vec3(force), Vec3); } DEFINE_PRIM(_IDL, Body_GetAccumulatedForce0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Body_GetAccumulatedTorque0)(_ref(Body)* _this) { Vec3 torque = _unref(_this)->GetAccumulatedTorque(); return alloc_ref(new Vec3(torque), Vec3); } DEFINE_PRIM(_IDL, Body_GetAccumulatedTorque0, _IDL); HL_PRIM float HL_NAME(Body_GetFriction0)(_ref(Body)* _this) { return _unref(_this)->GetFriction(); } DEFINE_PRIM(_F32, Body_GetFriction0, _IDL); HL_PRIM void HL_NAME(Body_SetFriction1)(_ref(Body)* _this, float friction) { _unref(_this)->SetFriction(friction); } DEFINE_PRIM(_VOID, Body_SetFriction1, _IDL _F32); HL_PRIM float HL_NAME(Body_GetRestitution0)(_ref(Body)* _this) { return _unref(_this)->GetRestitution(); } DEFINE_PRIM(_F32, Body_GetRestitution0, _IDL); HL_PRIM void HL_NAME(Body_SetRestitution1)(_ref(Body)* _this, float restitution) { _unref(_this)->SetRestitution(restitution); } DEFINE_PRIM(_VOID, Body_SetRestitution1, _IDL _F32); HL_PRIM int HL_NAME(Body_GetMotionType0)(_ref(Body)* _this) { return (int)_unref(_this)->GetMotionType(); } DEFINE_PRIM(_I32, Body_GetMotionType0, _IDL); HL_PRIM void HL_NAME(Body_SetMotionType1)(_ref(Body)* _this, int motionType) { _unref(_this)->SetMotionType((EMotionType)motionType); } DEFINE_PRIM(_VOID, Body_SetMotionType1, _IDL _I32); HL_PRIM bool HL_NAME(Body_IsSensor0)(_ref(Body)* _this) { return _unref(_this)->IsSensor(); } DEFINE_PRIM(_BOOL, Body_IsSensor0, _IDL); HL_PRIM void HL_NAME(Body_SetIsSensor1)(_ref(Body)* _this, bool isSensor) { _unref(_this)->SetIsSensor(isSensor); } DEFINE_PRIM(_VOID, Body_SetIsSensor1, _IDL _BOOL); HL_PRIM int HL_NAME(Body_GetUserData0)(_ref(Body)* _this) { return (int)_unref(_this)->GetUserData(); } DEFINE_PRIM(_I32, Body_GetUserData0, _IDL); HL_PRIM void HL_NAME(Body_SetUserData1)(_ref(Body)* _this, int userData) { _unref(_this)->SetUserData((uint64)userData); } DEFINE_PRIM(_VOID, Body_SetUserData1, _IDL _I32); HL_PRIM _ref(Shape)* HL_NAME(Body_GetShape0)(_ref(Body)* _this) { return const_cast(_unref(_this)->GetShape()); } DEFINE_PRIM(_IDL, Body_GetShape0, _IDL); HL_PRIM void HL_NAME(Body_delete)(_ref(Body)* _this) { } DEFINE_PRIM(_VOID, Body_delete, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Body_GetPointVelocity1)(_ref(Body)* _this, _ref(RVec3)* point) { Vec3 vel = _unref(_this)->GetPointVelocity(*_unref(point)); return alloc_ref(new Vec3(vel), Vec3); } DEFINE_PRIM(_IDL, Body_GetPointVelocity1, _IDL _IDL); HL_PRIM void HL_NAME(Body_MoveKinematic3)(_ref(Body)* _this, _ref(RVec3)* targetPosition, _ref(Quat)* targetRotation, float deltaTime) { _unref(_this)->MoveKinematic(*_unref(targetPosition), *_unref(targetRotation), deltaTime); } DEFINE_PRIM(_VOID, Body_MoveKinematic3, _IDL _IDL _IDL _F32); HL_PRIM void HL_NAME(Body_ResetForce0)(_ref(Body)* _this) { _unref(_this)->ResetForce(); } DEFINE_PRIM(_VOID, Body_ResetForce0, _IDL); HL_PRIM void HL_NAME(Body_ResetTorque0)(_ref(Body)* _this) { _unref(_this)->ResetTorque(); } DEFINE_PRIM(_VOID, Body_ResetTorque0, _IDL); HL_PRIM void HL_NAME(Body_ResetMotion0)(_ref(Body)* _this) { _unref(_this)->ResetMotion(); } DEFINE_PRIM(_VOID, Body_ResetMotion0, _IDL); HL_PRIM void HL_NAME(Body_SetLinearVelocityClamped1)(_ref(Body)* _this, _ref(Vec3)* velocity) { _unref(_this)->SetLinearVelocityClamped(*_unref(velocity)); } DEFINE_PRIM(_VOID, Body_SetLinearVelocityClamped1, _IDL _IDL); HL_PRIM void HL_NAME(Body_SetAngularVelocityClamped1)(_ref(Body)* _this, _ref(Vec3)* velocity) { _unref(_this)->SetAngularVelocityClamped(*_unref(velocity)); } DEFINE_PRIM(_VOID, Body_SetAngularVelocityClamped1, _IDL _IDL); // ============= BodyID ============= HL_PRIM _ref(BodyID)* HL_NAME(BodyID_new0)() { return alloc_ref(new BodyID(), BodyID); } DEFINE_PRIM(_IDL, BodyID_new0, _NO_ARG); HL_PRIM void HL_NAME(BodyID_delete)(_ref(BodyID)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, BodyID_delete, _IDL); HL_PRIM int HL_NAME(BodyID_GetIndex0)(_ref(BodyID)* _this) { return (int)_unref(_this)->GetIndex(); } DEFINE_PRIM(_I32, BodyID_GetIndex0, _IDL); HL_PRIM bool HL_NAME(BodyID_IsInvalid0)(_ref(BodyID)* _this) { return _unref(_this)->IsInvalid(); } DEFINE_PRIM(_BOOL, BodyID_IsInvalid0, _IDL); HL_PRIM int HL_NAME(BodyID_GetSequenceNumber0)(_ref(BodyID)* _this) { return (int)_unref(_this)->GetSequenceNumber(); } DEFINE_PRIM(_I32, BodyID_GetSequenceNumber0, _IDL); // ============= Mat44 / RMat44 ============= HL_PRIM _ref(RMat44)* HL_NAME(BodyInterface_GetWorldTransform1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { RMat44 transform = _unref(_this)->GetWorldTransform(*_unref(bodyId)); return alloc_ref(new RMat44(transform), RMat44); } DEFINE_PRIM(_IDL, BodyInterface_GetWorldTransform1, _IDL _IDL); HL_PRIM _ref(RMat44)* HL_NAME(BodyInterface_GetCenterOfMassTransform1)(_ref(BodyInterface)* _this, _ref(BodyID)* bodyId) { RMat44 transform = _unref(_this)->GetCenterOfMassTransform(*_unref(bodyId)); return alloc_ref(new RMat44(transform), RMat44); } DEFINE_PRIM(_IDL, BodyInterface_GetCenterOfMassTransform1, _IDL _IDL); HL_PRIM _ref(RMat44)* HL_NAME(Body_GetWorldTransform0)(_ref(Body)* _this) { RMat44 transform = _unref(_this)->GetWorldTransform(); return alloc_ref(new RMat44(transform), RMat44); } DEFINE_PRIM(_IDL, Body_GetWorldTransform0, _IDL); HL_PRIM _ref(RMat44)* HL_NAME(Body_GetCenterOfMassTransform0)(_ref(Body)* _this) { RMat44 transform = _unref(_this)->GetCenterOfMassTransform(); return alloc_ref(new RMat44(transform), RMat44); } DEFINE_PRIM(_IDL, Body_GetCenterOfMassTransform0, _IDL); HL_PRIM _ref(RMat44)* HL_NAME(RMat44_new0)() { return alloc_ref(new RMat44(RMat44::sIdentity()), RMat44); } DEFINE_PRIM(_IDL, RMat44_new0, _NO_ARG); HL_PRIM void HL_NAME(RMat44_delete)(_ref(RMat44)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, RMat44_delete, _IDL); HL_PRIM _ref(RVec3)* HL_NAME(RMat44_GetTranslation0)(_ref(RMat44)* _this) { RVec3 trans = _unref(_this)->GetTranslation(); return alloc_ref(new RVec3(trans), RVec3); } DEFINE_PRIM(_IDL, RMat44_GetTranslation0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(RMat44_GetQuaternion0)(_ref(RMat44)* _this) { Quat quat = _unref(_this)->GetQuaternion(); return alloc_ref(new Quat(quat), Quat); } DEFINE_PRIM(_IDL, RMat44_GetQuaternion0, _IDL); // ============= Mat44 ============= HL_PRIM _ref(Mat44)* HL_NAME(Mat44_new0)() { return alloc_ref(new Mat44(Mat44::sIdentity()), Mat44); } DEFINE_PRIM(_IDL, Mat44_new0, _NO_ARG); HL_PRIM void HL_NAME(Mat44_delete)(_ref(Mat44)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, Mat44_delete, _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_sIdentity0)() { return alloc_ref(new Mat44(Mat44::sIdentity()), Mat44); } DEFINE_PRIM(_IDL, Mat44_sIdentity0, _NO_ARG); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_sZeroM0)() { return alloc_ref(new Mat44(Mat44::sZero()), Mat44); } DEFINE_PRIM(_IDL, Mat44_sZeroM0, _NO_ARG); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_sRotation1)(_ref(Quat)* rotation) { return alloc_ref(new Mat44(Mat44::sRotation(*_unref(rotation))), Mat44); } DEFINE_PRIM(_IDL, Mat44_sRotation1, _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_sTranslation1)(_ref(Vec3)* translation) { return alloc_ref(new Mat44(Mat44::sTranslation(*_unref(translation))), Mat44); } DEFINE_PRIM(_IDL, Mat44_sTranslation1, _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_sRotationTranslation2)(_ref(Quat)* rotation, _ref(Vec3)* translation) { return alloc_ref(new Mat44(Mat44::sRotationTranslation(*_unref(rotation), *_unref(translation))), Mat44); } DEFINE_PRIM(_IDL, Mat44_sRotationTranslation2, _IDL _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_sScale1)(float scale) { return alloc_ref(new Mat44(Mat44::sScale(scale)), Mat44); } DEFINE_PRIM(_IDL, Mat44_sScale1, _F32); HL_PRIM _ref(Vec3)* HL_NAME(Mat44_GetTranslation0)(_ref(Mat44)* _this) { Vec3 trans = _unref(_this)->GetTranslation(); return alloc_ref(new Vec3(trans), Vec3); } DEFINE_PRIM(_IDL, Mat44_GetTranslation0, _IDL); HL_PRIM _ref(Quat)* HL_NAME(Mat44_GetQuaternion0)(_ref(Mat44)* _this) { Quat quat = _unref(_this)->GetQuaternion(); return alloc_ref(new Quat(quat), Quat); } DEFINE_PRIM(_IDL, Mat44_GetQuaternion0, _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_GetRotation0)(_ref(Mat44)* _this) { Mat44 rot = _unref(_this)->GetRotation(); return alloc_ref(new Mat44(rot), Mat44); } DEFINE_PRIM(_IDL, Mat44_GetRotation0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Mat44_GetAxisX0)(_ref(Mat44)* _this) { Vec3 axis = _unref(_this)->GetAxisX(); return alloc_ref(new Vec3(axis), Vec3); } DEFINE_PRIM(_IDL, Mat44_GetAxisX0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Mat44_GetAxisY0)(_ref(Mat44)* _this) { Vec3 axis = _unref(_this)->GetAxisY(); return alloc_ref(new Vec3(axis), Vec3); } DEFINE_PRIM(_IDL, Mat44_GetAxisY0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Mat44_GetAxisZ0)(_ref(Mat44)* _this) { Vec3 axis = _unref(_this)->GetAxisZ(); return alloc_ref(new Vec3(axis), Vec3); } DEFINE_PRIM(_IDL, Mat44_GetAxisZ0, _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_Inversed0)(_ref(Mat44)* _this) { Mat44 inv = _unref(_this)->Inversed(); return alloc_ref(new Mat44(inv), Mat44); } DEFINE_PRIM(_IDL, Mat44_Inversed0, _IDL); HL_PRIM _ref(Mat44)* HL_NAME(Mat44_MulMat441)(_ref(Mat44)* _this, _ref(Mat44)* other) { Mat44 result = *_unref(_this) * *_unref(other); return alloc_ref(new Mat44(result), Mat44); } DEFINE_PRIM(_IDL, Mat44_MulMat441, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Mat44_MulVec31)(_ref(Mat44)* _this, _ref(Vec3)* v) { Vec3 result = *_unref(_this) * *_unref(v); return alloc_ref(new Vec3(result), Vec3); } DEFINE_PRIM(_IDL, Mat44_MulVec31, _IDL _IDL); // ============= Shape methods ============= HL_PRIM void HL_NAME(BoxShape_delete)(_ref(BoxShape)* _this) { // Shapes are ref-counted, don't delete directly } DEFINE_PRIM(_VOID, BoxShape_delete, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(BoxShape_GetHalfExtent0)(_ref(BoxShape)* _this) { Vec3 ext = _unref(_this)->GetHalfExtent(); return alloc_ref(new Vec3(ext), Vec3); } DEFINE_PRIM(_IDL, BoxShape_GetHalfExtent0, _IDL); HL_PRIM void HL_NAME(SphereShape_delete)(_ref(SphereShape)* _this) { } DEFINE_PRIM(_VOID, SphereShape_delete, _IDL); HL_PRIM float HL_NAME(SphereShape_GetRadius0)(_ref(SphereShape)* _this) { return _unref(_this)->GetRadius(); } DEFINE_PRIM(_F32, SphereShape_GetRadius0, _IDL); HL_PRIM void HL_NAME(CapsuleShape_delete)(_ref(CapsuleShape)* _this) { } DEFINE_PRIM(_VOID, CapsuleShape_delete, _IDL); HL_PRIM float HL_NAME(CapsuleShape_GetRadius0)(_ref(CapsuleShape)* _this) { return _unref(_this)->GetRadius(); } DEFINE_PRIM(_F32, CapsuleShape_GetRadius0, _IDL); HL_PRIM float HL_NAME(CapsuleShape_GetHalfHeightOfCylinder0)(_ref(CapsuleShape)* _this) { return _unref(_this)->GetHalfHeightOfCylinder(); } DEFINE_PRIM(_F32, CapsuleShape_GetHalfHeightOfCylinder0, _IDL); HL_PRIM void HL_NAME(CylinderShape_delete)(_ref(CylinderShape)* _this) { } DEFINE_PRIM(_VOID, CylinderShape_delete, _IDL); HL_PRIM float HL_NAME(CylinderShape_GetRadius0)(_ref(CylinderShape)* _this) { return _unref(_this)->GetRadius(); } DEFINE_PRIM(_F32, CylinderShape_GetRadius0, _IDL); HL_PRIM float HL_NAME(CylinderShape_GetHalfHeight0)(_ref(CylinderShape)* _this) { return _unref(_this)->GetHalfHeight(); } DEFINE_PRIM(_F32, CylinderShape_GetHalfHeight0, _IDL); HL_PRIM void HL_NAME(Shape_delete)(_ref(Shape)* _this) { } DEFINE_PRIM(_VOID, Shape_delete, _IDL); HL_PRIM void HL_NAME(Shape_AddRef0)(_ref(Shape)* _this) { _unref(_this)->AddRef(); } DEFINE_PRIM(_VOID, Shape_AddRef0, _IDL); HL_PRIM void HL_NAME(Shape_Release0)(_ref(Shape)* _this) { _unref(_this)->Release(); } DEFINE_PRIM(_VOID, Shape_Release0, _IDL); HL_PRIM int HL_NAME(Shape_GetRefCount0)(_ref(Shape)* _this) { return (int)_unref(_this)->GetRefCount(); } DEFINE_PRIM(_I32, Shape_GetRefCount0, _IDL); HL_PRIM int HL_NAME(Shape_GetType0)(_ref(Shape)* _this) { return (int)_unref(_this)->GetType(); } DEFINE_PRIM(_I32, Shape_GetType0, _IDL); HL_PRIM int HL_NAME(Shape_GetSubType0)(_ref(Shape)* _this) { return (int)_unref(_this)->GetSubType(); } DEFINE_PRIM(_I32, Shape_GetSubType0, _IDL); HL_PRIM _ref(Vec3)* HL_NAME(Shape_GetCenterOfMass0)(_ref(Shape)* _this) { Vec3 com = _unref(_this)->GetCenterOfMass(); return alloc_ref(new Vec3(com), Vec3); } DEFINE_PRIM(_IDL, Shape_GetCenterOfMass0, _IDL); HL_PRIM float HL_NAME(Shape_GetInnerRadius0)(_ref(Shape)* _this) { return _unref(_this)->GetInnerRadius(); } DEFINE_PRIM(_F32, Shape_GetInnerRadius0, _IDL); HL_PRIM bool HL_NAME(Shape_MustBeStatic0)(_ref(Shape)* _this) { return _unref(_this)->MustBeStatic(); } DEFINE_PRIM(_BOOL, Shape_MustBeStatic0, _IDL); HL_PRIM int HL_NAME(Shape_GetUserData0)(_ref(Shape)* _this) { return (int)_unref(_this)->GetUserData(); } DEFINE_PRIM(_I32, Shape_GetUserData0, _IDL); HL_PRIM void HL_NAME(Shape_SetUserData1)(_ref(Shape)* _this, int userData) { _unref(_this)->SetUserData((uint64)userData); } DEFINE_PRIM(_VOID, Shape_SetUserData1, _IDL _I32); // ============= RRayCast ============= HL_PRIM _ref(RRayCast)* HL_NAME(RRayCast_new2)(_ref(RVec3)* origin, _ref(Vec3)* direction) { return alloc_ref(new RRayCast(*_unref(origin), *_unref(direction)), RRayCast); } DEFINE_PRIM(_IDL, RRayCast_new2, _IDL _IDL); HL_PRIM void HL_NAME(RRayCast_delete)(_ref(RRayCast)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, RRayCast_delete, _IDL); HL_PRIM _ref(RVec3)* HL_NAME(RRayCast_get_mOrigin)(_ref(RRayCast)* _this) { return alloc_ref(new RVec3(_unref(_this)->mOrigin), RVec3); } DEFINE_PRIM(_IDL, RRayCast_get_mOrigin, _IDL); HL_PRIM void HL_NAME(RRayCast_set_mOrigin)(_ref(RRayCast)* _this, _ref(RVec3)* value) { _unref(_this)->mOrigin = *_unref(value); } DEFINE_PRIM(_VOID, RRayCast_set_mOrigin, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(RRayCast_get_mDirection)(_ref(RRayCast)* _this) { return alloc_ref(new Vec3(_unref(_this)->mDirection), Vec3); } DEFINE_PRIM(_IDL, RRayCast_get_mDirection, _IDL); HL_PRIM void HL_NAME(RRayCast_set_mDirection)(_ref(RRayCast)* _this, _ref(Vec3)* value) { _unref(_this)->mDirection = *_unref(value); } DEFINE_PRIM(_VOID, RRayCast_set_mDirection, _IDL _IDL); // ============= RayCastResult ============= HL_PRIM _ref(RayCastResult)* HL_NAME(RayCastResult_new0)() { return alloc_ref(new RayCastResult(), RayCastResult); } DEFINE_PRIM(_IDL, RayCastResult_new0, _NO_ARG); HL_PRIM void HL_NAME(RayCastResult_delete)(_ref(RayCastResult)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, RayCastResult_delete, _IDL); HL_PRIM _ref(BodyID)* HL_NAME(RayCastResult_get_mBodyID)(_ref(RayCastResult)* _this) { return alloc_ref(new BodyID(_unref(_this)->mBodyID), BodyID); } DEFINE_PRIM(_IDL, RayCastResult_get_mBodyID, _IDL); HL_PRIM void HL_NAME(RayCastResult_set_mBodyID)(_ref(RayCastResult)* _this, _ref(BodyID)* value) { _unref(_this)->mBodyID = *_unref(value); } DEFINE_PRIM(_VOID, RayCastResult_set_mBodyID, _IDL _IDL); HL_PRIM float HL_NAME(RayCastResult_get_mFraction)(_ref(RayCastResult)* _this) { return _unref(_this)->mFraction; } DEFINE_PRIM(_F32, RayCastResult_get_mFraction, _IDL); HL_PRIM void HL_NAME(RayCastResult_set_mFraction)(_ref(RayCastResult)* _this, float value) { _unref(_this)->mFraction = value; } DEFINE_PRIM(_VOID, RayCastResult_set_mFraction, _IDL _F32); // ============= TwoBodyConstraint ============= HL_PRIM void HL_NAME(TwoBodyConstraint_delete)(_ref(TwoBodyConstraint)* _this) { } DEFINE_PRIM(_VOID, TwoBodyConstraint_delete, _IDL); HL_PRIM _ref(Body)* HL_NAME(TwoBodyConstraint_GetBody10)(_ref(TwoBodyConstraint)* _this) { return _unref(_this)->GetBody1(); } DEFINE_PRIM(_IDL, TwoBodyConstraint_GetBody10, _IDL); HL_PRIM _ref(Body)* HL_NAME(TwoBodyConstraint_GetBody20)(_ref(TwoBodyConstraint)* _this) { return _unref(_this)->GetBody2(); } DEFINE_PRIM(_IDL, TwoBodyConstraint_GetBody20, _IDL); // ============= Constraint ============= HL_PRIM void HL_NAME(Constraint_delete)(_ref(Constraint)* _this) { } DEFINE_PRIM(_VOID, Constraint_delete, _IDL); HL_PRIM bool HL_NAME(Constraint_GetEnabled0)(_ref(Constraint)* _this) { return _unref(_this)->GetEnabled(); } DEFINE_PRIM(_BOOL, Constraint_GetEnabled0, _IDL); HL_PRIM void HL_NAME(Constraint_SetEnabled1)(_ref(Constraint)* _this, bool enabled) { _unref(_this)->SetEnabled(enabled); } DEFINE_PRIM(_VOID, Constraint_SetEnabled1, _IDL _BOOL); HL_PRIM void HL_NAME(Constraint_AddRef0)(_ref(Constraint)* _this) { _unref(_this)->AddRef(); } DEFINE_PRIM(_VOID, Constraint_AddRef0, _IDL); HL_PRIM void HL_NAME(Constraint_Release0)(_ref(Constraint)* _this) { _unref(_this)->Release(); } DEFINE_PRIM(_VOID, Constraint_Release0, _IDL); HL_PRIM int HL_NAME(Constraint_GetRefCount0)(_ref(Constraint)* _this) { return (int)_unref(_this)->GetRefCount(); } DEFINE_PRIM(_I32, Constraint_GetRefCount0, _IDL); // ============= FixedConstraintSettings ============= HL_PRIM _ref(FixedConstraintSettings)* HL_NAME(FixedConstraintSettings_new0)() { return alloc_ref(new FixedConstraintSettings(), FixedConstraintSettings); } DEFINE_PRIM(_IDL, FixedConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(FixedConstraintSettings_delete)(_ref(FixedConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, FixedConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(FixedConstraintSettings_Create2)(_ref(FixedConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, FixedConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM bool HL_NAME(FixedConstraintSettings_get_mAutoDetectPoint)(_ref(FixedConstraintSettings)* _this) { return _unref(_this)->mAutoDetectPoint; } DEFINE_PRIM(_BOOL, FixedConstraintSettings_get_mAutoDetectPoint, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mAutoDetectPoint)(_ref(FixedConstraintSettings)* _this, bool value) { _unref(_this)->mAutoDetectPoint = value; } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mAutoDetectPoint, _IDL _BOOL); HL_PRIM int HL_NAME(FixedConstraintSettings_get_mSpace)(_ref(FixedConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, FixedConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mSpace)(_ref(FixedConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(FixedConstraintSettings_get_mPoint1)(_ref(FixedConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint1), RVec3); } DEFINE_PRIM(_IDL, FixedConstraintSettings_get_mPoint1, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mPoint1)(_ref(FixedConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint1 = *_unref(value); } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mPoint1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(FixedConstraintSettings_get_mPoint2)(_ref(FixedConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint2), RVec3); } DEFINE_PRIM(_IDL, FixedConstraintSettings_get_mPoint2, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mPoint2)(_ref(FixedConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint2 = *_unref(value); } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mPoint2, _IDL _IDL); // ============= PhysicsSystem Constraint Methods ============= HL_PRIM void HL_NAME(PhysicsSystem_AddConstraint1)(_ref(PhysicsSystem)* _this, _ref(Constraint)* constraint) { _unref(_this)->AddConstraint(_unref(constraint)); } DEFINE_PRIM(_VOID, PhysicsSystem_AddConstraint1, _IDL _IDL); HL_PRIM void HL_NAME(PhysicsSystem_RemoveConstraint1)(_ref(PhysicsSystem)* _this, _ref(Constraint)* constraint) { _unref(_this)->RemoveConstraint(_unref(constraint)); } DEFINE_PRIM(_VOID, PhysicsSystem_RemoveConstraint1, _IDL _IDL); // ============= SliderConstraintSettings ============= HL_PRIM _ref(SliderConstraintSettings)* HL_NAME(SliderConstraintSettings_new0)() { return alloc_ref(new SliderConstraintSettings(), SliderConstraintSettings); } DEFINE_PRIM(_IDL, SliderConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(SliderConstraintSettings_delete)(_ref(SliderConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, SliderConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(SliderConstraintSettings_Create2)(_ref(SliderConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, SliderConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM bool HL_NAME(SliderConstraintSettings_get_mAutoDetectPoint)(_ref(SliderConstraintSettings)* _this) { return _unref(_this)->mAutoDetectPoint; } DEFINE_PRIM(_BOOL, SliderConstraintSettings_get_mAutoDetectPoint, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mAutoDetectPoint)(_ref(SliderConstraintSettings)* _this, bool value) { _unref(_this)->mAutoDetectPoint = value; } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mAutoDetectPoint, _IDL _BOOL); HL_PRIM int HL_NAME(SliderConstraintSettings_get_mSpace)(_ref(SliderConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, SliderConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mSpace)(_ref(SliderConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(SliderConstraintSettings_get_mPoint1)(_ref(SliderConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint1), RVec3); } DEFINE_PRIM(_IDL, SliderConstraintSettings_get_mPoint1, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mPoint1)(_ref(SliderConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint1 = *_unref(value); } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mPoint1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(SliderConstraintSettings_get_mPoint2)(_ref(SliderConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint2), RVec3); } DEFINE_PRIM(_IDL, SliderConstraintSettings_get_mPoint2, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mPoint2)(_ref(SliderConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint2 = *_unref(value); } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mPoint2, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SliderConstraintSettings_get_mSliderAxis1)(_ref(SliderConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mSliderAxis1), Vec3); } DEFINE_PRIM(_IDL, SliderConstraintSettings_get_mSliderAxis1, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mSliderAxis1)(_ref(SliderConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mSliderAxis1 = *_unref(value); } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mSliderAxis1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SliderConstraintSettings_get_mSliderAxis2)(_ref(SliderConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mSliderAxis2), Vec3); } DEFINE_PRIM(_IDL, SliderConstraintSettings_get_mSliderAxis2, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mSliderAxis2)(_ref(SliderConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mSliderAxis2 = *_unref(value); } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mSliderAxis2, _IDL _IDL); HL_PRIM float HL_NAME(SliderConstraintSettings_get_mLimitsMin)(_ref(SliderConstraintSettings)* _this) { return _unref(_this)->mLimitsMin; } DEFINE_PRIM(_F32, SliderConstraintSettings_get_mLimitsMin, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mLimitsMin)(_ref(SliderConstraintSettings)* _this, float value) { _unref(_this)->mLimitsMin = value; } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mLimitsMin, _IDL _F32); HL_PRIM float HL_NAME(SliderConstraintSettings_get_mLimitsMax)(_ref(SliderConstraintSettings)* _this) { return _unref(_this)->mLimitsMax; } DEFINE_PRIM(_F32, SliderConstraintSettings_get_mLimitsMax, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mLimitsMax)(_ref(SliderConstraintSettings)* _this, float value) { _unref(_this)->mLimitsMax = value; } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mLimitsMax, _IDL _F32); HL_PRIM float HL_NAME(SliderConstraintSettings_get_mMaxFrictionForce)(_ref(SliderConstraintSettings)* _this) { return _unref(_this)->mMaxFrictionForce; } DEFINE_PRIM(_F32, SliderConstraintSettings_get_mMaxFrictionForce, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mMaxFrictionForce)(_ref(SliderConstraintSettings)* _this, float value) { _unref(_this)->mMaxFrictionForce = value; } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mMaxFrictionForce, _IDL _F32); // ============= HingeConstraintSettings ============= HL_PRIM _ref(HingeConstraintSettings)* HL_NAME(HingeConstraintSettings_new0)() { return alloc_ref(new HingeConstraintSettings(), HingeConstraintSettings); } DEFINE_PRIM(_IDL, HingeConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(HingeConstraintSettings_delete)(_ref(HingeConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, HingeConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(HingeConstraintSettings_Create2)(_ref(HingeConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, HingeConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM int HL_NAME(HingeConstraintSettings_get_mSpace)(_ref(HingeConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, HingeConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mSpace)(_ref(HingeConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(HingeConstraintSettings_get_mPoint1)(_ref(HingeConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint1), RVec3); } DEFINE_PRIM(_IDL, HingeConstraintSettings_get_mPoint1, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mPoint1)(_ref(HingeConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint1 = *_unref(value); } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mPoint1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(HingeConstraintSettings_get_mPoint2)(_ref(HingeConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint2), RVec3); } DEFINE_PRIM(_IDL, HingeConstraintSettings_get_mPoint2, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mPoint2)(_ref(HingeConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint2 = *_unref(value); } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mPoint2, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(HingeConstraintSettings_get_mHingeAxis1)(_ref(HingeConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mHingeAxis1), Vec3); } DEFINE_PRIM(_IDL, HingeConstraintSettings_get_mHingeAxis1, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mHingeAxis1)(_ref(HingeConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mHingeAxis1 = *_unref(value); } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mHingeAxis1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(HingeConstraintSettings_get_mHingeAxis2)(_ref(HingeConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mHingeAxis2), Vec3); } DEFINE_PRIM(_IDL, HingeConstraintSettings_get_mHingeAxis2, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mHingeAxis2)(_ref(HingeConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mHingeAxis2 = *_unref(value); } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mHingeAxis2, _IDL _IDL); HL_PRIM float HL_NAME(HingeConstraintSettings_get_mLimitsMin)(_ref(HingeConstraintSettings)* _this) { return _unref(_this)->mLimitsMin; } DEFINE_PRIM(_F32, HingeConstraintSettings_get_mLimitsMin, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mLimitsMin)(_ref(HingeConstraintSettings)* _this, float value) { _unref(_this)->mLimitsMin = value; } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mLimitsMin, _IDL _F32); HL_PRIM float HL_NAME(HingeConstraintSettings_get_mLimitsMax)(_ref(HingeConstraintSettings)* _this) { return _unref(_this)->mLimitsMax; } DEFINE_PRIM(_F32, HingeConstraintSettings_get_mLimitsMax, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mLimitsMax)(_ref(HingeConstraintSettings)* _this, float value) { _unref(_this)->mLimitsMax = value; } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mLimitsMax, _IDL _F32); HL_PRIM _ref(Vec3)* HL_NAME(HingeConstraintSettings_get_mNormalAxis1)(_ref(HingeConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mNormalAxis1), Vec3); } DEFINE_PRIM(_IDL, HingeConstraintSettings_get_mNormalAxis1, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mNormalAxis1)(_ref(HingeConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mNormalAxis1 = *_unref(value); } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mNormalAxis1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(HingeConstraintSettings_get_mNormalAxis2)(_ref(HingeConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mNormalAxis2), Vec3); } DEFINE_PRIM(_IDL, HingeConstraintSettings_get_mNormalAxis2, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mNormalAxis2)(_ref(HingeConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mNormalAxis2 = *_unref(value); } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mNormalAxis2, _IDL _IDL); HL_PRIM float HL_NAME(HingeConstraintSettings_get_mMaxFrictionTorque)(_ref(HingeConstraintSettings)* _this) { return _unref(_this)->mMaxFrictionTorque; } DEFINE_PRIM(_F32, HingeConstraintSettings_get_mMaxFrictionTorque, _IDL); HL_PRIM void HL_NAME(HingeConstraintSettings_set_mMaxFrictionTorque)(_ref(HingeConstraintSettings)* _this, float value) { _unref(_this)->mMaxFrictionTorque = value; } DEFINE_PRIM(_VOID, HingeConstraintSettings_set_mMaxFrictionTorque, _IDL _F32); // ============= PointConstraintSettings ============= HL_PRIM _ref(PointConstraintSettings)* HL_NAME(PointConstraintSettings_new0)() { return alloc_ref(new PointConstraintSettings(), PointConstraintSettings); } DEFINE_PRIM(_IDL, PointConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(PointConstraintSettings_delete)(_ref(PointConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, PointConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(PointConstraintSettings_Create2)(_ref(PointConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, PointConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM int HL_NAME(PointConstraintSettings_get_mSpace)(_ref(PointConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, PointConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(PointConstraintSettings_set_mSpace)(_ref(PointConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, PointConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(PointConstraintSettings_get_mPoint1)(_ref(PointConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint1), RVec3); } DEFINE_PRIM(_IDL, PointConstraintSettings_get_mPoint1, _IDL); HL_PRIM void HL_NAME(PointConstraintSettings_set_mPoint1)(_ref(PointConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint1 = *_unref(value); } DEFINE_PRIM(_VOID, PointConstraintSettings_set_mPoint1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(PointConstraintSettings_get_mPoint2)(_ref(PointConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint2), RVec3); } DEFINE_PRIM(_IDL, PointConstraintSettings_get_mPoint2, _IDL); HL_PRIM void HL_NAME(PointConstraintSettings_set_mPoint2)(_ref(PointConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint2 = *_unref(value); } DEFINE_PRIM(_VOID, PointConstraintSettings_set_mPoint2, _IDL _IDL); // ============= ConeConstraintSettings ============= HL_PRIM _ref(ConeConstraintSettings)* HL_NAME(ConeConstraintSettings_new0)() { return alloc_ref(new ConeConstraintSettings(), ConeConstraintSettings); } DEFINE_PRIM(_IDL, ConeConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(ConeConstraintSettings_delete)(_ref(ConeConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, ConeConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(ConeConstraintSettings_Create2)(_ref(ConeConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, ConeConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM int HL_NAME(ConeConstraintSettings_get_mSpace)(_ref(ConeConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, ConeConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(ConeConstraintSettings_set_mSpace)(_ref(ConeConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, ConeConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(ConeConstraintSettings_get_mPoint1)(_ref(ConeConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint1), RVec3); } DEFINE_PRIM(_IDL, ConeConstraintSettings_get_mPoint1, _IDL); HL_PRIM void HL_NAME(ConeConstraintSettings_set_mPoint1)(_ref(ConeConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint1 = *_unref(value); } DEFINE_PRIM(_VOID, ConeConstraintSettings_set_mPoint1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(ConeConstraintSettings_get_mPoint2)(_ref(ConeConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint2), RVec3); } DEFINE_PRIM(_IDL, ConeConstraintSettings_get_mPoint2, _IDL); HL_PRIM void HL_NAME(ConeConstraintSettings_set_mPoint2)(_ref(ConeConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint2 = *_unref(value); } DEFINE_PRIM(_VOID, ConeConstraintSettings_set_mPoint2, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(ConeConstraintSettings_get_mTwistAxis1)(_ref(ConeConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mTwistAxis1), Vec3); } DEFINE_PRIM(_IDL, ConeConstraintSettings_get_mTwistAxis1, _IDL); HL_PRIM void HL_NAME(ConeConstraintSettings_set_mTwistAxis1)(_ref(ConeConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mTwistAxis1 = *_unref(value); } DEFINE_PRIM(_VOID, ConeConstraintSettings_set_mTwistAxis1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(ConeConstraintSettings_get_mTwistAxis2)(_ref(ConeConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mTwistAxis2), Vec3); } DEFINE_PRIM(_IDL, ConeConstraintSettings_get_mTwistAxis2, _IDL); HL_PRIM void HL_NAME(ConeConstraintSettings_set_mTwistAxis2)(_ref(ConeConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mTwistAxis2 = *_unref(value); } DEFINE_PRIM(_VOID, ConeConstraintSettings_set_mTwistAxis2, _IDL _IDL); HL_PRIM float HL_NAME(ConeConstraintSettings_get_mHalfConeAngle)(_ref(ConeConstraintSettings)* _this) { return _unref(_this)->mHalfConeAngle; } DEFINE_PRIM(_F32, ConeConstraintSettings_get_mHalfConeAngle, _IDL); HL_PRIM void HL_NAME(ConeConstraintSettings_set_mHalfConeAngle)(_ref(ConeConstraintSettings)* _this, float value) { _unref(_this)->mHalfConeAngle = value; } DEFINE_PRIM(_VOID, ConeConstraintSettings_set_mHalfConeAngle, _IDL _F32); // ============= DistanceConstraintSettings ============= HL_PRIM _ref(DistanceConstraintSettings)* HL_NAME(DistanceConstraintSettings_new0)() { return alloc_ref(new DistanceConstraintSettings(), DistanceConstraintSettings); } DEFINE_PRIM(_IDL, DistanceConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(DistanceConstraintSettings_delete)(_ref(DistanceConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, DistanceConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(DistanceConstraintSettings_Create2)(_ref(DistanceConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, DistanceConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM int HL_NAME(DistanceConstraintSettings_get_mSpace)(_ref(DistanceConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, DistanceConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(DistanceConstraintSettings_set_mSpace)(_ref(DistanceConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, DistanceConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(DistanceConstraintSettings_get_mPoint1)(_ref(DistanceConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint1), RVec3); } DEFINE_PRIM(_IDL, DistanceConstraintSettings_get_mPoint1, _IDL); HL_PRIM void HL_NAME(DistanceConstraintSettings_set_mPoint1)(_ref(DistanceConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint1 = *_unref(value); } DEFINE_PRIM(_VOID, DistanceConstraintSettings_set_mPoint1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(DistanceConstraintSettings_get_mPoint2)(_ref(DistanceConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPoint2), RVec3); } DEFINE_PRIM(_IDL, DistanceConstraintSettings_get_mPoint2, _IDL); HL_PRIM void HL_NAME(DistanceConstraintSettings_set_mPoint2)(_ref(DistanceConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPoint2 = *_unref(value); } DEFINE_PRIM(_VOID, DistanceConstraintSettings_set_mPoint2, _IDL _IDL); HL_PRIM float HL_NAME(DistanceConstraintSettings_get_mMinDistance)(_ref(DistanceConstraintSettings)* _this) { return _unref(_this)->mMinDistance; } DEFINE_PRIM(_F32, DistanceConstraintSettings_get_mMinDistance, _IDL); HL_PRIM void HL_NAME(DistanceConstraintSettings_set_mMinDistance)(_ref(DistanceConstraintSettings)* _this, float value) { _unref(_this)->mMinDistance = value; } DEFINE_PRIM(_VOID, DistanceConstraintSettings_set_mMinDistance, _IDL _F32); HL_PRIM float HL_NAME(DistanceConstraintSettings_get_mMaxDistance)(_ref(DistanceConstraintSettings)* _this) { return _unref(_this)->mMaxDistance; } DEFINE_PRIM(_F32, DistanceConstraintSettings_get_mMaxDistance, _IDL); HL_PRIM void HL_NAME(DistanceConstraintSettings_set_mMaxDistance)(_ref(DistanceConstraintSettings)* _this, float value) { _unref(_this)->mMaxDistance = value; } DEFINE_PRIM(_VOID, DistanceConstraintSettings_set_mMaxDistance, _IDL _F32); // ============= MassProperties ============= HL_PRIM _ref(MassProperties)* HL_NAME(MassProperties_new0)() { return alloc_ref(new MassProperties(), MassProperties); } DEFINE_PRIM(_IDL, MassProperties_new0, _NO_ARG); HL_PRIM void HL_NAME(MassProperties_delete)(_ref(MassProperties)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, MassProperties_delete, _IDL); HL_PRIM float HL_NAME(MassProperties_get_mMass)(_ref(MassProperties)* _this) { return _unref(_this)->mMass; } DEFINE_PRIM(_F32, MassProperties_get_mMass, _IDL); HL_PRIM void HL_NAME(MassProperties_set_mMass)(_ref(MassProperties)* _this, float value) { _unref(_this)->mMass = value; } DEFINE_PRIM(_VOID, MassProperties_set_mMass, _IDL _F32); HL_PRIM void HL_NAME(MassProperties_ScaleToMass1)(_ref(MassProperties)* _this, float mass) { _unref(_this)->ScaleToMass(mass); } DEFINE_PRIM(_VOID, MassProperties_ScaleToMass1, _IDL _F32); // ============= BodyCreationSettings (extended fields) ============= HL_PRIM int HL_NAME(BodyCreationSettings_get_mMotionQuality)(_ref(BodyCreationSettings)* _this) { return (int)_unref(_this)->mMotionQuality; } DEFINE_PRIM(_I32, BodyCreationSettings_get_mMotionQuality, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mMotionQuality)(_ref(BodyCreationSettings)* _this, int value) { _unref(_this)->mMotionQuality = (EMotionQuality)value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mMotionQuality, _IDL _I32); HL_PRIM int HL_NAME(BodyCreationSettings_get_mAllowedDOFs)(_ref(BodyCreationSettings)* _this) { return (int)_unref(_this)->mAllowedDOFs; } DEFINE_PRIM(_I32, BodyCreationSettings_get_mAllowedDOFs, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mAllowedDOFs)(_ref(BodyCreationSettings)* _this, int value) { _unref(_this)->mAllowedDOFs = (EAllowedDOFs)value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mAllowedDOFs, _IDL _I32); HL_PRIM int HL_NAME(BodyCreationSettings_get_mOverrideMassProperties)(_ref(BodyCreationSettings)* _this) { return (int)_unref(_this)->mOverrideMassProperties; } DEFINE_PRIM(_I32, BodyCreationSettings_get_mOverrideMassProperties, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mOverrideMassProperties)(_ref(BodyCreationSettings)* _this, int value) { _unref(_this)->mOverrideMassProperties = (EOverrideMassProperties)value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mOverrideMassProperties, _IDL _I32); HL_PRIM _ref(MassProperties)* HL_NAME(BodyCreationSettings_get_mMassPropertiesOverride)(_ref(BodyCreationSettings)* _this) { return &_unref(_this)->mMassPropertiesOverride; } DEFINE_PRIM(_IDL, BodyCreationSettings_get_mMassPropertiesOverride, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mMassPropertiesOverride)(_ref(BodyCreationSettings)* _this, _ref(MassProperties)* value) { _unref(_this)->mMassPropertiesOverride = *_unref(value); } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mMassPropertiesOverride, _IDL _IDL); HL_PRIM int HL_NAME(BodyCreationSettings_get_mNumVelocityStepsOverride)(_ref(BodyCreationSettings)* _this) { return (int)_unref(_this)->mNumVelocityStepsOverride; } DEFINE_PRIM(_I32, BodyCreationSettings_get_mNumVelocityStepsOverride, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mNumVelocityStepsOverride)(_ref(BodyCreationSettings)* _this, int value) { _unref(_this)->mNumVelocityStepsOverride = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mNumVelocityStepsOverride, _IDL _I32); HL_PRIM int HL_NAME(BodyCreationSettings_get_mNumPositionStepsOverride)(_ref(BodyCreationSettings)* _this) { return (int)_unref(_this)->mNumPositionStepsOverride; } DEFINE_PRIM(_I32, BodyCreationSettings_get_mNumPositionStepsOverride, _IDL); HL_PRIM void HL_NAME(BodyCreationSettings_set_mNumPositionStepsOverride)(_ref(BodyCreationSettings)* _this, int value) { _unref(_this)->mNumPositionStepsOverride = value; } DEFINE_PRIM(_VOID, BodyCreationSettings_set_mNumPositionStepsOverride, _IDL _I32); // ============= FixedConstraintSettings (axis fields) ============= HL_PRIM _ref(Vec3)* HL_NAME(FixedConstraintSettings_get_mAxisX1)(_ref(FixedConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisX1), Vec3); } DEFINE_PRIM(_IDL, FixedConstraintSettings_get_mAxisX1, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mAxisX1)(_ref(FixedConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisX1 = *_unref(value); } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mAxisX1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(FixedConstraintSettings_get_mAxisY1)(_ref(FixedConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisY1), Vec3); } DEFINE_PRIM(_IDL, FixedConstraintSettings_get_mAxisY1, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mAxisY1)(_ref(FixedConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisY1 = *_unref(value); } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mAxisY1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(FixedConstraintSettings_get_mAxisX2)(_ref(FixedConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisX2), Vec3); } DEFINE_PRIM(_IDL, FixedConstraintSettings_get_mAxisX2, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mAxisX2)(_ref(FixedConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisX2 = *_unref(value); } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mAxisX2, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(FixedConstraintSettings_get_mAxisY2)(_ref(FixedConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisY2), Vec3); } DEFINE_PRIM(_IDL, FixedConstraintSettings_get_mAxisY2, _IDL); HL_PRIM void HL_NAME(FixedConstraintSettings_set_mAxisY2)(_ref(FixedConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisY2 = *_unref(value); } DEFINE_PRIM(_VOID, FixedConstraintSettings_set_mAxisY2, _IDL _IDL); // ============= SliderConstraintSettings (normal axis fields) ============= HL_PRIM _ref(Vec3)* HL_NAME(SliderConstraintSettings_get_mNormalAxis1)(_ref(SliderConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mNormalAxis1), Vec3); } DEFINE_PRIM(_IDL, SliderConstraintSettings_get_mNormalAxis1, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mNormalAxis1)(_ref(SliderConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mNormalAxis1 = *_unref(value); } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mNormalAxis1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SliderConstraintSettings_get_mNormalAxis2)(_ref(SliderConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mNormalAxis2), Vec3); } DEFINE_PRIM(_IDL, SliderConstraintSettings_get_mNormalAxis2, _IDL); HL_PRIM void HL_NAME(SliderConstraintSettings_set_mNormalAxis2)(_ref(SliderConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mNormalAxis2 = *_unref(value); } DEFINE_PRIM(_VOID, SliderConstraintSettings_set_mNormalAxis2, _IDL _IDL); // ============= SixDOFConstraintSettings ============= HL_PRIM _ref(SixDOFConstraintSettings)* HL_NAME(SixDOFConstraintSettings_new0)() { return alloc_ref(new SixDOFConstraintSettings(), SixDOFConstraintSettings); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_new0, _NO_ARG); HL_PRIM void HL_NAME(SixDOFConstraintSettings_delete)(_ref(SixDOFConstraintSettings)* _this) { free_ref(_this); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_delete, _IDL); HL_PRIM _ref(Constraint)* HL_NAME(SixDOFConstraintSettings_Create2)(_ref(SixDOFConstraintSettings)* _this, _ref(Body)* body1, _ref(Body)* body2) { return _unref(_this)->Create(*_unref(body1), *_unref(body2)); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_Create2, _IDL _IDL _IDL); HL_PRIM int HL_NAME(SixDOFConstraintSettings_get_mSpace)(_ref(SixDOFConstraintSettings)* _this) { return (int)_unref(_this)->mSpace; } DEFINE_PRIM(_I32, SixDOFConstraintSettings_get_mSpace, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mSpace)(_ref(SixDOFConstraintSettings)* _this, int value) { _unref(_this)->mSpace = (EConstraintSpace)value; } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mSpace, _IDL _I32); HL_PRIM _ref(RVec3)* HL_NAME(SixDOFConstraintSettings_get_mPosition1)(_ref(SixDOFConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPosition1), RVec3); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_get_mPosition1, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mPosition1)(_ref(SixDOFConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPosition1 = *_unref(value); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mPosition1, _IDL _IDL); HL_PRIM _ref(RVec3)* HL_NAME(SixDOFConstraintSettings_get_mPosition2)(_ref(SixDOFConstraintSettings)* _this) { return alloc_ref(new RVec3(_unref(_this)->mPosition2), RVec3); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_get_mPosition2, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mPosition2)(_ref(SixDOFConstraintSettings)* _this, _ref(RVec3)* value) { _unref(_this)->mPosition2 = *_unref(value); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mPosition2, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SixDOFConstraintSettings_get_mAxisX1)(_ref(SixDOFConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisX1), Vec3); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_get_mAxisX1, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mAxisX1)(_ref(SixDOFConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisX1 = *_unref(value); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mAxisX1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SixDOFConstraintSettings_get_mAxisY1)(_ref(SixDOFConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisY1), Vec3); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_get_mAxisY1, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mAxisY1)(_ref(SixDOFConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisY1 = *_unref(value); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mAxisY1, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SixDOFConstraintSettings_get_mAxisX2)(_ref(SixDOFConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisX2), Vec3); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_get_mAxisX2, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mAxisX2)(_ref(SixDOFConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisX2 = *_unref(value); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mAxisX2, _IDL _IDL); HL_PRIM _ref(Vec3)* HL_NAME(SixDOFConstraintSettings_get_mAxisY2)(_ref(SixDOFConstraintSettings)* _this) { return alloc_ref(new Vec3(_unref(_this)->mAxisY2), Vec3); } DEFINE_PRIM(_IDL, SixDOFConstraintSettings_get_mAxisY2, _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_set_mAxisY2)(_ref(SixDOFConstraintSettings)* _this, _ref(Vec3)* value) { _unref(_this)->mAxisY2 = *_unref(value); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_set_mAxisY2, _IDL _IDL); HL_PRIM void HL_NAME(SixDOFConstraintSettings_MakeFreeAxis1)(_ref(SixDOFConstraintSettings)* _this, int axis) { _unref(_this)->MakeFreeAxis((SixDOFConstraintSettings::EAxis)axis); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_MakeFreeAxis1, _IDL _I32); HL_PRIM void HL_NAME(SixDOFConstraintSettings_MakeFixedAxis1)(_ref(SixDOFConstraintSettings)* _this, int axis) { _unref(_this)->MakeFixedAxis((SixDOFConstraintSettings::EAxis)axis); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_MakeFixedAxis1, _IDL _I32); HL_PRIM void HL_NAME(SixDOFConstraintSettings_SetLimitedAxis3)(_ref(SixDOFConstraintSettings)* _this, int axis, float min, float max) { _unref(_this)->SetLimitedAxis((SixDOFConstraintSettings::EAxis)axis, min, max); } DEFINE_PRIM(_VOID, SixDOFConstraintSettings_SetLimitedAxis3, _IDL _I32 _F32 _F32); // ============= NarrowPhaseQuery ============= HL_PRIM void HL_NAME(NarrowPhaseQuery_delete)(_ref(NarrowPhaseQuery)* _this) { // NarrowPhaseQuery is owned by PhysicsSystem, do not delete } DEFINE_PRIM(_VOID, NarrowPhaseQuery_delete, _IDL); HL_PRIM bool HL_NAME(NarrowPhaseQuery_CastRay2)(_ref(NarrowPhaseQuery)* _this, _ref(RRayCast)* ray, _ref(RayCastResult)* result) { RayCastResult hit; bool didHit = _unref(_this)->CastRay(*_unref(ray), hit); if (didHit) { *_unref(result) = hit; } return didHit; } DEFINE_PRIM(_BOOL, NarrowPhaseQuery_CastRay2, _IDL _IDL _IDL); // ============= PhysicsSystem::GetNarrowPhaseQuery ============= HL_PRIM _ref(NarrowPhaseQuery)* HL_NAME(PhysicsSystem_GetNarrowPhaseQuery0)(_ref(PhysicsSystem)* _this) { return const_cast(&_unref(_this)->GetNarrowPhaseQuery()); } DEFINE_PRIM(_IDL, PhysicsSystem_GetNarrowPhaseQuery0, _IDL); } // extern "C"