Displays a bitmap on the faces of a 3D shape..
public var graphics:Graphics
public var map:Matrix
protected var matrix:Matrix
protected var m_oCmf:ColorMatrixFilter
protected var m_oPoint:Point
protected var m_oPolygonMatrixMap:Dictionary
protected var m_orgTexture:BitmapData
protected var m_oTexture:BitmapData
public var polygon:Polygon
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
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
texture:BitmapData [read-write]
The texture ( bitmap ) of this material
Implementation
public function get texture():BitmapData
public function set texture(value:BitmapData):void
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.
|
protected function _createTextureMatrix(p_aUv:Array):MatrixParameters
Returns
protected function _tesselatePolygon(p_aPoints:Array, p_aUv:Array):voidParameters
| p_aPoints:Array |
| |
| p_aUv:Array |
public override function init(p_oPolygon:Polygon):void
Initiates this material.
Parameters
| p_oPolygon:Polygon — The face dressed by this material
|
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
|
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 |
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 |
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)
|
public function toString():String
Returns
ASDoc: Preliminary documentation for the Sandy 3D Engine, version 3.0.1