Packageverlocity.components
Classpublic final class ver3D
Inheritancever3D Inheritance Component Inheritance Singleton Inheritance Object

Provides easy Away3D 3.6.0 instancing and support. Simply setups up Away3D support with additional functions that allow for easy API access to the 3D engine. Verlocity is mainly a 2D engine, as such, this component is designed for 3D effects for backgrounds and 3D sprites. This only provides one single 3D scene, camera, and view.



Public Properties
 PropertyDefined By
  camera : Camera3D
[read-only] Returns the 3D camera
ver3D
 InheritedclassName : Object
[read-only] Returns the class name of the component for dictionary registration.
Component
  container : ObjectContainer3D
[read-only] Returns the 3D container
ver3D
  view : View3D
[read-only] Returns the 3D view
ver3D
Protected Properties
 PropertyDefined By
 Inheritedstage : Stage
Component
Public Methods
 MethodDefined By
  
ver3D(sStage:Stage)
Constructor of the component.
ver3D
  
_Destruct():void
[override] Destructor of the component.
ver3D
 Inherited
_IsNotUpdating():Boolean
Returns if the component is not updating (paused).
Component
 Inherited
_IsValid():Boolean
Returns if this singleton is active/valid.
Singleton
 Inherited
_SetUpdating(bUpdating:Boolean):void
Pauses/resumes the component updating, if it's pausable.
Component
 Inherited
Updates the component, if possible.
Component
  
CastBitmapData(materialClass:Class):BitmapData
Creates and returns bitmap data from an image class
ver3D
  
Create(sLayer:String, bZOrderFix:Boolean = false):void
Creates the 3D scene.
ver3D
  
CreateCube(vPos:Vector3D, nWidth:Number, nHeight:Number, nDepth:Number, cubeMaterial:Material):Cube
Creates and displays a 3D cube
ver3D
  
CreateLine(vStartPos:Vertex, vEndPos:Vertex, uiColor:uint = 0x00000):LineSegment
Creates and displays a 3D line
ver3D
  
CreateModel(objClass:Class, vPos:Vector3D, nScale:Number = 1):Object3D
Creates and displays a new 3D model
ver3D
  
CreatePointLight(vPos:Vector3D, nBrightness:Number, uiColor:uint):PointLight3D
Creates and returns a 3D point light (taxing)
ver3D
  
CreateSkybox(skyMaterial:Material):Skybox6
Creates and displays a 3D skybox (this is taxing)
ver3D
  
CreateSprite(vPos:Vector3D, material:Material, nWidth:Number, nHeight:Number, nScale:Number = 1, nRot:Number = 0, sAlign:String = center):Sprite3D
Creates and displays a 3D sprite
ver3D
  
MatBitmap(materialClass:Class):BitmapMaterial
Creates and returns a 3D bitmap material
ver3D
  
MatColor(uiColor:uint):ColorMaterial
Creates and returns a solid color material
ver3D
  
MatCube(topMat:Material = null, bottomMat:Material = null, frontMat:Material = null, leftMat:Material = null, rightMat:Material = null, backMat:Material = null):CubeMaterialsData
Creates and returns a material cube (a material with seperate textures per side)
ver3D
  
MatTransform(materialClass:Class, bRepeat:Boolean = true, nScaleX:Number = 1, nScaleY:Number = 1):TransformBitmapMaterial
Creates and returns a 3D transform bitmap material
ver3D
  
MatWireframe(uiColor:uint, nWidth:Number = 2):WireframeMaterial
Creates and returns a wireframe material
ver3D
  
MoveCamera(vPos:Vector3D):void
Moves the camera by different amounts.
ver3D
  
Remove():void
Removes the 3D scene completely.
ver3D
  
Removes all 3D objects from the container/scene
ver3D
  
Resets the position and angle of the camera.
ver3D
  
ZOrderFix(bEnabled:Boolean):void
Enables Z order sorting fix.
ver3D
Protected Methods
 MethodDefined By
  
[override] Concommands of the component.
ver3D
  
_Update():void
[override] Updates the 3D rendering.
ver3D
Property Detail
cameraproperty
camera:Camera3D  [read-only]

Returns the 3D camera


Implementation
    public function get camera():Camera3D
containerproperty 
container:ObjectContainer3D  [read-only]

Returns the 3D container


Implementation
    public function get container():ObjectContainer3D
viewproperty 
view:View3D  [read-only]

Returns the 3D view


Implementation
    public function get view():View3D
Constructor Detail
ver3D()Constructor
public function ver3D(sStage:Stage)

Constructor of the component.

Parameters
sStage:Stage
Method Detail
_Concommands()method
override protected function _Concommands():void

Concommands of the component.

_Destruct()method 
override public function _Destruct():void

Destructor of the component.

_Update()method 
override protected function _Update():void

Updates the 3D rendering.

CastBitmapData()method 
public final function CastBitmapData(materialClass:Class):BitmapData

Creates and returns bitmap data from an image class

Parameters

materialClass:Class

Returns
BitmapData
Create()method 
public final function Create(sLayer:String, bZOrderFix:Boolean = false):void

Creates the 3D scene.

Parameters

sLayer:String — Layer the 3D should be rendered in
 
bZOrderFix:Boolean (default = false) — Enables z order fix (very costly)

CreateCube()method 
public final function CreateCube(vPos:Vector3D, nWidth:Number, nHeight:Number, nDepth:Number, cubeMaterial:Material):Cube

Creates and displays a 3D cube

Parameters

vPos:Vector3D — Position of cube
 
nWidth:Number — Width of cube
 
nHeight:Number — Height of cube
 
nDepth:Number — Depth of cube
 
cubeMaterial:Material — Material of cube

Returns
Cube
CreateLine()method 
public final function CreateLine(vStartPos:Vertex, vEndPos:Vertex, uiColor:uint = 0x00000):LineSegment

Creates and displays a 3D line

Parameters

vStartPos:Vertex — Start position
 
vEndPos:Vertex — End position
 
uiColor:uint (default = 0x00000) — Color

Returns
LineSegment
CreateModel()method 
public final function CreateModel(objClass:Class, vPos:Vector3D, nScale:Number = 1):Object3D

Creates and displays a new 3D model

Parameters

objClass:Class — 3D model class
 
vPos:Vector3D — 3D position
 
nScale:Number (default = 1) — Scale of model

Returns
Object3D
CreatePointLight()method 
public final function CreatePointLight(vPos:Vector3D, nBrightness:Number, uiColor:uint):PointLight3D

Creates and returns a 3D point light (taxing)

Parameters

vPos:Vector3D — Position of the light
 
nBrightness:Number — Brightness of the light
 
uiColor:uint — Color of the light

Returns
PointLight3D
CreateSkybox()method 
public final function CreateSkybox(skyMaterial:Material):Skybox6

Creates and displays a 3D skybox (this is taxing)

Parameters

skyMaterial:Material

Returns
Skybox6
CreateSprite()method 
public final function CreateSprite(vPos:Vector3D, material:Material, nWidth:Number, nHeight:Number, nScale:Number = 1, nRot:Number = 0, sAlign:String = center):Sprite3D

Creates and displays a 3D sprite

Parameters

vPos:Vector3D — Position of the sprite
 
material:Material — Material of the sprite
 
nWidth:Number — Width of the sprite
 
nHeight:Number — Height of the sprite
 
nScale:Number (default = 1) — Scale of the sprite
 
nRot:Number (default = 0) — Rotation of the sprite
 
sAlign:String (default = center) — Alignment of the sprite

Returns
Sprite3D
MatBitmap()method 
public final function MatBitmap(materialClass:Class):BitmapMaterial

Creates and returns a 3D bitmap material

Parameters

materialClass:Class — Material image

Returns
BitmapMaterial
MatColor()method 
public final function MatColor(uiColor:uint):ColorMaterial

Creates and returns a solid color material

Parameters

uiColor:uint

Returns
ColorMaterial
MatCube()method 
public final function MatCube(topMat:Material = null, bottomMat:Material = null, frontMat:Material = null, leftMat:Material = null, rightMat:Material = null, backMat:Material = null):CubeMaterialsData

Creates and returns a material cube (a material with seperate textures per side)

Parameters

topMat:Material (default = null) — Top material
 
bottomMat:Material (default = null) — Bottom material
 
frontMat:Material (default = null) — Front material
 
leftMat:Material (default = null) — Left material
 
rightMat:Material (default = null) — Right material
 
backMat:Material (default = null) — Back material

Returns
CubeMaterialsData
MatTransform()method 
public final function MatTransform(materialClass:Class, bRepeat:Boolean = true, nScaleX:Number = 1, nScaleY:Number = 1):TransformBitmapMaterial

Creates and returns a 3D transform bitmap material

Parameters

materialClass:Class — Material image
 
bRepeat:Boolean (default = true) — Does it repeat
 
nScaleX:Number (default = 1) — Scale of material x tile
 
nScaleY:Number (default = 1) — Scale of material Y tile

Returns
TransformBitmapMaterial
MatWireframe()method 
public final function MatWireframe(uiColor:uint, nWidth:Number = 2):WireframeMaterial

Creates and returns a wireframe material

Parameters

uiColor:uint
 
nWidth:Number (default = 2)

Returns
WireframeMaterial
MoveCamera()method 
public final function MoveCamera(vPos:Vector3D):void

Moves the camera by different amounts.

Parameters

vPos:Vector3D

Remove()method 
public final function Remove():void

Removes the 3D scene completely.

RemoveAllObjects()method 
public final function RemoveAllObjects():void

Removes all 3D objects from the container/scene

ResetCamera()method 
public final function ResetCamera():void

Resets the position and angle of the camera.

ZOrderFix()method 
public final function ZOrderFix(bEnabled:Boolean):void

Enables Z order sorting fix. This fix is VERY taxing!

Parameters

bEnabled:Boolean — Enable/disable Z order fix.