API Documentation
Classes
- _global_
- GLGE
- GLGE.Action
- GLGE.ActionChannel
- GLGE.Animatable
- GLGE.AnimationCurve
- GLGE.AnimationVector
- GLGE.Assets
- GLGE.BezTriple
- GLGE.Camera
- GLGE.Collada
- GLGE.Document
- GLGE.DocumentPreloader
- GLGE.Events
- GLGE.FilePreloader
- GLGE.FilterAO
- GLGE.FilterGlow
- GLGE.Group
- GLGE.GUI
- GLGE.HeightMap
- GLGE.JSONLoader
- GLGE.KeyInput
- GLGE.Light
- GLGE.LinearPoint
- GLGE.Material
- GLGE.MaterialLayer
- GLGE.MD2
- GLGE.Mesh
- GLGE.Message
- GLGE.MouseInput
- GLGE.MultiMaterial
- GLGE.Object
- GLGE.ObjectLod
- GLGE.ParticleSystem
- GLGE.PhysicsAbstract
- GLGE.PhysicsBox
- GLGE.PhysicsCar
- GLGE.PhysicsConstraintPoint
- GLGE.PhysicsMesh
- GLGE.PhysicsPlane
- GLGE.PhysicsSphere
- GLGE.PhysicsWheel
- GLGE.Placeable
- GLGE.QuickNotation
- GLGE.Renderer
- GLGE.Scene
- GLGE.Sphere
- GLGE.StepPoint
- GLGE.Text
- GLGE.Texture
- GLGE.TextureCamera
- GLGE.TextureCanvas
- GLGE.TextureCube
- GLGE.TextureVideo
- GLGE.Wavefront
- GUI.Gadget
- GUI.Preloader
- GUI.Progressbar
- GUI.Widget
Extends
GLGE.Animatable, GLGE.Events, GLGE.JSONLoader, GLGE.QuickNotation.
The Material class creates materials to be applied to objects in the graphics engine
Defined in: glge_material.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GLGE.Material(uid)
|
| Method Attributes | Method Name and Description |
|---|---|
|
addMaterialLayer(layer)
Add a new layer to the material
|
|
|
addTexture(image)
Adds a new texture to this material
|
|
|
getAlpha()
Gets the alpha of the material
|
|
|
Gets the ambient lighting of the material
|
|
|
Gets the binary alpha flag
|
|
|
getColor()
Gets the current base color of the material
|
|
|
getColorB(value)
Gets the blue base colour of the material
|
|
|
getColorG(value)
Gets the green base colour of the material
|
|
|
getColorR(value)
Gets the red base colour of the material
|
|
|
getEmit()
Gets the amount this material emits
|
|
|
getEmitB(value)
Sets how much the blue material should emit
|
|
|
getEmitG(value)
Sets how much the green material should emit
|
|
|
getEmitR(value)
Sets how much the Red material should emit
|
|
|
getFallback(value)
Gets the fallback material, if program fails then the fallback will be used
|
|
|
Gets all the materials layers
|
|
|
Gets the materials reflectivity
|
|
|
getShadeless(value)
Gets the shadeless flag
|
|
|
getShadow(value)
gets the show flag
|
|
|
Gets the shininess of the material
|
|
|
Gets the specular of the material
|
|
|
Gets the current base specular color of the material
|
|
|
getVertexColorMode(value)
Gets the vertex color mode
|
|
|
Adds a new texture to this material
|
|
|
registerPasses(gl, object)
|
|
|
removeMaterialLayer(layer)
Removes a layer from the material
|
|
|
setAlpha(value)
Sets the alpha of the material
|
|
|
setAmbient(color)
Sets the ambient lighting of the material
|
|
|
setBinaryAlpha(value)
Sets the material to output with 0 alpha or 1 alpha
|
|
|
setColor(color)
Sets the base colour of the material
|
|
|
setColorB(b)
Sets the blue base colour of the material
|
|
|
setColorG(g)
Sets the green base colour of the material
|
|
|
setColorR(r)
Sets the red base colour of the material
|
|
|
setEmit(color)
Sets how much the material should emit
|
|
|
setEmitB(value)
Sets how much the blue material should emit
|
|
|
setEmitG(value)
Sets how much the green material should emit
|
|
|
setEmitR(value)
Sets how much the Red material should emit
|
|
|
setFallback(value)
Sets the fall back material the material will be used if this one fails to produce a program
|
|
|
setReflectivity(value)
Sets reflectivity of the material
|
|
|
setShadeless(value)
Sets the flag indicateing if the material is shadeless
|
|
|
setShadow(value)
Sets the flag indicateing the material should or shouldn't recieve shadows
|
|
|
setShininess(value)
Sets the shininess of the material
|
|
|
setSpecular(value)
Sets the specular of the material
|
|
|
setSpecularColor(color)
Sets the base specular colour of the material
|
|
|
setVertexColorMode(value)
Sets the vertex color mode.
|
- Methods borrowed from class GLGE.Animatable:
- animate, blendTo, getAnimation, getBlendFunction, getFrameNumber, getFrameRate, getLoop, getName, getPaused, isLooping, setAnimation, setBlendFunction, setFrameRate, setLoop, setName, setPaused, setStartFrame, togglePaused
- Methods borrowed from class GLGE.Events:
- addEventListener, fireEvent, removeEventListener
- Methods borrowed from class GLGE.QuickNotation:
- _
- Methods borrowed from class GLGE.JSONLoader:
- getDownloadPriority, setDownloadPriority, setJSONSrc, setJSONString
| Event Attributes | Event Name and Description |
|---|---|
|
downloadComplete(data)
|
|
|
shaderupdate(data)
|
- Events borrowed from class GLGE.Animatable:
- animFinished
Method Detail
addMaterialLayer(layer)
Add a new layer to the material
- Parameters:
- {MaterialLayer} layer
- The material layer to add to the material
{Number}
addTexture(image)
Adds a new texture to this material
- Parameters:
- {String} image
- URL of the image to be used by the texture
- Returns:
- {Number} index of the new texture
{Number}
getAlpha()
Gets the alpha of the material
- Returns:
- {Number} The current alpha of the material
{[r|g|b]}
getAmbient()
Gets the ambient lighting of the material
- Returns:
- {[r|g|b]} The current ambient lighting
{boolean}
getBinaryAlpha()
Gets the binary alpha flag
- Returns:
- {boolean} The binary alpha flag
{[r|g|b]}
getColor()
Gets the current base color of the material
- Returns:
- {[r|g|b]} The current base color
getColorB(value)
Gets the blue base colour of the material
- Parameters:
- value
- Returns:
- The blue level 0-1
getColorG(value)
Gets the green base colour of the material
- Parameters:
- value
- Returns:
- The green level 0-1
getColorR(value)
Gets the red base colour of the material
- Parameters:
- value
- Returns:
- The red level 0-1
{Number}
getEmit()
Gets the amount this material emits
- Returns:
- {Number} The emit value for the material
getEmitB(value)
Sets how much the blue material should emit
- Parameters:
- value
- Returns:
- blue to emit
getEmitG(value)
Sets how much the green material should emit
- Parameters:
- value
- Returns:
- green to emit
getEmitR(value)
Sets how much the Red material should emit
- Parameters:
- value
- Returns:
- Red to emit
{boolean}
getFallback(value)
Gets the fallback material, if program fails then the fallback will be used
- Parameters:
- value
- Returns:
- {boolean} The fallback material
{GLGE.MaterialLayer[]}
getLayers()
Gets all the materials layers
- Returns:
- {GLGE.MaterialLayer[]} all of the layers contained within this material
{Number}
getReflectivity()
Gets the materials reflectivity
- Returns:
- {Number} The reflectivity of the material
{boolean}
getShadeless(value)
Gets the shadeless flag
- Parameters:
- value
- Returns:
- {boolean} The shadeless flag
{boolean}
getShadow(value)
gets the show flag
- Parameters:
- value
- Returns:
- {boolean} The shadow flag
{Number}
getShininess()
Gets the shininess of the material
- Returns:
- {Number} The current shininess of the material
{Number}
getSpecular()
Gets the specular of the material
- Returns:
- {Number} The current specular of the material
{[r|g|b]}
getSpecularColor()
Gets the current base specular color of the material
- Returns:
- {[r|g|b]} The current base specular color
{boolean}
getVertexColorMode(value)
Gets the vertex color mode
- Parameters:
- value
- Returns:
- {boolean} The vertex color mode
{boolean}
isComplete()
Adds a new texture to this material
- Returns:
- {boolean} true if all resources have loaded false otherwise
registerPasses(gl, object)
- Parameters:
- gl
- object
removeMaterialLayer(layer)
Removes a layer from the material
- Parameters:
- {MaterialLayer} layer
- The material layer to remove
setAlpha(value)
Sets the alpha of the material
- Parameters:
- {Number} value
- how much alpha
setAmbient(color)
Sets the ambient lighting of the material
- Parameters:
- {string} color
- The new specular colour
setBinaryAlpha(value)
Sets the material to output with 0 alpha or 1 alpha
- Parameters:
- {boolean} value
- binary alpha flag
setColor(color)
Sets the base colour of the material
- Parameters:
- {string} color
- The colour of the material
setColorB(b)
Sets the blue base colour of the material
- Parameters:
- {Number} b
- The new blue level 0-1
setColorG(g)
Sets the green base colour of the material
- Parameters:
- {Number} g
- The new green level 0-1
setColorR(r)
Sets the red base colour of the material
- Parameters:
- {Number} r
- The new red level 0-1
setEmit(color)
Sets how much the material should emit
- Parameters:
- {Number} color
- what color to emit
setEmitB(value)
Sets how much the blue material should emit
- Parameters:
- {Number} value
- what blue to emit
setEmitG(value)
Sets how much the green material should emit
- Parameters:
- {Number} value
- what green to emit
setEmitR(value)
Sets how much the Red material should emit
- Parameters:
- {Number} value
- what Red to emit
setFallback(value)
Sets the fall back material the material will be used if this one fails to produce a program
- Parameters:
- {boolean} value
- The fallback material
setReflectivity(value)
Sets reflectivity of the material
- Parameters:
- {Number} value
- how much to reflect (0-1)
setShadeless(value)
Sets the flag indicateing if the material is shadeless
- Parameters:
- {boolean} value
- The shadeless flag
setShadow(value)
Sets the flag indicateing the material should or shouldn't recieve shadows
- Parameters:
- {boolean} value
- The recieving shadow flag
setShininess(value)
Sets the shininess of the material
- Parameters:
- {Number} value
- how much shine
setSpecular(value)
Sets the specular of the material
- Parameters:
- {Number} value
- how much specular
setSpecularColor(color)
Sets the base specular colour of the material
- Parameters:
- {string} color
- The new specular colour
setVertexColorMode(value)
Sets the vertex color mode. Default is to override the base color VC_MUL will multiply the vertex color with the resulting color
- Parameters:
- {boolean} value
- The vertex color mode
Event Detail
downloadComplete(data)
- Parameters:
- {object} data
shaderupdate(data)
- Parameters:
- {object} data
Documentation generated by JsDoc Toolkit 2.4.0 on Sun Feb 12 2012 14:20:23 GMT+0000 (GMT)