Material

Home

A Material object is used to store appearance data for MeshUrbjects. Each Material has a color for the faces of the mesh (fill) and another color for the edges of the faces (wire) as well as an attribute to determine whether the colors of the Material should be affected by lights in the Scene.

See also: Color, MeshUrbject, Scene, Light

Constructors

Material( ): Material Initializes with default attribute values.
Material( { fill?: Color, wire?: Color, lit?: boolean} ): Material Initializes with the given attribute values. Default values are:

fill new Color(200, 200, 200, 1.0) The fill color of the Material that will fill in the faces of the Mesh in a MeshUrbject. Color, See also: MeshUrbject, Mesh
wire Equal to fill color if not set. The wire color of the Material that will outline the faces of the Mesh in a MeshUrbject. Color, See also: MeshUrbject, Mesh
lit true Determines if the Material is affected by lights in the Scene. See also: Scene, Light

Variables

Public Variables

fill: Color The fill color of the Material that will fill in the faces of the Mesh in a MeshUrbject. See also: Color, MeshUrbject, Mesh
wire: Color The wire color of the Material that will outline the faces of the Mesh in a MeshUrbject. See also: Color, MeshUrbject, Mesh
lit: boolean Determines if the Material is affected by lights in the Scene. See also: Scene, Light

Functions

Public Functions

copy(): Material Returns a copy of the Material object.
setColor(c: Color): Material Sets the fill and wire color of the Material to the given color. Returns this. See also: Color
setFill(c: Color): Material Sets the fill color of the Material to the given color. Returns this. See also: Color
setWire(c: Color): Material Sets the wire color of the Material to the given color. Returns this. See also: Color

Static Functions

Material.copy(m: Material): Material Returns a copy of the Material or creates a new Material from an object that has all of the public attributes from the Material class.
Material.setColor(m: Material, c: Color): Material Copies the Material and sets the fill and wire color of the copy to the given color. Returns the new Material. See also: Color
Material.setFill(m: Material, c: Color): Material Copies the Material and sets the fill color of the copy to the given color. Returns the new Material. See also: Color
Material.setWire(m: Material, c: Color): Material Copies the Material and sets the wire color of the copy to the given color. Returns the new Material. See also: Color

Home

Copyright © 2020 Trevor Richard