new Scene(canvas)
Creates a new scene
Parameters:
Name | Type | Description |
---|---|---|
canvas |
- Source:
Methods
addToScene(object)
Adds light, object or sound to scene
Parameters:
Name | Type | Description |
---|---|---|
object |
Ayce.Light | Ayce.Object3D | Ayce.Sound |
- Source:
drawScene()
Draws objects that have been added to the scene
- Source:
getCamera() → {Ayce.Camera}
Returns camera object
- Source:
Returns:
camera
- Type
- Ayce.Camera
removeFromScene(object)
Removes light, object or sound from scene
Parameters:
Name | Type | Description |
---|---|---|
object |
Ayce.Light | Ayce.Object3D | Ayce.Sound |
- Source:
resize()
Should be called on window resize
- Source:
setRenderer(rendererObject)
Sets current renderer
Parameters:
Name | Type | Description |
---|---|---|
rendererObject |
Ayce.Renderer |
- Source:
setRendererDesktop()
Sets up rendering for desktop browsers
- Source:
setRendererNull()
Removes current renderer
- Source:
setRendererVR(distorted)
Sets up rendering for VR on mobile browsers
Parameters:
Name | Type | Description |
---|---|---|
distorted |
Boolean |
- Source:
updateScene()
Updates input, camera, lights, objects, renderer and sound
- Source:
useCardboard(distorted)
Call for VR rendering for Google Cardboard (and similar viewers). Parameter used to toggle barrel distortion and color abberation on and off.
Parameters:
Name | Type | Description |
---|---|---|
distorted |
Boolean |
- Source:
useMotionSensor()
Sets up motion sensors as input for Google Cardboard (and similar viewers).
- Source:
useWebVR() → {Boolean}
Returns true if WebVR compatible browser is being used
- Source:
Returns:
isWebVR
- Type
- Boolean