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 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

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

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi