MaterialObject3D
| Kind of class: | public class |
|---|---|
| Package: | org.papervision3d.core.proto |
| Inherits from: | EventDispatcher |
| Implements: | |
| Known subclasses: | |
| Classpath: | org.papervision3d.core.proto.MaterialObject3D |
| File last modified: | Sunday, 02 March 2008, 15:23:35 |
The MaterialObject3D class is the base class for all materials.Materials collects data about how objects appear when rendered.A material is data that you assign to objects or faces, so that they appear a certain way when rendered. Materials affect the line and fill colors.Materials create greater realism in a scene. A material describes how an object reflects or transmits light.You assign materials to individual objects or a selection of faces; a single object can contain different materials.MaterialObject3D is an abstract base class; therefore, you cannot call MaterialObject3D directly.
Summary
Constructor
Class properties
- DEFAULT_COLOR : int
- Color used for DEFAULT material.
- DEBUG_COLOR : int
- Color used for DEBUG material.
- DEFAULT : MaterialObject3D
- Returns a MaterialObject3D object with the default magenta wireframe values.
- DEBUG : MaterialObject3D
Instance properties
- bitmap : BitmapData
- A transparent or opaque BitmapData texture.
- smooth : Boolean
- A Boolean value that determines whether the BitmapData texture is smoothed when rendered.
- tiled : Boolean
- A Boolean value that determines whether the texture is tiled when rendered.
- lineColor : Number
- A RGB color value to draw the faces outline.
- lineAlpha : Number
- An 8-bit alpha value for the faces outline.
- lineThickness : Number
- An value for the thickness of the faces line.
- fillColor : Number
- A RGB color value to fill the faces with.
- fillAlpha : Number
- An 8-bit alpha value fill the faces with.
- doubleSided : Boolean
- A Boolean value that indicates whether the faces are double sided.
- oneSide : Boolean
- A Boolean value that indicates whether the faces are single sided.
- invisible : Boolean
- A Boolean value that indicates whether the faces are invisible (not drawn).
- opposite : Boolean
- A Boolean value that indicates whether the face is flipped.
- scene : SceneObject3D
- The scene where the object belongs.
- name : String
- The name of the material.
- id : Number
- [internal-use] [read-only] Unique id of this instance.
- maxU : Number
- Internal use
- maxV : Number
- Internal use
- widthOffset : Number
- Holds the original size of the bitmap before it was resized by Automip mapping
- heightOffset : Number
- Holds the original size of the bitmap before it was resized by Automip mapping
- interactive : Boolean
- Defines if this material will be interactive;
Instance methods
- drawTriangle (face3D:Triangle3D, altBitmap:BitmapData = null, altUV:Matrix = null) : void
- drawTriangle(); Draws the triangle to screen.
- updateBitmap : void
- Updates the BitmapData bitmap from the given texture.
- copy (material:MaterialObject3D) : void
- Copies the properties of a material.
- clone : MaterialObject3D
- Creates a copy of the material.
- registerObject (displayObject3D:DisplayObject3D) : void
- unregisterObject (displayObject3D:DisplayObject3D) : void
- toString : String
- Returns a string value representing the material properties.
Constructor
MaterialObject3D
public function MaterialObject3D (
)
Creates a new MaterialObject3D object.
Parameters:
initObject:
[optional] - An object that contains properties for the newly created material.
Class properties
DEBUG
DEBUG_COLOR
public static DEBUG_COLOR:int = 0xFF00FF
(read,write)
Color used for DEBUG material.
DEFAULT
Returns a MaterialObject3D object with the default magenta wireframe values.
Returns:
- A MaterialObject3D object.
DEFAULT_COLOR
public static DEFAULT_COLOR:int = 0x000000
(read,write)
Color used for DEFAULT material.
Instance properties
bitmap
public bitmap:BitmapData
(read,write)
A transparent or opaque BitmapData texture.
doubleSided
public doubleSided:Boolean
(read,write)
A Boolean value that indicates whether the faces are double sided.
fillAlpha
public fillAlpha:Number = 0
(read,write)
An 8-bit alpha value fill the faces with. If this value is zero and no texture is provided or is undefined, a fill is not created.
fillColor
public fillColor:Number = DEFAULT_COLOR
(read,write)
A RGB color value to fill the faces with. Only used if no texture is provided.
heightOffset
public heightOffset:Number = 0
(read,write)
Holds the original size of the bitmap before it was resized by Automip mapping
id
public id:Number
(read,write)
[internal-use] [read-only] Unique id of this instance.
interactive
public interactive:Boolean = false
(read,write)
Defines if this material will be interactive;
invisible
public invisible:Boolean = false
(read,write)
A Boolean value that indicates whether the faces are invisible (not drawn).
lineAlpha
public lineAlpha:Number = 0
(read,write)
An 8-bit alpha value for the faces outline. If zero, no outline is drawn.
lineColor
public lineColor:Number = DEFAULT_COLOR
(read,write)
A RGB color value to draw the faces outline.
lineThickness
public lineThickness:Number = 1
(read,write)
An value for the thickness of the faces line.
maxU
public maxU:Number
(read,write)
Internal use
maxV
public maxV:Number
(read,write)
Internal use
name
public name:String
(read,write)
The name of the material.
oneSide
public oneSide:Boolean = true
(read,write)
A Boolean value that indicates whether the faces are single sided. It has preference over doubleSided.
opposite
public opposite:Boolean = false
(read,write)
A Boolean value that indicates whether the face is flipped. Only used if doubleSided or not singeSided.
smooth
public smooth:Boolean = false
(read,write)
A Boolean value that determines whether the BitmapData texture is smoothed when rendered.
tiled
public tiled:Boolean = false
(read,write)
A Boolean value that determines whether the texture is tiled when rendered. Defaults to false.
widthOffset
public widthOffset:Number = 0
(read,write)
Holds the original size of the bitmap before it was resized by Automip mapping
Instance methods
clone
Creates a copy of the material.
Returns:
- A newly created material that contains the same properties.
copy
Copies the properties of a material.
Parameters:
material:
Material to copy from.
drawTriangle
public function drawTriangle (
face3D:Triangle3D,
graphics:Graphics,
renderSessionData:RenderSessionData,
altBitmap:BitmapData = null,
altUV:Matrix = null) : void
drawTriangle();
Draws the triangle to screen.
Draws the triangle to screen.
Specified by:
registerObject
toString
override public function toString (
) : String
Returns a string value representing the material properties.
Returns:
- A string.
Overrides:
- EventDispatcher.toString
unregisterObject
updateBitmap
public function updateBitmap (
) : void
Updates the BitmapData bitmap from the given texture.
Draws the current MovieClip image onto bitmap.
Draws the current MovieClip image onto bitmap.