Queries (sim-free)

Ask spatial questions — "is this inside that zone?", "are these points touching?", "what does this ray hit?" — without running a full simulation.

Sometimes you don't want physics. You don't need gravity, mass, or a solver chewing every frame — you just want to ask a question about where things are and react to the answer. That's what the Query nodes are for. They're fast, they run on ordinary graph geometry, and they're perfect for game-style logic: pickups, kill zones, checkpoints, doors, contact sparks, and aiming.

Trigger zones

The query.trigger node answers the simplest spatial question: which of these elements are inside that region?

You feed it a set of points (your elements) and a zone. The zone can be almost anything — a primitive shape, an Analytic shape, a mesh, a raster, or a Distance Field — DNA converts it to a region automatically. Anything inside comes out the inside pin; every element also gets tagged with its signed @distance to the zone's surface, so you can fade, scale, or colour by proximity.

Because the zone is evaluated wherever your query points are, a moving zone is free — animate it, drive it from a Pointer, and the test follows along with no extra cost.

ParameterTypeDefault
elementsOneOf([Collection])
zoneOneOf([FieldOf(Sdf)])
radiusNumber0
track_identityBooleanfalse
opacityNumber1

Enter / exit events

Turn on Track identity and the Trigger remembers what was inside last frame. As long as your elements carry an @id (points from sop.scatter or a particle sim do), you get three extra streams:

This is exactly what you want for a pickup that fires once on entry, or a checkpoint that triggers a sound the moment a runner crosses it.

The radius parameter controls how the test is done. Leave it at 0 for a pure point test (the element's centre must be inside). Raise it to treat each element as a little sphere — handy when a point should count as "inside" the moment its edge touches the zone.

Contact detection

query.collision_detect is the next step up: instead of a yes/no region test, it reports which points of one piece of geometry are touching the surface of another — and hands you the contact detail.

Feed it a mesh as geometry_a and a surface as geometry_b (again, mesh / Analytic shape / raster / Distance Field, all auto-converted). Any of A's points within the threshold distance of B's surface come out the contacts pin, each carrying:

Use it to spawn effects exactly where things touch, snap geometry to a surface, or build your own custom contact response — all without registering anything in a solver.

ParameterTypeDefault
geometry_aGpuGeometry
geometry_bOneOf([FieldOf(Sdf)])
max_pairsNumber10000
thresholdNumber0.100
track_identityBooleanfalse
opacityNumber1

Collision Detect tests points against a surface, not full triangle-against-triangle intersection. It's a proximity check: a point counts as touching when it's close enough to B's surface. That's the right tool for the vast majority of gameplay and effects work, and it's far lighter than true mesh intersection. It also supports the same Track identity enter/exit streams as the Trigger.

Raycasts and overlaps

Physics Query casts rays and sweeps shapes against the colliders you've set up in a physics world. It's the node for aiming, line-of-sight, ground-snapping, and "what's near this point?" lookups.

It runs four kinds of query:

Every query reports a rich set of outputs: whether it hit, the hit point, the hit normal, the distance, which body was hit, an overlap count, and whether the origin started inside a collider. Wire those into expressions or other nodes to drive your logic.

ParameterTypeDefault
world_idString"default"
query_typeString"Raycast"
origin_xNumber0
origin_yNumber100
origin_zNumber0
direction_xNumber0
direction_yNumber-1
direction_zNumber0
max_distanceNumber1000
query_shapeString"Ball"
query_radiusNumber5
query_half_xNumber5
query_half_yNumber5
query_half_zNumber5
opacityNumber1

Physics Query tests against the colliders registered in a physics world (the static colliders and bodies you've set up), not against arbitrary graph geometry. If you want to query against a loose mesh or shape with no solver involved, reach for Trigger or Collision Detect instead — they take any geometry directly.

Which one do I want?

All three are sim-free in spirit — Trigger and Collision Detect don't need a solver at all, and Physics Query reads a world without stepping it — so they're cheap to scatter throughout a graph for interactive, game-style behaviour.

See also