PhysicsQuery

interface PhysicsQuery

Types

Link copied to clipboard
data class Filter(val flags: Int = 0, val group: InteractionGroup = InteractionGroup.all, val excludeCollider: ColliderKey? = null, val excludeRigidBody: RigidBodyKey? = null, val predicate: (Collider, ColliderKey) -> PhysicsQuery.Result? = null)
Link copied to clipboard
interface Intersect
Link copied to clipboard
data class PointProject(val collider: ColliderKey, val point: DVec3, val wasInside: Boolean, val feature: PhysicsQuery.ShapeFeature)
Link copied to clipboard
data class RayCast(val collider: ColliderKey, val hitTime: Double, val normal: DVec3, val feature: PhysicsQuery.ShapeFeature)
Link copied to clipboard
@ConfigSerializable
data class RayCastSettings(val isSolid: Boolean)
Link copied to clipboard
Link copied to clipboard
data class ShapeCast(val collider: ColliderKey, val intersect: PhysicsQuery.Intersect)
Link copied to clipboard
@ConfigSerializable
data class ShapeCastSettings(val stopAtPenetration: Boolean)
Link copied to clipboard
interface ShapeFeature

Functions

Link copied to clipboard
abstract fun castRay(ray: DRay3, maxDistance: Double, settings: PhysicsQuery.RayCastSettings, filter: PhysicsQuery.Filter, fn: (PhysicsQuery.RayCast) -> PhysicsQuery.Result)

Gets every collider whose shape intersects ray, up to a maximum distance of maxDistance away from DRay3.origin.

Link copied to clipboard
open fun castRayAll(ray: DRay3, maxDistance: Double, settings: PhysicsQuery.RayCastSettings, filter: PhysicsQuery.Filter): List<PhysicsQuery.RayCast>

Gets every collider whose shape intersects ray, up to a maximum distance of maxDistance away from DRay3.origin.

Link copied to clipboard
open fun castRayFirst(ray: DRay3, maxDistance: Double, settings: PhysicsQuery.RayCastSettings, filter: PhysicsQuery.Filter): PhysicsQuery.RayCast?

Gets every collider whose shape intersects ray, up to a maximum distance of maxDistance away from DRay3.origin.

Link copied to clipboard
abstract fun castShape(shape: Shape, shapePos: DIso3, shapeDir: DVec3, maxDistance: Double, settings: PhysicsQuery.ShapeCastSettings, filter: PhysicsQuery.Filter): PhysicsQuery.ShapeCast?

Gets the first collider whose shape intersects a swept version of the provided shape. The swept shape starts at shapePos and travels in shapeDir up to a distance of maxDistance.

Link copied to clipboard
abstract fun castShapeNonLinear(shape: Shape, shapePos: DIso3, shapeLocalCenter: DVec3, shapeLinVel: DVec3, shapeAngVel: DVec3, timeStart: Double, timeEnd: Double, settings: PhysicsQuery.ShapeCastSettings, filter: PhysicsQuery.Filter): PhysicsQuery.ShapeCast?

Gets the first collider whose shape intersects a swept version of the provided shape. The swept shape starts at shapePos and travels:

Link copied to clipboard
abstract fun intersectBounds(bounds: DAabb3, fn: (ColliderKey) -> PhysicsQuery.Result)

Gets every collider whose broad-phase bounding box (Collider.bounds) intersects with bounds, in no specific ordering.

Link copied to clipboard
open fun intersectBoundsAll(bounds: DAabb3): List<ColliderKey>

Gets every collider whose broad-phase bounding box (Collider.bounds) intersects with bounds, in no specific ordering.

Link copied to clipboard
open fun intersectBoundsFirst(bounds: DAabb3): ColliderKey?

Gets every collider whose broad-phase bounding box (Collider.bounds) intersects with bounds, in no specific ordering.

Link copied to clipboard
abstract fun intersectPoint(point: DVec3, filter: PhysicsQuery.Filter, fn: (ColliderKey) -> PhysicsQuery.Result)

Gets every collider which contains point inside of its shape.

Link copied to clipboard
open fun intersectPointAll(point: DVec3, filter: PhysicsQuery.Filter): List<ColliderKey>

Gets every collider which contains point inside of its shape.

Link copied to clipboard
open fun intersectPointFirst(point: DVec3, filter: PhysicsQuery.Filter): ColliderKey?

Gets every collider which contains point inside of its shape.

Link copied to clipboard
abstract fun intersectShape(shape: Shape, shapePos: DIso3, filter: PhysicsQuery.Filter, fn: (ColliderKey) -> PhysicsQuery.Result)

Gets every collider whose shape intersects shape if that shape was positioned at shapePos.

Link copied to clipboard
open fun intersectShapeAll(shape: Shape, shapePos: DIso3, filter: PhysicsQuery.Filter): List<ColliderKey>

Gets every collider whose shape intersects shape if that shape was positioned at shapePos.

Link copied to clipboard
open fun intersectShapeFirst(shape: Shape, shapePos: DIso3, filter: PhysicsQuery.Filter): ColliderKey?

Gets every collider whose shape intersects shape if that shape was positioned at shapePos.

Link copied to clipboard
abstract fun projectPoint(point: DVec3, filter: PhysicsQuery.Filter): PhysicsQuery.PointProject?

Projects a point onto the closest collider to that point.