Collection of functions that do ray casting.
More...
|
RayCastOutput | playrho::d2::RayCast (const ::playrho::detail::AABB< 2 > &aabb, const RayCastInput &input) noexcept |
| Cast a ray against the given AABB. More...
|
|
RayCastOutput | RayCast (const DistanceProxy &proxy, const RayCastInput &input, const Transformation &transform) noexcept |
| Cast a ray against the distance proxy. More...
|
|
RayCastOutput | playrho::d2::RayCast (const DistanceProxy &proxy, const RayCastInput &input, const Transformation &transform) noexcept |
| Cast a ray against the distance proxy. More...
|
|
bool | playrho::d2::RayCast (const DynamicTree &tree, RayCastInput input, const DynamicTreeRayCastCB &callback) |
| Cast rays against the leafs in the given tree. More...
|
|
RayCastOutput | RayCast (const Shape &shape, ChildCounter childIndex, const RayCastInput &input, const Transformation &transform) noexcept |
| Cast a ray against the child of the given shape. More...
|
|
RayCastOutput | playrho::d2::RayCast (const Shape &shape, ChildCounter childIndex, const RayCastInput &input, const Transformation &transform) noexcept |
| Cast a ray against the child of the given shape. More...
|
|
bool | RayCast (const World &world, const RayCastInput &input, const ShapeRayCastCB &callback) |
| Ray-cast the world for all fixtures in the path of the ray. More...
|
|
bool | playrho::d2::RayCast (const World &world, const RayCastInput &input, const ShapeRayCastCB &callback) |
| Ray-cast the world for all fixtures in the path of the ray. More...
|
|
RayCastOutput | playrho::d2::RayCast (Length radius, const Length2 &location, const RayCastInput &input) noexcept |
| Cast a ray against a circle of a given radius at the given location. More...
|
|
Collection of functions that do ray casting.
◆ RayCast() [1/9]
Cast a ray against the given AABB.
- Parameters
-
aabb | Axis Aligned Bounding Box. |
input | the ray-cast input parameters. |
◆ RayCast() [2/9]
Cast a ray against the distance proxy.
- Parameters
-
proxy | Distance-proxy object (in local coordinates). |
input | Ray-cast input parameters. |
transform | Transform to be applied to the distance-proxy to get world coordinates. |
◆ RayCast() [3/9]
Cast a ray against the distance proxy.
- Parameters
-
proxy | Distance-proxy object (in local coordinates). |
input | Ray-cast input parameters. |
transform | Transform to be applied to the distance-proxy to get world coordinates. |
◆ RayCast() [4/9]
Cast rays against the leafs in the given tree.
- Note
- This relies on the callback to perform an exact ray-cast in the case where the leaf node contains a shape.
-
The callback also performs collision filtering.
-
Performance is roughly k * log(n), where k is the number of collisions and n is the number of leaf nodes in the tree.
- Parameters
-
tree | Dynamic tree to ray cast. |
input | the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1) . |
callback | A callback instance function that's called for each leaf that is hit by the ray. The callback should return 0 to terminate ray casting, or greater than 0 to update the segment bounding box. Values less than zero are ignored. |
- Returns
true
if terminated at the callback's request, false
otherwise.
◆ RayCast() [5/9]
Cast a ray against the child of the given shape.
- Note
- This is a convenience function for calling the ray cast against a distance-proxy.
- Parameters
-
shape | Shape. |
childIndex | Child index. |
input | the ray-cast input parameters. |
transform | Transform to be applied to the child of the shape. |
◆ RayCast() [6/9]
Cast a ray against the child of the given shape.
- Note
- This is a convenience function for calling the ray cast against a distance-proxy.
- Parameters
-
shape | Shape. |
childIndex | Child index. |
input | the ray-cast input parameters. |
transform | Transform to be applied to the child of the shape. |
◆ RayCast() [7/9]
Ray-cast the world for all fixtures in the path of the ray.
- Note
- The callback controls whether you get the closest point, any point, or n-points.
-
The ray-cast ignores shapes that contain the starting point.
- Parameters
-
world | The world instance to raycast in. |
input | Ray cast input data. |
callback | A user implemented callback function. |
- Returns
true
if terminated by callback, false
otherwise.
◆ RayCast() [8/9]
Ray-cast the world for all fixtures in the path of the ray.
- Note
- The callback controls whether you get the closest point, any point, or n-points.
-
The ray-cast ignores shapes that contain the starting point.
- Parameters
-
world | The world instance to raycast in. |
input | Ray cast input data. |
callback | A user implemented callback function. |
- Returns
true
if terminated by callback, false
otherwise.
◆ RayCast() [9/9]