Is the HP_Shape_CreateHeightField function usable?

I’m really excited to see support for the Havok engine!

I want to try using Babylon.js in our next project, but I noticed that the publicly available API doesn’t provide the functionality for a HeightField shape.

When will we be able to use this function to generate terrain?


Adding @eoin and @carolhmj about this one :slight_smile:

We have a HeightField Shape in the plugin, it’s just not exposed to Babylon :sweat_smile: I’ll move this up on my todos :wink: For now, it’s possible to use the Mesh shape.

Note that the function doesn’t generate the terrain for you, it just receives an existing one and creates the collision shape for it.

1 Like

Yes, I’m currently using the mesh shape for my terrain.

In terms of performance, does a heightfield have any advantages? I

can’t wait to see the heightfield shape revealed.

Thank you very much for creating such an amazing library.

1 Like

I believe a heightfield would be more efficient, am I correct @eoin ?

The exact performance difference would depend on the scenario, but in general, I’d expect that for long raycasts, the heightfield will probably be a little faster (but we do try to make our raycasts pretty fast :slight_smile:). For normal collision detection, there wouldn’t be a significant difference between a heightfield or a mesh - the biggest difference is mostly about the memory usage of each shape, as we can calculate few of the heightfield values on the fly.