Packageorg.papervision3d.materials
Classpublic class BitmapMaterial
InheritanceBitmapMaterial Inheritance TriangleMaterial Inheritance MaterialObject3D Inheritance flash.events.EventDispatcher
ImplementsITriangleDrawer
SubclassesBitmapAssetMaterial, BitmapColorMaterial, BitmapFileMaterial, BitmapViewportMaterial, MovieMaterial

The BitmapMaterial class creates a texture from a BitmapData object. Materials collect data about how objects appear when rendered.



Public Properties
 PropertyDefined by
  AUTO_MIP_MAPPING : Boolean = false
[static] Indicates if mip mapping is forced.
BitmapMaterial
 Inheritedbaked : Boolean = false
A Boolean value that determines whether the texture is cached, i.e.
MaterialObject3D
 Inheritedbitmap : BitmapData
A transparent or opaque BitmapData texture.
MaterialObject3D
 InheritedDEBUG : MaterialObject3D
[static]
MaterialObject3D
 InheritedDEBUG_COLOR : int = 0xFF00FF
[static] Color used for DEBUG material.
MaterialObject3D
 InheritedDEFAULT : MaterialObject3D
[static] Returns a MaterialObject3D object with the default magenta wireframe values.
MaterialObject3D
 InheritedDEFAULT_COLOR : int = 0x000000
[static] Color used for DEFAULT material.
MaterialObject3D
 InheriteddoubleSided : Boolean
A Boolean value that indicates whether the faces are double sided.
MaterialObject3D
 InheritedfillAlpha : Number = 0
An 8-bit alpha value fill the faces with.
MaterialObject3D
 InheritedfillColor : Number
A RGB color value to fill the faces with.
MaterialObject3D
 InheritedheightOffset : Number = 0
Holds the original size of the bitmap before it was resized by Automip mapping
MaterialObject3D
 Inheritedid : Number
[internal-use] [read-only] Unique id of this instance.
MaterialObject3D
 Inheritedinteractive : Boolean = false
Defines if this material will be interactive
MaterialObject3D
 Inheritedinvisible : Boolean = false
A Boolean value that indicates whether the faces are invisible (not drawn).
MaterialObject3D
 InheritedlineAlpha : Number = 0
An 8-bit alpha value for the faces outline.
MaterialObject3D
 InheritedlineColor : Number
A RGB color value to draw the faces outline.
MaterialObject3D
 InheritedlineThickness : Number = 1
An value for the thickness of the faces line.
MaterialObject3D
 InheritedmaxU : Number
Internal use
MaterialObject3D
 InheritedmaxV : Number
Internal use
MaterialObject3D
  minimumRenderSize : Number = 4
BitmapMaterial
  MIP_MAP_DEPTH : Number = 8
[static] Levels of mip mapping to force.
BitmapMaterial
 Inheritedname : String
The name of the material.
MaterialObject3D
 InheritedoneSide : Boolean = true
A Boolean value that indicates whether the faces are single sided.
MaterialObject3D
 Inheritedopposite : Boolean = false
A Boolean value that indicates whether the face is flipped.
MaterialObject3D
  pixelPrecision : int
BitmapMaterial
  precise : Boolean
BitmapMaterial
  precision : int
BitmapMaterial
  precisionMode : int
Precision mode indicates how triangles are created for precise texture render.
BitmapMaterial
 Inheritedsmooth : Boolean = false
A Boolean value that determines whether the BitmapData texture is smoothed when rendered.
MaterialObject3D
  texture : Object
A texture object.
BitmapMaterial
 Inheritedtiled : Boolean = false
A Boolean value that determines whether the texture is tiled when rendered.
MaterialObject3D
  uvMatrices : Dictionary
BitmapMaterial
 InheritedwidthOffset : Number = 0
Holds the original size of the bitmap before it was resized by Automip mapping
MaterialObject3D
Protected Properties
 PropertyDefined by
  ax : Number
BitmapMaterial
  ay : Number
BitmapMaterial
  az : Number
BitmapMaterial
  bx : Number
BitmapMaterial
  by : Number
BitmapMaterial
  bz : Number
BitmapMaterial
  cullRect : Rectangle
BitmapMaterial
  cx : Number
BitmapMaterial
  cy : Number
BitmapMaterial
  cz : Number
BitmapMaterial
  dabx : Number
BitmapMaterial
  daby : Number
BitmapMaterial
  dbcx : Number
BitmapMaterial
  dbcy : Number
BitmapMaterial
  dcax : Number
BitmapMaterial
  dcay : Number
BitmapMaterial
  dmax : Number
BitmapMaterial
  dsab : Number
BitmapMaterial
  dsbc : Number
BitmapMaterial
  dsca : Number
BitmapMaterial
  faz : Number
BitmapMaterial
  fbz : Number
BitmapMaterial
  fcz : Number
BitmapMaterial
  focus : Number = 200
BitmapMaterial
  hitRect : Rectangle
[static]
BitmapMaterial
  mabx : Number
BitmapMaterial
  maby : Number
BitmapMaterial
  mabz : Number
BitmapMaterial
  mbcx : Number
BitmapMaterial
  mbcy : Number
BitmapMaterial
  mbcz : Number
BitmapMaterial
  mcax : Number
BitmapMaterial
  mcay : Number
BitmapMaterial
  mcaz : Number
BitmapMaterial
 Inheritedobjects : Dictionary
Inventory of registered objects
MaterialObject3D
  _perPixelPrecision : int = 8
BitmapMaterial
  _precise : Boolean
BitmapMaterial
  _precision : int = 8
BitmapMaterial
  renderRecStorage : Array
BitmapMaterial
  tempPreBmp : BitmapData
BitmapMaterial
  tempPreGrp : Graphics
BitmapMaterial
  tempPreRSD : RenderSessionData
BitmapMaterial
  tempTriangleMatrix : Matrix
BitmapMaterial
  _texture : Object
BitmapMaterial
  _triMap : Matrix
[static]
BitmapMaterial
Public Methods
 MethodDefined by
  
BitmapMaterial(asset:BitmapData = null, precise:Boolean = false)
The BitmapMaterial class creates a texture from a BitmapData object.
BitmapMaterial
  
Creates a copy of the material.
BitmapMaterial
  
copy(material:MaterialObject3D):void
Copies the properties of a material.
BitmapMaterial
  
destroy():void
BitmapMaterial
 Inherited
drawRT(rt:RenderTriangle, graphics:Graphics, renderSessionData:RenderSessionData):void
TriangleMaterial
  
drawTriangle(tri:RenderTriangle, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData = null, altUV:Matrix = null):void
drawTriangle
BitmapMaterial
 Inherited
getObjectList():Dictionary
Returns a list of DisplayObject3D objects registered with the material.
MaterialObject3D
 Inherited
isUpdateable():Boolean
MaterialObject3D
 Inherited
registerObject(displayObject3D:DisplayObject3D):void
Registers the DisplayObject3D
MaterialObject3D
  
resetMapping():void
Resets the mapping coordinates.
BitmapMaterial
  
resetUVS():void
resetUVMatrices(); Resets the precalculated uvmatrices, so they can be recalculated
BitmapMaterial
  
toString():String
Returns a string value representing the material properties in the specified BitmapMaterial object.
BitmapMaterial
  
transformUV(face3D:Triangle3D):Matrix
Applies the updated UV texture mapping values to the triangle.
BitmapMaterial
  
Applies the updated UV texture mapping values to the triangle.
BitmapMaterial
 Inherited
unregisterObject(displayObject3D:DisplayObject3D):void
MaterialObject3D
 Inherited
updateBitmap():void
Updates the BitmapData bitmap from the given texture.
MaterialObject3D
Protected Methods
 MethodDefined by
  
correctBitmap(bitmap:BitmapData):BitmapData
BitmapMaterial
  
createBitmap(asset:BitmapData):BitmapData
BitmapMaterial
  
BitmapMaterial
  
extendBitmapEdges(bmp:BitmapData, originalWidth:Number, originalHeight:Number):void
BitmapMaterial
  
renderRec(emMap:Matrix, v0:Vertex3DInstance, v1:Vertex3DInstance, v2:Vertex3DInstance, index:Number):void
BitmapMaterial
Protected Constants
 ConstantDefined by
  DEFAULT_FOCUS : Number = 200
[static]
BitmapMaterial
Property detail
AUTO_MIP_MAPPINGproperty
public static var AUTO_MIP_MAPPING:Boolean = false

Indicates if mip mapping is forced.

axproperty 
protected var ax:Number
ayproperty 
protected var ay:Number
azproperty 
protected var az:Number
bxproperty 
protected var bx:Number
byproperty 
protected var by:Number
bzproperty 
protected var bz:Number
cullRectproperty 
protected var cullRect:Rectangle
cxproperty 
protected var cx:Number
cyproperty 
protected var cy:Number
czproperty 
protected var cz:Number
dabxproperty 
protected var dabx:Number
dabyproperty 
protected var daby:Number
dbcxproperty 
protected var dbcx:Number
dbcyproperty 
protected var dbcy:Number
dcaxproperty 
protected var dcax:Number
dcayproperty 
protected var dcay:Number
dmaxproperty 
protected var dmax:Number
dsabproperty 
protected var dsab:Number
dsbcproperty 
protected var dsbc:Number
dscaproperty 
protected var dsca:Number
fazproperty 
protected var faz:Number
fbzproperty 
protected var fbz:Number
fczproperty 
protected var fcz:Number
focusproperty 
protected var focus:Number = 200
hitRectproperty 
protected static var hitRect:Rectangle
mabxproperty 
protected var mabx:Number
mabyproperty 
protected var maby:Number
mabzproperty 
protected var mabz:Number
mbcxproperty 
protected var mbcx:Number
mbcyproperty 
protected var mbcy:Number
mbczproperty 
protected var mbcz:Number
mcaxproperty 
protected var mcax:Number
mcayproperty 
protected var mcay:Number
mcazproperty 
protected var mcaz:Number
minimumRenderSizeproperty 
public var minimumRenderSize:Number = 4
MIP_MAP_DEPTHproperty 
public static var MIP_MAP_DEPTH:Number = 8

Levels of mip mapping to force.

_perPixelPrecisionproperty 
protected var _perPixelPrecision:int = 8
pixelPrecisionproperty 
pixelPrecision:int  [read-write]Implementation
    public function get pixelPrecision():int
    public function set pixelPrecision(value:int):void
_preciseproperty 
protected var _precise:Boolean
preciseproperty 
precise:Boolean  [read-write]Implementation
    public function get precise():Boolean
    public function set precise(value:Boolean):void
_precisionproperty 
protected var _precision:int = 8
precisionproperty 
precision:int  [read-write]Implementation
    public function get precision():int
    public function set precision(value:int):void
precisionModeproperty 
public var precisionMode:int

Precision mode indicates how triangles are created for precise texture render.

renderRecStorageproperty 
protected var renderRecStorage:Array
tempPreBmpproperty 
protected var tempPreBmp:BitmapData
tempPreGrpproperty 
protected var tempPreGrp:Graphics
tempPreRSDproperty 
protected var tempPreRSD:RenderSessionData
tempTriangleMatrixproperty 
protected var tempTriangleMatrix:Matrix
_textureproperty 
protected var _texture:Object
textureproperty 
texture:Object  [read-write]

A texture object.

Implementation
    public function get texture():Object
    public function set texture(value:Object):void
_triMapproperty 
protected static var _triMap:Matrix
uvMatricesproperty 
public var uvMatrices:Dictionary
Constructor detail
BitmapMaterial()constructor
public function BitmapMaterial(asset:BitmapData = null, precise:Boolean = false)

The BitmapMaterial class creates a texture from a BitmapData object.

Parameters
asset:BitmapData (default = null) — A BitmapData object.
 
precise:Boolean (default = false)
Method detail
clone()method
public override function clone():MaterialObject3D

Creates a copy of the material.

Returns
MaterialObject3D — A newly created material that contains the same properties.
copy()method 
public override function copy(material:MaterialObject3D):void

Copies the properties of a material.

Parameters
material:MaterialObject3D — Material to copy from.
correctBitmap()method 
protected function correctBitmap(bitmap:BitmapData):BitmapDataParameters
bitmap:BitmapData

Returns
BitmapData
createBitmap()method 
protected function createBitmap(asset:BitmapData):BitmapDataParameters
asset:BitmapData

Returns
BitmapData
createRenderRecStorage()method 
protected function createRenderRecStorage():void
destroy()method 
public override function destroy():void
drawTriangle()method 
public override function drawTriangle(tri:RenderTriangle, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData = null, altUV:Matrix = null):void

drawTriangle

Parameters
tri:RenderTriangle
 
graphics:Graphics
 
renderSessionData:RenderSessionData
 
altBitmap:BitmapData (default = null)
 
altUV:Matrix (default = null)
extendBitmapEdges()method 
protected function extendBitmapEdges(bmp:BitmapData, originalWidth:Number, originalHeight:Number):voidParameters
bmp:BitmapData
 
originalWidth:Number
 
originalHeight:Number
renderRec()method 
protected function renderRec(emMap:Matrix, v0:Vertex3DInstance, v1:Vertex3DInstance, v2:Vertex3DInstance, index:Number):voidParameters
emMap:Matrix
 
v0:Vertex3DInstance
 
v1:Vertex3DInstance
 
v2:Vertex3DInstance
 
index:Number
resetMapping()method 
public function resetMapping():void

Resets the mapping coordinates. Use when the texture has been resized.

resetUVS()method 
public function resetUVS():void

resetUVMatrices(); Resets the precalculated uvmatrices, so they can be recalculated

toString()method 
public override function toString():String

Returns a string value representing the material properties in the specified BitmapMaterial object.

Returns
String — A string.
transformUV()method 
public function transformUV(face3D:Triangle3D):Matrix

Applies the updated UV texture mapping values to the triangle. This is required to speed up rendering.

Parameters
face3D:Triangle3D

Returns
Matrix
transformUVRT()method 
public function transformUVRT(tri:RenderTriangle):Matrix

Applies the updated UV texture mapping values to the triangle. This is required to speed up rendering.

Parameters
tri:RenderTriangle

Returns
Matrix
Constant detail
DEFAULT_FOCUSconstant
protected static const DEFAULT_FOCUS:Number = 200