Bullet Physics keeps freezing the game

Hi there !

I just set up a really simple scene in v0.6 were a box just hovers around.
Unfortunately the game keeps freezing after a few seconds into it.
see attached .blend file
move_physbug.blend (772.0 KB)

I also tried OIMO instead and followed this instruction:

But when I select Oimo under physics module and try to build,
nothing happens. It just reverts to the play button and Krom never starts.

What are your experiences with the physics in Armory 3D ?
Is this instability a known issue with bullet physics ?
Is this issue being worked on for v0.7 ?

Thanks in advance

Hey @rbx775! The problem with your blend is an issue with the Cast Physics Ray node. Looks like you uncovered a bug. The ray cast to position is not far enough when the block ends up more than 1 unit away from the plain that it is floating above. Because the block is more than 1 unit away, the ray-cast doesn’t contact and a failure to check for the null collision point results in a runtime exception. I fixed it in this instance by setting the ray-cast distance to 3 instead of 1.

image

The problem is that the code isn’t making sure that hitPointWorld isn’t null before trying to run v.set() with its value.

Uncaught exception:
                        _this.x = hitPointWorld.x;
                        ^
TypeError: Unable to get property 'x' of undefined or null reference
   at get (krom.js:695:4)
   at armory_logicnode_LogicNodeInput.prototype.get (krom.js:891:3)
   at run (krom.js:859:3)
   at armory_logicnode_LogicNode.prototype.runOutput (krom.js:581:6)
   at update (krom.js:1089:3)
   at lateUpdate (krom.js:1826:5)
   at iron_App.update (krom.js:5465:3)
   at Anonymous function (krom.js:24495:3)
   at kha_Scheduler.executeTimeTasks (krom.js:24379:4)
   at kha_Scheduler.executeFrame (krom.js:24331:3)

It would be good if you could submit an issue on GitHub and link back to this topic, or even better, if you want to, create a pull request to fix it. :slight_smile:

I don’t have personal experience with Oimo, but I know that it is only suitable for simple physics as it has a lot less features like not supporting mesh collision shapes.

Bullet has performed very well for Armory, though Armory is missing some Bullet bindings and there are probably few bugs in the integration. In my limited time I’m working on developing a way to automate bindings of bullet for Armory which will hopefully lead to even better physics integration in the future.

1 Like

Hi zicklag thank you for your amazing reply.

Unfortunately I have no knowledge of github whatsoever, so I hope I did not delete the internet by trying to do my first pull request:

The error would also occur for the Normal output of the Node. So thats why 2 new lines.

Thanks for your awesomely detailed reply. I didnt even notice the sources where included. I think I will go on a bughunt the next month!

EDIT: YAY ! Its already merged into master !

4 Likes

Awesome! Glad I could help, and great job submitting your first pull request! :+1: :tada:

4 Likes