Scene Class
The Scene class contains the objects that are rendered with the WebGLRenderer
Constructor
Scene
-
[parameters]
Parameters:
-
[parameters]Object optionalParameters is an object that contains the Scenes properties
-
[ambientLight=new LE.AmbientLight(new LE.Colour(255, 255, 255, 255))]AmbientLight optionalDefault value is an ambient light with maximum brightness.
-
Item Index
Methods
Methods
addLight
-
light
Adds a PointLight, DirectionalLight or RadialPointLight to the scene
Parameters:
-
lightObject
addObject
-
object
Adds a Polygon or Texture to the scene. This object will not cast shadows
Parameters:
-
objectObject
addShadowObject
-
object
Adds a Polygon or Texture to the scene. This object will cast shadows
Parameters:
-
objectObject
assignTextureIndices
-
array -
i
Assigns a texture index to an object
Parameters:
-
arrayArray -
iNumberIndex in the given array
comparePolygons
-
object1 -
object2
Checks if a given polygon is equal to another polygon
Parameters:
-
object1Object -
object2Object
handleLoadedTexture
-
texture
Prepares the loaded texture for WebGL use
Parameters:
-
textureObject
init
-
gl
Initialise the scene with a WebGL context
Parameters:
-
glObject
initBuffers
-
gl
Initialise all buffers, this includes object, texture and light buffers
Parameters:
-
glObject
initLightBuffer
-
array -
i
Initialise a light buffer
Parameters:
-
arrayArray -
iNumberIndex in the given array
initPolygonBuffer
-
array -
i
Initialise a polygon buffer
Parameters:
-
arrayArray -
iNumberIndex in the given array
initTextureBuffer
-
array -
i
Initialise a texture buffer
Parameters:
-
arrayArray -
iNumberIndex in the given array
initTextures
()
private
Initialises all textures
removeLight
-
light
Removes a PointLight, DirectionalLight or RadialPointLight from the scene
Parameters:
-
lightObject
removeObject
-
object
Removes a Polygon or Texture from the scene. This object does not cast shadows
Parameters:
-
objectObject
removeShadowObject
-
object
Removes a Polygon or Texture from the scene. This object casts shadows
Parameters:
-
objectObject
Properties
ambientLight
AmbientLight
Stores the ambient light
Default: new LE.AmbientLight(new LE.Colour(255, 255, 255, 255))
gl
Object
private
Stores a reference to the WebGL canvas context
lightBuffers
Array
private
Stores all the WebGL light vertex buffers
lights
Array
private
Stores the lights
objectBuffers
Array
private
Stores all the WebGL vertex buffers
objectColourBuffers
Array
private
Stores all the WebGL colour vertex buffers
objectIndexBuffers
Array
private
Stores all the WebGL object indices
objects
Array
private
Stores the objects that do not cast shadows
objectTextureBuffers
Array
private
Stores all the WebGL texture vertex buffers
shadowBuffers
Array
private
Stores all the WebGL shadow vertex buffers
shadowColourBuffers
Array
private
Stores all the WebGL shadow colour vertex buffers
shadowObjects
Array
private
Stores the objects that cast shadows
textures
Array
private
Stores all the texture data to be rendered by WebGL
