Collide

Collide

Function. Bounces particles off static collision surfaces — planes, spheres, boxes and capsules.

Each frame the block tests the segment the particle travelled, from its previous position to its current one, against every primitive of its surface. On contact it rewrites the position and velocity according to the response settings of the primitive that was hit.

Because the test uses the whole segment rather than just the end point, fast particles cannot tunnel through thin surfaces. Up to three contacts are resolved per frame, so a particle driven into a corner bounces off both walls in the same frame instead of leaking through.

Typically you connect the outputs of a ForceMove (or Move) block as inputs, and route the outputs into the Position and Velocity updaters, so the corrected values are what the particle keeps.

Properties & inputs:

  • Position (input): Current position, after movement.
  • Velocity (input): Current velocity, after movement.
  • Prev. position (input): Position before movement. Together with Position it forms the segment that is tested.
  • Particle radius (input | property): Radius of the particle for collision purposes. The particle bounces as a sphere of this size, so its surface — not its centre — touches the primitive. Zero, the default, treats the particle as a point. This is a physics setting, independent of the particle's rendered size: set it to match your geometry if you want the two to agree.
  • Surface (property): The set of collision primitives. Edit it in the preview viewport — add planes, spheres, boxes and capsules, then move, rotate and scale them with the gizmo.
  • Default mode / restitution / friction (property): The response settings a newly added primitive starts with. Each primitive can then override them.
  • Show visualizer (property): Draw the surface in the preview while the block is not being edited.

Outputs:

  • Position: Position after the collision response.
  • Velocity: Velocity after the collision response.

Response modes (per primitive):

  • Bounce: Reflects the particle off the surface. Restitution controls how much speed is kept — 0 stops it dead against the surface, 1 gives a full bounce.
  • Friction: Slides along the surface without bouncing. Friction controls how quickly the tangential speed is lost — 0 slides freely, 1 stops it.
  • Stick: Pins the particle to the point of contact and zeroes its velocity.

Notes:

  • Collisions are with the authored surface only. Particles do not collide with each other.
  • The surface is static: it does not move with the particles it deflects.
  • With a non-zero Particle radius, edges and corners of boxes and of finite planes are rounded by that radius, so a particle rolling over an edge is deflected smoothly rather than catching on a sharp corner.