Scene
WL.Scene
Provides global scene functionality like raycasting.
Kind: static class of WL
.activeViews ⇒ Array.<ViewComponent>
Kind: instance property of Scene
Returns: Array.<ViewComponent> - currently active view components
.rayCast(o, d, group)
Cast a ray through the 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 Scene
Note: The returned RayHit object is owned by the Scene 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. |
.addObject(parent) ⇒ Object
Add object to the scene
Kind: instance method of Scene
Returns: Object - newly created object
Param | Type | Description |
---|---|---|
parent | Object | Parent object or null |