Paginated hkpSampledHeightFieldShape ?

Paginated hkpSampledHeightFieldShape ?

Guillaume Le Biller的头像

Hello,

I am playing with the sampled height field and it's working nice for a small terrain.
However, I now want to try to expand my small world to a bigger one.
If the initial size of the height field is too big, it goes out of the broadphase and is removed.

Is there any way to make a paginated height field while moving the broadphase when the camera is moving
so that you only have a small part of the big world inside the broadphase but without having the "outside of broadphase exception" (that will remove the terrain ...) ?

I read the "optimizing the broadphase" section in documentation, but it only talk about mesh and not height field.
Would it be better to preprocess the heigh field and transform it into chunks of mesh ?

Thanks,
Regards

3 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项.
ericundersander的头像

Can't you simply increase your broadphase size to fit your whole terrain? hkpWorldCinfo::m_broadPhaseWorldAabb.

As for a paginated height field, this might be necessary if your heightfield is so big that memory is a concern. Havok Support has recommended to me in the past to break up a, say 2049x2049 heightfield into perhaps an 8x8 "patchwork quilt" of smaller 257x257 heightfields. These can be added/removed individually as fixed rigid bodies, so you can just have a few loaded at a time.

Guillaume Le Biller的头像

Hello,

I don't really wan't to increase broadphase since most of the scene will not be usefull for the player and it will make some performances issue.

However, I will try the second option making some small heighfields and adding / removing it dynamically :)

Thanks

登陆并发表评论。