Packageaway3d.core.draw
Classpublic class DrawTriangle
InheritanceDrawTriangle Inheritance DrawPrimitive

Triangle drawing primitive

Public Properties
 PropertyDefined by
  area : Number
The calulated area of the triangle primitive.
DrawTriangle
  backface : Boolean = false
Indicates whether the face of the triangle primitive is facing away from the camera.
DrawTriangle
 Inheritedcreate : Function
Placeholder function for creating new drawing primitives from a cache of objects.
DrawPrimitive
  endIndex : int
DrawTriangle
  faceVO : FaceVO
A reference to the face value object used by the triangle primitive.
DrawTriangle
 Inheritedgenerated : Boolean
Indicator of whether primitive is the produce of a generator algorithm
DrawPrimitive
 InheritedignoreSort : Boolean
DrawPrimitive
  material : Material
The material object used as the triangle primitive's texture.
DrawTriangle
 InheritedmaxX : Number
Indicates the maximum x value of the drawing primitive.
DrawPrimitive
 InheritedmaxY : Number
Indicates the maximum y value of the drawing primitive.
DrawPrimitive
 InheritedmaxZ : Number
Indicates the maximum z value of the drawing primitive.
DrawPrimitive
 InheritedminX : Number
Indicates the minimum x value of the drawing primitive.
DrawPrimitive
 InheritedminY : Number
Indicates the minimum y value of the drawing primitive.
DrawPrimitive
 InheritedminZ : Number
Indicates the minimum z value of the drawing primitive.
DrawPrimitive
 Inheritedquadrant : PrimitiveQuadrantTreeNode
Reference to the last quadrant used by the drawing primitive.
DrawPrimitive
  reverseArea : Boolean
DrawTriangle
  screenCommands : Array
DrawTriangle
  screenIndices : Array
DrawTriangle
  screenVertices : Array
DrawTriangle
 InheritedscreenZ : Number
Indicates the screen z value of the drawing primitive (used for z-sorting).
DrawPrimitive
 Inheritedsource : Object3D
The parent 3d object of the drawing primitive.
DrawPrimitive
  startIndex : int
DrawTriangle
  uv0 : UV
The uv0 uv coordinate of the triangle primitive.
DrawTriangle
  uv1 : UV
The uv1 uv coordinate of the triangle primitive.
DrawTriangle
  uv2 : UV
The uv2 uv coordinate of the triangle primitive.
DrawTriangle
  uvtData : Vector
DrawTriangle
  v0x : Number
The x position of the v0 screenvertex of the triangle primitive.
DrawTriangle
  v0y : Number
The y position of the v0 screenvertex of the triangle primitive.
DrawTriangle
  v0z : Number
The z position of the v0 screenvertex of the triangle primitive.
DrawTriangle
  v1x : Number
The x position of the v1 screenvertex of the triangle primitive.
DrawTriangle
  v1y : Number
The y position of the v1 screenvertex of the triangle primitive.
DrawTriangle
  v1z : Number
The z position of the v1 screenvertex of the triangle primitive.
DrawTriangle
  v2x : Number
The x position of the v2 screenvertex of the triangle primitive.
DrawTriangle
  v2y : Number
The y position of the v2 screenvertex of the triangle primitive.
DrawTriangle
  v2z : Number
The z position of the v2 screenvertex of the triangle primitive.
DrawTriangle
 Inheritedview : 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.
DrawTriangle
  
clear():void
Deletes the data currently held by the drawing primitive.
DrawTriangle
  
contains(x:Number, y:Number):Boolean
Determines whether the given point lies inside the drawing primitive
DrawTriangle
  
distanceToCenter(x:Number, y:Number):Number
DrawTriangle
  
getUV(x:Number, y:Number):UV
Calulates the uv value of a precise point on the drawing primitive.
DrawTriangle
  
getZ(x:Number, y:Number):Number
Calulates the screen z value of a precise point on the drawing primitive.
DrawTriangle
  
quarter(focus:Number):Array
Cuts the drawing primitive into 4 equally sized drawing primitives.
DrawTriangle
  
render():void
Draws the primitive to the view.
DrawTriangle
  
toString():String
Used to trace the values of a drawing primitive.
DrawTriangle
Property detail
areaproperty
public var area:Number

The calulated area of the triangle primitive.

backfaceproperty 
public var backface:Boolean = false

Indicates whether the face of the triangle primitive is facing away from the camera.

endIndexproperty 
public var endIndex:int
faceVOproperty 
public var faceVO:FaceVO

A reference to the face value object used by the triangle primitive.

materialproperty 
public var material:Material

The material object used as the triangle primitive's texture.

reverseAreaproperty 
public var reverseArea:Boolean
screenCommandsproperty 
public var screenCommands:Array
screenIndicesproperty 
public var screenIndices:Array
screenVerticesproperty 
public var screenVertices:Array
startIndexproperty 
public var startIndex:int
uv0property 
public var uv0:UV

The uv0 uv coordinate of the triangle primitive.

uv1property 
public var uv1:UV

The uv1 uv coordinate of the triangle primitive.

uv2property 
public var uv2:UV

The uv2 uv coordinate of the triangle primitive.

uvtDataproperty 
public var uvtData:Vector
v0xproperty 
public var v0x:Number

The x position of the v0 screenvertex of the triangle primitive.

v0yproperty 
public var v0y:Number

The y position of the v0 screenvertex of the triangle primitive.

v0zproperty 
public var v0z:Number

The z position of the v0 screenvertex of the triangle primitive.

v1xproperty 
public var v1x:Number

The x position of the v1 screenvertex of the triangle primitive.

v1yproperty 
public var v1y:Number

The y position of the v1 screenvertex of the triangle primitive.

v1zproperty 
public var v1z:Number

The z position of the v1 screenvertex of the triangle primitive.

v2xproperty 
public var v2x:Number

The x position of the v2 screenvertex of the triangle primitive.

v2yproperty 
public var v2y:Number

The y position of the v2 screenvertex of the triangle primitive.

v2zproperty 
public var v2z:Number

The z position of the v2 screenvertex of the triangle primitive.

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

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

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

Deletes the data currently held by the drawing primitive.

contains()method 
public final override 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.
distanceToCenter()method 
public final function distanceToCenter(x:Number, y:Number):Number Parameters
x:Number
 
y:Number

Returns
Number
getUV()method 
public function getUV(x:Number, y:Number):UV

Calulates the uv value of a precise point on the drawing primitive. Used to determine the mouse position in interactive materials.

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

Returns
UV — The uv value.
getZ()method 
public final override 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 final override 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
render()method 
public override function render():void

Draws the primitive to the view.

toString()method 
public override 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.DrawTriangle'

Code examples

Comments