How to collect nearby RigidBodies/Collidables?

How to collect nearby RigidBodies/Collidables?

Hello again dear community! 

My question is how can I collect other hkpRigidBodies/hkpCollidables close to a specific one? That would mean within a given radius. Is there a demo that I didn't see that covers this or is there a fast answer concerning my problem? 

I hope that I'm not reposting anything but advice would be very much appreciated! 

Thanks in advance.  

2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Hi raibina,

I think using hkpWorld::getPenetrations() or hkpShapePhantom::getPenetrations() with a sphere shape will give the effect you're looking for. These functions returns a list of shapes that are currently overlapping the shape specified.

The Physics\Api\Collide\Queries\ShapeQuery\Penetrations demo uses these function if you want to see an example of them being used. The source file (ShapeQueryDemo.cpp) is quite large as it is 5 demos in one (& a lot of comments explaining the demo) but a search for "penetrations" should find the sections you need. The Collision Queries section in the User Guide might provide some more info on this topic as well.

Amy Developer Support Engineer Havok www.havok.com

发表评论

登录添加评论。还不是成员?立即加入