[Update] About the Oimo physics module

I’d like to use the Oimo physics since I’m planning to make lightweight web games or experiences. I have been trying to get it to work and realized the macro vec3_fromVec3 from M.hx is not assigning values to properties in RigidBody.hx which makes all my rigidbodies disappear in my game scene. I have no idea how macros work and I’ve spent a couple of days trying to fix this issue, does someone has Oimo working with the latest version of Armory (2024.02)? or does someone have any recommendations for where to look at (like articles or readings) so I can fix this?

I also saw the oimo_module github’s repo is a public archive, is Oimo being deprecated? or is it archived because it’s planned to be reworked?

I investigated a bit about macros and realized the issue isn’t in the M.hx class at all. Looking inside the oimo_module I found out that body.getPosition() in physicsUpdate() from RigidBody.hx returns a Vec3, but its components (x, y, z) return NaN each on dynamic bodies for some reason. I’m still figuring out why but if someone has an idea I’ll really appreciate hearing from it.

1 Like

I reintegrated the oimo_module to Armory 2024.02. The issue was with assigning params and flags in the constructor, as they were casted as an array but they are actually an object. These are some of the things I added after fixing that:

  • Implemented: getPosition(), applyForce(), applyTorque()
  • Integrated iron.Time.scale to PhysicsWorld, to be able to pause or change the physics process speed
  • Modified the rayCast() function to return a Hit object, similar to the bullet’s module
  • Added setGravity() and getGravity() to PhysicsWorld

My plan is to keep updating the Oimo module by adding methods that go hand in hand with Bullet’s ones. If you are interested you can check it out in my github repo.

If the main oimo_module is reactivated I’ll be glad to open a PR on it.