Function physicsRaycast
-
Parameters
- world: PhysicsWorld
The physics world to query.
- from: Vec3
World-space ray origin.
- to: Vec3
World-space ray end point.
- query: RaycastQuery = {}
Optional collision-filter masks and trigger behaviour.
Returns RaycastResult
The raycast result;
hasHitisfalsewhen the ray clears every matching body. - world: PhysicsWorld
Cast a ray from
fromtotoand return the first body it hits.collideWith/membershipfilter which bodies the ray can hit (by their shape filter masks). For MESH shapes the hit triangle index is reported; non-mesh shapes report-1. Run at least one physics step first so the broadphase exists.