Physics
Physics
Access to the physics scene
Kind: global class
.rayCast (o, d, group, maxDistance)
Cast a ray through the physics scene and find intersecting objects.
The resulting ray hit will contain up to 4 closest ray hits, sorted by increasing distance.
Kind: instance method of Physics
Note: The returned RayHit object is owned by the Physics instance and
will be reused with the next rayCast call.
Param | Type | Description |
---|---|---|
o | Array.<number> | Ray origin |
d | Array.<number> | Ray direction |
group | number | Collision group to filter by: only objects that are part of given group are considered for raycast. |
maxDistance | number | Maximum ray distance, default 100.0 . |