Struct bevy_rapier3d::prelude::QueryPipeline[][src]

pub struct QueryPipeline { /* fields omitted */ }
Expand description

A pipeline for performing queries on all the colliders of a scene.

Implementations

Initializes an empty query pipeline.

Initializes an empty query pipeline with a custom QueryDispatcher.

Use this constructor in order to use a custom QueryDispatcher that is aware of your own user-defined shapes.

The query dispatcher used by this query pipeline for running scene queries.

Update the acceleration structure on the query pipeline.

Update the acceleration structure on the query pipeline.

Find the closest intersection between a ray and a set of collider.

Parameters

  • position: the position of this shape.
  • ray: the ray to cast.
  • max_toi: the maximum time-of-impact that can be reported by this cast. This effectively limits the length of the ray to ray.dir.norm() * max_toi. Use Real::MAX for an unbounded ray.
  • solid: if this is true an impact at time 0.0 (i.e. at the ray origin) is returned if it starts inside of a shape. If this false then the ray will hit the shape’s boundary even if its starts inside of it.
  • query_groups: the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter: a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Find the closest intersection between a ray and a set of collider.

Parameters

  • position: the position of this shape.
  • ray: the ray to cast.
  • max_toi: the maximum time-of-impact that can be reported by this cast. This effectively limits the length of the ray to ray.dir.norm() * max_toi. Use Real::MAX for an unbounded ray.
  • solid: if this is true an impact at time 0.0 (i.e. at the ray origin) is returned if it starts inside of a shape. If this false then the ray will hit the shape’s boundary even if its starts inside of it.
  • query_groups: the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter: a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Find the all intersections between a ray and a set of collider and passes them to a callback.

Parameters

  • position: the position of this shape.
  • ray: the ray to cast.
  • max_toi: the maximum time-of-impact that can be reported by this cast. This effectively limits the length of the ray to ray.dir.norm() * max_toi. Use Real::MAX for an unbounded ray.
  • solid: if this is true an impact at time 0.0 (i.e. at the ray origin) is returned if it starts inside of a shape. If this false then the ray will hit the shape’s boundary even if its starts inside of it.
  • query_groups: the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter: a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.
  • callback: function executed on each collider for which a ray intersection has been found. There is no guarantees on the order the results will be yielded. If this callback returns false, this method will exit early, ignore any further raycast.

Gets the handle of up to one collider intersecting the given shape.

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • shape_pos - The position of the shape used for the intersection test.
  • shape - The shape used for the intersection test.
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Find the projection of a point on the closest collider.

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • point - The point to project.
  • solid - 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).
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Find all the colliders containing the given point.

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • point - The point used for the containment test.
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.
  • callback - A function called with each collider with a shape containing the point.

Find the projection of a point on the closest collider.

The results include the ID of the feature hit by the point.

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • point - The point to project.
  • solid - 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).
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Finds all handles of all the colliders with an AABB intersecting the given AABB.

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).

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • shape_pos - The initial position of the shape to cast.
  • shape_vel - The constant velocity of the shape to cast (i.e. the cast direction).
  • shape - The shape to cast.
  • max_toi - 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.
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Casts a shape with an arbitrary continuous motion and retrieve the first collider it hits.

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • shape_motion - The motion of the shape.
  • shape - The shape to cast.
  • start_time - The starting time of the interval where the motion takes place.
  • end_time - The end time of the interval where the motion takes place.
  • stop_at_penetration - If the casted shape starts in a penetration state with any collider, two results are possible. If stop_at_penetration is true then, the result will have a toi equal to start_time. If stop_at_penetration is false then the nonlinear shape-casting will see if further motion wrt. the penetration normal would result in tunnelling. If it does not (i.e. we have a separating velocity along that normal) then the nonlinear shape-casting will attempt to find another impact, at a time > start_time that could result in tunnelling.
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.

Retrieve all the colliders intersecting the given shape.

Parameters

  • colliders - The set of colliders taking part in this pipeline.
  • shapePos - The position of the shape to test.
  • shapeRot - The orientation of the shape to test.
  • shape - The shape to test.
  • query_groups - the interaction groups which will be tested against the collider’s contact_group to determine if it should be taken into account by this query.
  • filter - a more fine-grained filter. A collider is taken into account by this query if its contact_group is compatible with the query_groups, and if this filter is either None or returns true.
  • callback - A function called with the handles of each collider intersecting the shape.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Creates Self using data from the given [World]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.