FAQ: Collisions

The following pertains to regular particle collisions, not PhysX rigidbody collisions.

•  Why are my colliders leaking particles?

tyFlow implements continuous collision detection (CCD), which is a robust method for resolving collisions between particles and geometry in regular circumstances. However, there are a few cases where CCD will fail:

  • Floating point rounding errors can cause CCD to return incorrect results when the distance between a particle and a collider is extremely small. Ensure you are not spawning particles directly on the surface of your colliders (give them a tiny positional offset above the surface), and ensure your collision offset setting (within your Collision operator’s Collisions rollout) is some small value above zero.

  • Moving particles manually (instead of moving them with forces) can cause them to tunnel through collision surfaces. By default, tyFlow constructs collision test rays within each particle’s starting position and its current velocity vector. Collisions are then found between those rays and all assigned collision geometry. In normal circumstances where users do not manually move particles, that will result in temporally contiguous particle trajectories which will allow for robust collision detection. If you manually move your particles over time (using an operator that directly affects particle positions, like Position Icon, Position Object, Object Bind, Spread, etc), affected particle trajectories will lose their temporal contiguity and may travel through collision surfaces.

  • When tyFlow’s CCD solver processes animated input geometry, it interpolates between frames in a linear fashion. Animated vertices of a collision surface will be treated as if they are moving in a straight line between frames. If your collision geometry is rotating, or affected by another rotating object in the scene (for example, if your collision geometry is a skinned mesh affected by rotating bones), those linear interpolations may not correspond to the actual sub-frame angular motion of the vertices, which can result in missed collisions. If your animated collision geometry is leaking particles because of this, the only solution is to decrease the overall simulation time step. Note: this particular problem will usually only manifest if collision geometry is rotating very quickly between frames.

  • If the angle between two adjacent faces on your collision geometry is less than 90 degrees, particles that fall down into the space between those faces may leak right through them when they get close to their shared edge. This is because as each particle’s collision is resolved, the particle’s position will be set to the collision point, and then shifted up along the collision face’s normal by the specified collision offset amount. If an adjacent face is less than 90 degrees from the collision face, the particle could accidentally be pushed through that neighboring face as it is offset along the collision face’s normal. The easiest solution to this potential problem is to simply ensure that collision geometry is subdivided enough so that adjacent faces do not rest at such sharp angles.

If you are unable to prevent particle leakage for whatever reason, a simple workaround would just be to delete any unwanted particles that are inside/outside/above/below your collision geometry, using a Surface Test operator.

•  Why are my particles jittering on collision surfaces?

Due to the nature of tyFlow’s discrete velocity integrator, tyFlow has no inherent way of knowing if a particle under the force of gravity is meant to be stationary. So, if a particle sitting on a surface has gravity applied to it, the tyFlow collision solver will think that the force of gravity itself should be used to calculate the bounce trajectory of the particle off the surface, which can result in small jittering forces being added to particles that are meant to be sitting still.

The simplest solution to this problem is to simply adjust the Collision operator’s bounce threshold setting. Velocities under this threshold will not contribute to bounce forces. Adjusting this value using the formula: [(jitter velocity magnitude + gravity magnitude) x bounce value] should help alleviate unwanted jittering. So if your jittering particles have an average velocity magnitude of 0.5 (just prior to re-hitting the surface), and the magnitude of your gravity force is 1.0, and your collision operator’s bounce value is set to 50%, you should set the bounce threshold to [(0.5 + 1) x 0.5], or 0.75.

You can see particle velocity magnitude values by adding a “Display Data” operator to your event(s), and enabling the “Velocity” data checkbox.