Anyone used the havok physics engine for three?

Moderation scrolling past this thread on the list, assuming all these new posts are a part of a heated, constructive discussion about which physics engine is working best with three.js (it’s ammo.js ofc.)

3 Likes

someone is really missing his green color

Yes, I hate the api design of babylon.js.

Thanks for sharing the great project!

All the merits goes to the author. To bridge all features of Havok or physX with Javascript is not a piece of cake. And seem it’s actively worked on, now updated to officialy include Cannon-es
( give this person some github stars :grin:)

3 Likes

I’ve recently made another demo using Havok. It was quite fun, but the lack of an official documentation is definitely a noticeable limitation. At least, I couldn’t find any (at the time of writing), even a minimalistic one like Ammo’s, so if anyone has more luck with that, please share, it would be much appreciated!

I haven’t tried Rapier nor Oimo or Cannon (yet), but working with Havok feels quite similar to working with Ammo. In some cases even nicer 'cause it has these neat HP_Body_SetMassProperties and HP_Shape_SetMaterial methods based on body’s pointer and body’s shape pointer respectively.

Oh, there’s also an issue with camera’s near clipping plane when used with three.js > 0.150.1. It causes all physics bodies to disappear when too close to the camera. I haven’t figured out why though yet, so I just used v. 0.150.1.

Anyway, for anyone interested, here are some links to this mini-project:
GitHub
Live Demo

It’s based on N8python’s havokDemo, so kudos to that!

2 Likes

The disappearing object thing might just be a frustum culling issue on the instanced objects. You might just need to set frustumCulled = false on your InstancedMeshes.

1 Like

Thanks for your suggestion, @manthrax! :heart:
I will definitely check that as soon as I find some time to get back to this.

P.S.: I forgot to mention that at the moment, the best way to experiment with Havok in three.js, beside console.logging the engine instance to check all available methods in it, is to “reverse engineer” Babylon’s APIs and abstractions in order to adapt them for three.js. At least that worked quite well for me. Here are some useful links:

Simple SceneHavokPlugin & PhysicsAggregatePhysicsEnginePhysicsBody

1 Like