I need to support holes in my heightfield data. The Havok documentation alludes to using the hkpTriSampledHeightFieldBvTreeShape class in such cases, which is what I've started to do (i.e. instantiating a hkpTriSampledHeightFieldBvTreeShape around a hkpTriSampledHeightfieldCollection around a hkpSampledHeightFieldShape). I need my heightfield holes to be respected by both character proxies moving around on the terrain, and by ray and shape casts executed against the Havok world (aabbPhantoms, etc).
I think I've been able to make character proxies respect the hole data by overriding "hkpTriSampledHeightFieldBvTreeShape::queryAabb(const hkAabb& aabb, hkArray& hits)", such that I allow the hkpTriSampledHeightFieldBvTreeShape's version of this method to execute, and then prune hits from the returned hkArray if those hits overlap my hole data.
However, I'm not sure what approach to take to make sure that ray and shape casts also behave properly. I thought that if I installed my own custom filter into the Havok world, I could override hkpCollisionFilter::isCollisionEnabled(const hkpShapeRayCastInput& aInput, const hkpShape& bShape ... ) to return false if the shape was a heightfield and the shapeKey overlapped my hole data. However, that particular isCollisionEnabled method never seems to be called. I also thought to try overriding hkpTriSampledHeightFieldBvTreeShape::castRayImpl to somehow set the m_rayShapeCollectionFilter in the hkpShapeRayCastInput, but again, my collectionFilter's isCollisionEnabled method does not seem to get called.
In short, looking for a little guidance on where/how I can filter out per-triangle hits for my TriSampled heightfield, and would also like to know if there's a cleaner approach than what I did to make character proxies respect my heightfield hole data.
Thanks for reading, any help much appreciated.