Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I detect collisions from the point of view of the Collider?
#1
I have a platform on which fluid is going to be poured.

Instead of going through a large array of contact points from the perspective of solver, can I just detect collision from the perspective of the platform?

All I want is for the platform to detect just one particle.
Reply
#2
(06-06-2020, 08:44 PM)emz06 Wrote: I have a platform on which fluid is going to be poured.

Instead of going through a large array of contact points from the perspective of solver, can I just detect collision from the perspective of the platform?

All I want is for the platform to detect just one particle.

Hi there,

No, you can’t. Obi gives you direct access to the contacts array actually used by the engine to solve collisions. This is the most raw, unprocessed form of contact information you can possibly get from a physics engine.

Any additional filtering of this data would have to happen by iterating at least once over all contacts, so regardless of who performed this filtering (you, or the engine) the cost would be the same. When Unity calls your component’s OnCollisionEnter, Exit, etc, it does so by iterating over all contacts and calling the appropiate callbacks for each one. Not any more efficient than you can do with Obi.

So the simplest, and actually the most efficient way to filter out contacts is iterating over them once, finding all the info you need.
Reply