Class enchant.gl.Scene3D
- Defined in: gl.enchant.js
- Extends enchant.EventTarget
Constructor Attributes | Constructor Name and Description |
---|---|
Class for displayed Sprite3D tree route.
|
Field Attributes | Field Name and Description |
---|---|
Scene3D background color
|
|
Child element array.
|
|
Lighting array.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addChild(sprite)
Add Sprite3D to scene.
|
|
addLight(light)
Add lighting to scene.
|
|
Gets ambient light source in scene.
|
|
Gets camera source in scene.
|
|
Gets directional light source in scene.
|
|
removeChild(sprite)
Delete Sprite3D from scene.
|
|
removeLight(light)
Delete lighting from scene
|
|
setAmbientLight(light)
Sets ambient light source in scene.
|
|
setCamera(camera)
Sets scene's camera postion.
|
|
setDirectionalLight(light)
Sets directional light source in scene.
|
- Methods borrowed from class enchant.EventTarget:
- addEventListener
- clearEventListener
- dispatchEvent
- on
- removeEventListener
Class Detail
enchant.gl.Scene3D()
Class for displayed Sprite3D tree route.
Currently, multiple definitions are impossible, and the Scene3D defined first will be returned.
var scene = new Scene3D(); var sprite = new Sprite3D(); scene.addChild(sprite);
Field Detail
{Number[]}
backgroundColor
Scene3D background color
{enchant.gl.Sprite3D[]}
childNodes
Child element array.
A list of Sprite3D added as child classes in this scene can be acquired.
When adding or subtracting child classes, without directly operating this array,
enchant.gl.Scene3D#addChild or enchant.gl.Scene3D#removeChild is used.
{enchant.gl.PointLight[]}
lights
Lighting array.
At present, the only light source active in the scene is 0.
Acquires a list of light sources acquired in this scene.
When lighting is added or deleted, without directly operating this array,
enchant.gl.Scene3D#addLight or enchant.gl.Scene3D#removeLight is used.
Method Detail
-
addChild(sprite)Add Sprite3D to scene. Adds Sprite3D delivered to argument and child classes to scene. Sprite3D will automatically be displayed on screen if added to scene. Use enchant.gl.Scene3D#removeChild to delete object added once.
- Parameters:
- {enchant.gl.Sprite3D} sprite
- Sprite3D to be added
-
addLight(light)Add lighting to scene. Currently, will not be used even if added to scene.
- Parameters:
- {enchant.gl.PointLight} light
- Lighting to add
-
{enchant.gl.AmbientLight} getAmbientLight()Gets ambient light source in scene.
- Returns:
- {enchant.gl.AmbientLight}
- See:
- enchant.gl.AmbientLight
-
{enchant.gl.Camera} getCamera()Gets camera source in scene.
- Returns:
- {enchant.gl.Camera}
- See:
- enchant.gl.Camera3D
-
{enchant.gl.DirectionalLight} getDirectionalLight()Gets directional light source in scene.
- Returns:
- {enchant.gl.DirectionalLight}
- See:
- enchant.gl.DirectionalLight
-
removeChild(sprite)Delete Sprite3D from scene. Deletes designated Sprite3D from scene. The deleted Sprite3D will no longer be displayed on the screen. Use enchant.gl.Scene3D#addChild to add Sprite3D.
- Parameters:
- {enchant.gl.Sprite3D} sprite
- Sprite3D to delete
-
removeLight(light)Delete lighting from scene
- Parameters:
- {enchant.gl.PointLight} light
- Lighting to delete
- See:
- enchant.gl.PointLight.
-
setAmbientLight(light)Sets ambient light source in scene.
- Parameters:
- {enchant.gl.AmbientLight} light
- Lighting to set
-
setCamera(camera)Sets scene's camera postion.
- Parameters:
- {enchant.gl.Camera3D} camera
- Camera to set
- See:
- enchant.gl.Camera3D
-
setDirectionalLight(light)Sets directional light source in scene.
- Parameters:
- {enchant.gl.DirectionalLight} light
- Lighting to set