Phong13 / BulletSharpUnity3d

A fork of the BulletSharp project to make the Bullet Physics Engine usable from C# code in Unity3d
Other
547 stars 145 forks source link

AllConvexResultCallback #75

Closed nagedev closed 4 years ago

nagedev commented 4 years ago

As I understand, ConvexResultCallback is inherited by only one class (ClosestConvexResultCallback), and because of that ConvexSweepTest returns only closest result, which means that there's no way to get All collisions

Is there any way to do some shape cast that returns all collisions?

Phong13 commented 4 years ago

Have you tried using a ghost object? I think you can:

Create a ghost object Add your casting shape Move it and there should be a collision pair cache that has all the collisions.

nagedev commented 4 years ago

That works! I thought it would require calling StepSimulation, but it works perfectly without it Thanks