Packagesandy.materials
Classpublic class BitmapMaterial
InheritanceBitmapMaterial Inheritance Material
SubclassesMovieMaterial, VideoMaterial

Displays a bitmap on the faces of a 3D shape..



Public Properties
 PropertyDefined by
 Inheritedattributes : MaterialAttributes
The attributes of this material.
Material
 Inheritedfilters : Array
The array of filters for this material.
Material
  graphics : Graphics
BitmapMaterial
 Inheritedid : Number
The unique id of this material
Material
 InheritedlightingEnable : Boolean = false
Specify is the material can receive light and apply the lightAttributes if specified.
Material
  map : Matrix
BitmapMaterial
 Inheritedmodified : Boolean
The modified state of this material.
Material
  polygon : Polygon
BitmapMaterial
  precision : uint = 0
Precision of the bitmap mapping.
BitmapMaterial
 Inheritedrepeat : Boolean
The repeat property (?).
Material
  smooth : Boolean = false
This property enable smooth bitmap rendering when set to true.
BitmapMaterial
  texture : BitmapData
The texture ( bitmap ) of this material
BitmapMaterial
 Inheritedtype : MaterialType
The material type of this material.
Material
 InheriteduseVertexNormal : Boolean = false
Specify if the material use the vertex normal information Default value is set to false.
Material
Protected Properties
 PropertyDefined by
  matrix : Matrix
BitmapMaterial
 Inheritedm_bModified : Boolean
Material
  m_oCmf : ColorMatrixFilter
BitmapMaterial
  m_oPoint : Point
BitmapMaterial
  m_oPolygonMatrixMap : Dictionary
BitmapMaterial
  m_orgTexture : BitmapData
BitmapMaterial
  m_oTexture : BitmapData
BitmapMaterial
 Inheritedm_oType : MaterialType
Material
 Inherited_useLight : Boolean = false
Material
Public Methods
 MethodDefined by
  
BitmapMaterial(p_oTexture:BitmapData = null, p_oAttr:MaterialAttributes = null, p_nPrecision:uint = 0)
Creates a new BitmapMaterial.
BitmapMaterial
  
init(p_oPolygon:Polygon):void
Initiates this material.
BitmapMaterial
  
renderPolygon(p_oScene:Scene3D, p_oPolygon:Polygon, p_mcContainer:Sprite):void
Renders this material on the face it dresses
BitmapMaterial
  
setTransparency(p_nValue:Number):void
Changes the transparency of the texture.
BitmapMaterial
  
toString():String
BitmapMaterial
Protected Methods
 MethodDefined by
  
_createTextureMatrix(p_aUv:Array):Matrix
BitmapMaterial
  
_tesselatePolygon(p_aPoints:Array, p_aUv:Array):void
BitmapMaterial
  
renderRec(ta:Number, tb:Number, tc:Number, td:Number, tx:Number, ty:Number, ax:Number, ay:Number, az:Number, bx:Number, by:Number, bz:Number, cx:Number, cy:Number, cz:Number):void
BitmapMaterial
  
renderTriangle(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number, v0x:Number, v0y:Number, v1x:Number, v1y:Number, v2x:Number, v2y:Number):void
BitmapMaterial
Property detail
graphicsproperty
public var graphics:Graphics
mapproperty 
public var map:Matrix
matrixproperty 
protected var matrix:Matrix
m_oCmfproperty 
protected var m_oCmf:ColorMatrixFilter
m_oPointproperty 
protected var m_oPoint:Point
m_oPolygonMatrixMapproperty 
protected var m_oPolygonMatrixMap:Dictionary
m_orgTextureproperty 
protected var m_orgTexture:BitmapData
m_oTextureproperty 
protected var m_oTexture:BitmapData
polygonproperty 
public var polygon:Polygon
precisionproperty 
public var precision:uint = 0

Precision of the bitmap mapping. This material uses an affine linear mapping. It results in a lack of accuracy at rendering time when the surface to draw is too big. An usual solution is to augment the number of polygon, but the performance cost can be quite big. An other solution is to change this property value. The lower to more accurate the perspective correction is. To disable the perspective correction, set this property to zero, which is also the default value

smoothproperty 
public var smooth:Boolean = false

This property enable smooth bitmap rendering when set to true. The default value is set to false to have the best performance first. Enable this property have a performance impact, use it warefully

textureproperty 
texture:BitmapData  [read-write]

The texture ( bitmap ) of this material

Implementation
    public function get texture():BitmapData
    public function set texture(value:BitmapData):void
Constructor detail
BitmapMaterial()constructor
public function BitmapMaterial(p_oTexture:BitmapData = null, p_oAttr:MaterialAttributes = null, p_nPrecision:uint = 0)

Creates a new BitmapMaterial.

Please note that we ue internally a copy of the constructor bitmapdata. Thatea mns in case you need to access this bitmapdata, you can't just use the same reference but you shall use the BitmapMaterial#texture getter property to make it work.

Parameters
p_oTexture:BitmapData (default = null) — The bitmapdata for this material
 
p_oAttr:MaterialAttributes (default = null) — The attributes for this material
 
p_nPrecision:uint (default = 0) — The precision of this material. Using a precision with 0 makes the material behave as before. Then 1 as precision is very high and requires a lot of computation but proceed a the best perpective mapping correction. Bigger values are less CPU intensive but also less accurate. Usually a value of 5 is enough.
Method detail
_createTextureMatrix()method
protected function _createTextureMatrix(p_aUv:Array):MatrixParameters
p_aUv:Array

Returns
Matrix
_tesselatePolygon()method 
protected function _tesselatePolygon(p_aPoints:Array, p_aUv:Array):voidParameters
p_aPoints:Array
 
p_aUv:Array
init()method 
public override function init(p_oPolygon:Polygon):void

Initiates this material.

Parameters
p_oPolygon:Polygon — The face dressed by this material
renderPolygon()method 
public override function renderPolygon(p_oScene:Scene3D, p_oPolygon:Polygon, p_mcContainer:Sprite):void

Renders this material on the face it dresses

Parameters
p_oScene:Scene3D — The current scene
 
p_oPolygon:Polygon — The face to be rendered
 
p_mcContainer:Sprite — The container to draw on
renderRec()method 
protected function renderRec(ta:Number, tb:Number, tc:Number, td:Number, tx:Number, ty:Number, ax:Number, ay:Number, az:Number, bx:Number, by:Number, bz:Number, cx:Number, cy:Number, cz:Number):voidParameters
ta:Number
 
tb:Number
 
tc:Number
 
td:Number
 
tx:Number
 
ty:Number
 
ax:Number
 
ay:Number
 
az:Number
 
bx:Number
 
by:Number
 
bz:Number
 
cx:Number
 
cy:Number
 
cz:Number
renderTriangle()method 
protected function renderTriangle(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number, v0x:Number, v0y:Number, v1x:Number, v1y:Number, v2x:Number, v2y:Number):voidParameters
a:Number
 
b:Number
 
c:Number
 
d:Number
 
tx:Number
 
ty:Number
 
v0x:Number
 
v0y:Number
 
v1x:Number
 
v1y:Number
 
v2x:Number
 
v2y:Number
setTransparency()method 
public function setTransparency(p_nValue:Number):void

Changes the transparency of the texture.

The passed value is the percentage of opacity.

Parameters
p_nValue:Number — A value between 0 and 1. (automatically constrained)
toString()method 
public function toString():String

Returns
String