Packageaway3d.core.draw
Classpublic class DrawPrimitive
SubclassesBlocker, DrawBitmap, DrawDisplayObject, DrawFog, DrawScaledBitmap, DrawSegment, DrawSprite, DrawTriangle

Abstract class for all drawing primitives

Public Properties
 PropertyDefined by
  create : Function
Placeholder function for creating new drawing primitives from a cache of objects.
DrawPrimitive
  generated : Boolean
Indicator of whether primitive is the produce of a generator algorithm
DrawPrimitive
  ignoreSort : Boolean
DrawPrimitive
  maxX : Number
Indicates the maximum x value of the drawing primitive.
DrawPrimitive
  maxY : Number
Indicates the maximum y value of the drawing primitive.
DrawPrimitive
  maxZ : Number
Indicates the maximum z value of the drawing primitive.
DrawPrimitive
  minX : Number
Indicates the minimum x value of the drawing primitive.
DrawPrimitive
  minY : Number
Indicates the minimum y value of the drawing primitive.
DrawPrimitive
  minZ : Number
Indicates the minimum z value of the drawing primitive.
DrawPrimitive
  quadrant : PrimitiveQuadrantTreeNode
Reference to the last quadrant used by the drawing primitive.
DrawPrimitive
  screenZ : Number
Indicates the screen z value of the drawing primitive (used for z-sorting).
DrawPrimitive
  source : Object3D
The parent 3d object of the drawing primitive.
DrawPrimitive
  view : View3D
The view 3d object of the drawing primitive.
DrawPrimitive
Public Methods
 MethodDefined by
  
calc():void
Calculates the min, max and screen properties required for rendering the drawing primitive.
DrawPrimitive
  
clear():void
Deletes the data currently held by the drawing primitive.
DrawPrimitive
  
contains(x:Number, y:Number):Boolean
Determines whether the given point lies inside the drawing primitive
DrawPrimitive
  
getZ(x:Number, y:Number):Number
Calulates the screen z value of a precise point on the drawing primitive.
DrawPrimitive
  
quarter(focus:Number):Array
Cuts the drawing primitive into 4 equally sized drawing primitives.
DrawPrimitive
  
render():void
Draws the primitive to the view.
DrawPrimitive
  
toString():String
Used to trace the values of a drawing primitive.
DrawPrimitive
Property detail
createproperty
public var create:Function

Placeholder function for creating new drawing primitives from a cache of objects. Saves recreating objects and GC problems.

generatedproperty 
public var generated:Boolean

Indicator of whether primitive is the produce of a generator algorithm

ignoreSortproperty 
public var ignoreSort:Boolean
maxXproperty 
public var maxX:Number

Indicates the maximum x value of the drawing primitive.

maxYproperty 
public var maxY:Number

Indicates the maximum y value of the drawing primitive.

maxZproperty 
public var maxZ:Number

Indicates the maximum z value of the drawing primitive.

minXproperty 
public var minX:Number

Indicates the minimum x value of the drawing primitive.

minYproperty 
public var minY:Number

Indicates the minimum y value of the drawing primitive.

minZproperty 
public var minZ:Number

Indicates the minimum z value of the drawing primitive.

quadrantproperty 
public var quadrant:PrimitiveQuadrantTreeNode

Reference to the last quadrant used by the drawing primitive. Used in PrimitiveQuadrantTree

See also

away3d.core.render.PrimitiveQuadrantTree
screenZproperty 
public var screenZ:Number

Indicates the screen z value of the drawing primitive (used for z-sorting).

sourceproperty 
public var source:Object3D

The parent 3d object of the drawing primitive.

viewproperty 
public var view:View3D

The view 3d object of the drawing primitive.

Method detail
calc()method
public function calc():void

Calculates the min, max and screen properties required for rendering the drawing primitive.

clear()method 
public function clear():void

Deletes the data currently held by the drawing primitive.

contains()method 
public function contains(x:Number, y:Number):Boolean

Determines whether the given point lies inside the drawing primitive

Parameters
x:Number — The x position of the point to be tested.
 
y:Number — The y position of the point to be tested.

Returns
Boolean — The result of the test.
getZ()method 
public function getZ(x:Number, y:Number):Number

Calulates the screen z value of a precise point on the drawing primitive.

Parameters
x:Number — The x position of the point to be tested.
 
y:Number — The y position of the point to be tested.

Returns
Number — The screen z value (used in z-sorting).
quarter()method 
public function quarter(focus:Number):Array

Cuts the drawing primitive into 4 equally sized drawing primitives. Used in z-sorting correction.

Parameters
focus:Number — The focus value of the camera being used in the view.

Returns
Array

See also

render()method 
public function render():void

Draws the primitive to the view.

toString()method 
public function toString():String

Used to trace the values of a drawing primitive.

Returns
String — A string representation of the drawing primitive.
Wiki link
Click to go to the wiki page for 'away3d.core.draw.DrawPrimitive'

Code examples

Comments