Re: Bad Routine Number Jolt Physics
- Posted by ghaberek (admin) Aug 14, 2023
- 626 views
There's a lot going on here...
I know I used the mingw32 to make the DLL, so it is 32-bits DLL. The wrapper library is pretty big, so I'll put it in zip file. Perhaps someone can help me?
Looks like a 64-bit DLL to me, so that's probably your first problem:
$ file joltc.dll joltc.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
If you're using TDM-GCC-64 running gcc --version would show gcc (tdm64-1) 10.3.0 and it will build 64-bit DLLs by default. The Makefile I made has options for this. Beyond that, I tested your 64-bit DLL on 64-bit Windows and it does seem to load most of the functions but there are some that are broken.
These functions were simply misspelled in your wrapper. Hopefully you're making good use of copy/paste and not writing out all of these function names by hand. Lord help you if you are.
JPC_Body_ApplyBuoyancyImpulse JPC_Body_IsActive JPC_CylinderShapeSettings_SetHalfHeight JPC_MotionProperties_SetGravityFactor JPC_PhysicsSystem_OptimizeBroadPhase
These functions are missing because they require JPC_DEBUG_RENDERER to be defined. I've added that flag to my Makefile in the other thread.
JPC_BodyDrawFilter_Create JPC_BodyDrawFilter_Destroy JPC_BodyManager_DrawSettings_Create JPC_BodyManager_DrawSettings_Destroy JPC_DebugRenderer_TriangleBatch_AddRef JPC_DebugRenderer_TriangleBatch_Create JPC_DebugRenderer_TriangleBatch_GetPrimitive JPC_DebugRenderer_TriangleBatch_GetRefCount JPC_DebugRenderer_TriangleBatch_Release JPC_PhysicsSystem_DrawBodies JPC_PhysicsSystem_DrawConstraintLimits JPC_PhysicsSystem_DrawConstraintReferenceFrame JPC_PhysicsSystem_DrawConstraints
These functions are missing because they're in JoltPhysicsC_Extensions.cpp, which I noted in the other thread should be excluded because it overrides the private keyword, which is Bad Practiceâ„¢. You should remove them altogether.
JPC_PhysicsSystem_GetActiveBodyIDs JPC_PhysicsSystem_GetBodiesUnsafe JPC_PhysicsSystem_GetBodyIDs
This function is missing because it has an inconsistent signature in between JoltPhysicsC.h and JoltPhysicsC.cpp, which prevents it from being exported correctly. You need to edit JoltPhysicsC.h (line 1433) to add the missing parameter as shown here:
JPC_BodyInterface_SetPosition(JPC_BodyInterface *in_iface, JPC_BodyID in_body_id, // <-- add this line const JPC_Real in_position[3], JPC_Activation in_activation);
I could not locate these functions anywhere in JoltPhysicsC.cpp. I'm assuming these were a typo on your part.
JPC_Body_SetAngularVelocity JPC_Body_SetAngularVelocityClamped
Hope that helps!
-Greg