Optional
raw: RawQueryPipelineFind the closest intersection between a ray and a set of collider.
The set of colliders taking part in this pipeline.
The ray to cast.
The maximum time-of-impact that can be reported by this cast. This effectively
limits the length of the ray to ray.dir.norm() * maxToi
.
If false
then the ray will attempt to hit the boundary of a shape, even if its
origin already lies inside of a shape. In other terms, true
implies that all shapes are plain,
whereas false
implies that all shapes are hollow for this ray-cast.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Find the closest intersection between a ray and a set of collider.
This also computes the normal at the hit point.
The set of colliders taking part in this pipeline.
The ray to cast.
The maximum time-of-impact that can be reported by this cast. This effectively
limits the length of the ray to ray.dir.norm() * maxToi
.
If false
then the ray will attempt to hit the boundary of a shape, even if its
origin already lies inside of a shape. In other terms, true
implies that all shapes are plain,
whereas false
implies that all shapes are hollow for this ray-cast.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Casts a shape at a constant linear velocity and retrieve the first collider it hits. This is similar to ray-casting except that we are casting a whole shape instead of just a point (the ray origin).
The set of colliders taking part in this pipeline.
The initial position of the shape to cast.
The initial rotation of the shape to cast.
The constant velocity of the shape to cast (i.e. the cast direction).
The shape to cast.
− If the shape moves closer to this distance from a collider, a hit will be returned.
The maximum time-of-impact that can be reported by this cast. This effectively
limits the distance traveled by the shape to shapeVel.norm() * maxToi
.
If set to false
, the linear shape-cast won’t immediately stop if
the shape is penetrating another shape at its starting point and its trajectory is such
that it’s on a path to exist that penetration state.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Finds the handles of all the colliders with an AABB intersecting the given AABB.
The center of the AABB to test.
The half-extents of the AABB to test.
The callback that will be called with the handles of all the colliders currently intersecting the given AABB.
Gets the handle of up to one collider intersecting the given shape.
The set of colliders taking part in this pipeline.
The position of the shape used for the intersection test.
The orientation of the shape used for the intersection test.
The shape used for the intersection test.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Find all the colliders containing the given point.
The set of colliders taking part in this pipeline.
The point used for the containment test.
A function called with the handles of each collider with a shape
containing the point
.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Cast a ray and collects all the intersections between a ray and the scene.
The set of colliders taking part in this pipeline.
The ray to cast.
The maximum time-of-impact that can be reported by this cast. This effectively
limits the length of the ray to ray.dir.norm() * maxToi
.
If false
then the ray will attempt to hit the boundary of a shape, even if its
origin already lies inside of a shape. In other terms, true
implies that all shapes are plain,
whereas false
implies that all shapes are hollow for this ray-cast.
The callback called once per hit (in no particular order) between a ray and a collider.
If this callback returns false
, then the cast will stop and no further hits will be detected/reported.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Retrieve all the colliders intersecting the given shape.
The set of colliders taking part in this pipeline.
The position of the shape to test.
The orientation of the shape to test.
The shape to test.
A function called with the handles of each collider intersecting the shape
.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Find the projection of a point on the closest collider.
The set of colliders taking part in this pipeline.
The point to project.
If this is set to true
then the collider shapes are considered to
be plain (if the point is located inside of a plain shape, its projection is the point
itself). If it is set to false
the collider shapes are considered to be hollow
(if the point is located inside of an hollow shape, it is projected on the shape's
boundary).
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Find the projection of a point on the closest collider.
The set of colliders taking part in this pipeline.
The point to project.
Optional
filterFlags: QueryFilterFlagsOptional
filterGroups: numberOptional
filterExcludeCollider: numberOptional
filterExcludeRigidBody: numberOptional
filterPredicate: ((collider: number) => boolean)Updates the acceleration structure of the query pipeline.
The set of rigid-bodies taking part in this pipeline.
The set of colliders taking part in this pipeline.
Generated using TypeDoc
A pipeline for performing queries on all the colliders of a scene.
To avoid leaking WASM resources, this MUST be freed manually with
queryPipeline.free()
once you are done using it (and all the rigid-bodies it created).