28 using EntityFilter_t = std::function<bool(
Entity)>;
29 static constexpr auto EntityFilterAll = [](
Entity) {
return true; };
57 std::vector<TestShapeHit>
hits;
94 std::unique_ptr<class CollisionQueryImpl> m_impl;
Interface for performing collision querries against rigid bodies.
Definition: CollisionQuery.h:62
auto TestPoint(const Vector3 &point) const -> std::vector< Entity >
Query for all bodies that contain a point.
auto CastRay(const Ray &ray) const -> RayCastResult
Query for the first body that a ray intersects.
CollisionQuery(const CollisionQueryFilter &filter=CollisionQueryFilter{})
Construct a CollisionQuery capable of testing against bodies which pass a filter.
auto TestShape(const Shape &shape, const Vector3 &position=Vector3::Zero(), const Quaternion &rotation=Quaternion::Identity()) const -> TestShapeResult
Query for all bodies that collide with a shape.
Handle to a processed Shape instance.
Definition: CookedShape.h:32
Identifies an object in the registry.
Definition: Entity.h:18
static constexpr auto Null() noexcept
Construct a null Entity.
Definition: Entity.h:61
Parameter controlling inclusion and exclusion of bodies from a CollisionQuery.
Definition: CollisionQuery.h:27
bool includeStatic
include static bodies in queries
Definition: CollisionQuery.h:32
EntityFilter_t entityFilter
include only bodies passing a custom filter (non-null)
Definition: CollisionQuery.h:31
bool includeTrigger
include triggers in queries
Definition: CollisionQuery.h:34
bool includeDynamic
include dynamic and kinematic bodies in queries
Definition: CollisionQuery.h:33
Quaternion type for representing 3D rotations.
Definition: Quaternion.h:13
Result of a raycast query.
Definition: CollisionQuery.h:39
Vector3 surfaceNormal
surface normal on the hit body
Definition: CollisionQuery.h:42
Vector3 point
worldspace point where the ray intersects the body
Definition: CollisionQuery.h:41
Entity hit
parent Entity of the first hit body or Entity::Null()
Definition: CollisionQuery.h:40
Ray used for performing raycast queries.
Definition: CollisionQuery.h:20
Vector3 origin
origin of the ray
Definition: CollisionQuery.h:21
Vector3 direction
combined direction and distance of the ray
Definition: CollisionQuery.h:22
Describes collision geometry for physics types.
Definition: Shape.h:31
Individual hit information from a shape test query.
Definition: CollisionQuery.h:47
Entity hit
the body that was collided with
Definition: CollisionQuery.h:48
float depth
penetration depth of the collision
Definition: CollisionQuery.h:51
Vector3 collisionNormal
collision resolution normal pointing from shape towards hit
Definition: CollisionQuery.h:50
Vector3 point
worldspace contact point on the surface of the hit body
Definition: CollisionQuery.h:49
Result of a shape collide query.
Definition: CollisionQuery.h:56
std::vector< TestShapeHit > hits
0 or more hit results
Definition: CollisionQuery.h:57
A three component vector.
Definition: Vector.h:29