Class Index | File Index

Classes


Class threedee.Material

A material.
Defined in: Material.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
threedee.Material(ambient, diffuse, emissive)
Constructs a new Material with the specified properties.
Field Summary
Field Attributes Field Name and Description
<static>  
threedee.Material.DEFAULT
The default material.
Method Summary
Method Attributes Method Name and Description
<static>  
threedee.Material.count()
Returns and resets the current instance counter.
<static>  
threedee.Material.fromJSON(data)
Creates a new material instance with the data read from the specified JSON object (with keys 'a', 'd' and 'e').
 
Returns the ambient color.
 
Returns the diffuse color.
 
Returns the emissive color.
 
Converts the material into a JSON object with keys 'a', 'd' and 'e' and returns it.
Class Detail
threedee.Material(ambient, diffuse, emissive)
Constructs a new Material with the specified properties.
Parameters:
{threedee.Color=} ambient
Optional ambient color. Defaults to white.
{threedee.Color=} diffuse
Optional diffuse color. Defaults to white.
{threedee.Color=} emissive
Optional emissive color. Defaults to black.
Field Detail
<static> threedee.Material.DEFAULT
The default material.
Method Detail
<static> {number} threedee.Material.count()
Returns and resets the current instance counter.
Returns:
{number} The number of created instances since the last call

<static> {threedee.Material} threedee.Material.fromJSON(data)
Creates a new material instance with the data read from the specified JSON object (with keys 'a', 'd' and 'e'). Returns null if data was empty.
Parameters:
{Object} data
The material as JSON object
Returns:
{threedee.Material} The material object or null if data was empty

{threedee.Color} getAmbient()
Returns the ambient color.
Returns:
{threedee.Color} The ambient color

{threedee.Color} getDiffuse()
Returns the diffuse color.
Returns:
{threedee.Color} The diffuse color

{threedee.Color} getEmissive()
Returns the emissive color.
Returns:
{threedee.Color} The emissive color

{Object} toJSON()
Converts the material into a JSON object with keys 'a', 'd' and 'e' and returns it.
Returns:
{Object} The material as a JSON object

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jan 03 2012 16:18:57 GMT+0100 (CET)