Physics3DQueries class final

Rays, sweeps and overlaps against a PhysicsWorld3D, answered in entities. Physics3D.queries is one.

Before the system has made its world (no 3-D body yet) every query finds nothing.

Every query takes a layer mask (one bit per layer; all by default), an entity to pass over (the one asking, say), and whether sensors count (not by default).

Constructors

Physics3DQueries(PhysicsSystem3D system)
Queries on system's world, naming entities through it.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
system → PhysicsSystem3D
Steps the world asked, and knows which entity owns which body.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overlap(Shape3D shape, Vector3 position, Quaternion rotation, {int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → List<Entity>
The entities whose bodies shape at position and rotation overlaps.
overlapBox(Vector3 center, Vector3 halfExtents, {Quaternion? rotation, int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → List<Entity>
The entities whose bodies a box of halfExtents at center overlaps.
overlapSphere(Vector3 center, double radius, {int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → List<Entity>
The entities whose bodies a sphere at center overlaps.
raycast(Vector3 origin, Vector3 direction, {double maxDistance = 1000, int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → PhysicsHit3D?
The first thing a ray from origin along direction hits within maxDistance, or null.
raycastAll(Vector3 origin, Vector3 direction, {double maxDistance = 1000, int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → List<PhysicsHit3D>
Everything a ray hits within maxDistance, nearest first.
shapeCast(Shape3D shape, Vector3 position, Quaternion rotation, Vector3 direction, {double maxDistance = 1000, int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → PhysicsHit3D?
The first thing shape swept from position and rotation along direction hits within maxDistance, or null.
sphereCast(Vector3 origin, double radius, Vector3 direction, {double maxDistance = 1000, int layerMask = 0xFFFF, Entity? ignore, bool includeSensors = false}) → PhysicsHit3D?
The first thing a sphere of radius swept from origin along direction hits within maxDistance, or null (a camera keeping out of walls, a thick bullet).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited