Havok Physics engine entity creation and raw pos/rot usage?

I would otherwise like to just access Havok’s world matrix buffers directly but I currently can’t find it without having to destructure objects like {x,y,z} for individual entities which is pointlessly inefficient. This was a main bottleneck in RapierJS too which added several milliseconds per frame for a decent number of objects.

Thanks for sharing this, @Joshua_Brewster. I didn’t know that destructuring could add several ms per frame. Do you know if we can avoid this bottleneck by using object.x instead of const { x } = object?

I’m unsure if this helps, though syncTransform() inside the Babylon.js source code seems like a way to get world transforms from Havok’s memory buffer.

I’ve also been looking into decoupling rendering from physics and have been using the low-level Havok functions directly (using Babylon.js’ havokPlugin.ts as a reference for how to use these functions).