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 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui