Packageflare.core
Classpublic class Surface3D
InheritanceSurface3D Inheritance Object

The Surface3D class represents a set of vertices, polygons and surfaces which can be drawn.



Public Properties
 PropertyDefined By
  bounds : Boundings3D
Returns or sets a Boundings3D object with object properties, such as radius, dimensions, etc.
Surface3D
  firstIndex : int = 0
The index of the first vertex index selected to render.
Surface3D
  indexBuffer : IndexBuffer3D
Buffer of indices that reference to a vertex buffers of the Surface3D.
Surface3D
  indexVector : Vector.<uint>
Vector of indices that reference to a vertex buffers of the Surface3D.
Surface3D
  material : Material3D
Material instance to render the surface.
Surface3D
  name : String
The name of the surface.
Surface3D
  numTriangles : int = -1
Number of triangles that will be drawn.
Surface3D
  offset : Vector.<int>
The offset of data index in the vertexVector.
Surface3D
  scene : Scene3D
[read-only]
Surface3D
  sizePerVertex : int = 0
The number of data values associated with each vertex
Surface3D
  vertexBuffer : VertexBuffer3D
Buffer of vertices that reference to a vertex buffers of the Surface3D.
Surface3D
  vertexVector : Vector.<Number>
Vector of vertices that reference to a vertex buffers of the Surface3D.
Surface3D
Public Methods
 MethodDefined By
  
Surface3D(name:String = null)
Creates a new Surface3D object.
Surface3D
  
addVertexData(dataIndex:uint, size:int = -1, vector:Vector.<Number> = null):int
Define a new attribute for each vertex.
Surface3D
  
dispose():void
Surface3D
  
download():void
Surface3D
  
Surface3D
  
upload(scene:Scene3D = null, force:Boolean = false):Boolean
Surface3D
Public Constants
 ConstantDefined By
  BITANGENT : int = 5
[static] Vertex bi-tangents attribute (float3).
Surface3D
  COLOR0 : int = 9
[static] Vertex color attribute (float3).
Surface3D
  COLOR1 : int = 10
[static] Vertex color attribute (float3).
Surface3D
  COLOR2 : int = 11
[static] Vertex color attribute (float3).
Surface3D
  NORMAL : int = 3
[static] Vertex normals attribute (float3).
Surface3D
  PARTICLE : int = 6
[static] Vertex particles attribute (float4).
Surface3D
  POSITION : int = 0
[static] Vertex position attribute (float3).
Surface3D
  SKIN_INDICES : int = 8
[static] Vertex skin indices attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).
Surface3D
  SKIN_WEIGHTS : int = 7
[static] Vertex skin weights attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).
Surface3D
  TANGENT : int = 4
[static] Vertex tangents attribute (float3).
Surface3D
  UV0 : int = 1
[static] Vertex primary uv channel attribute (flaot2).
Surface3D
  UV1 : int = 2
[static] Vertex secondary uv channel attribute (float2).
Surface3D
Property Detail
boundsproperty
public var bounds:Boundings3D

Returns or sets a Boundings3D object with object properties, such as radius, dimensions, etc.

See also

firstIndexproperty 
public var firstIndex:int = 0

The index of the first vertex index selected to render.

indexBufferproperty 
public var indexBuffer:IndexBuffer3D

Buffer of indices that reference to a vertex buffers of the Surface3D.

indexVectorproperty 
public var indexVector:Vector.<uint>

Vector of indices that reference to a vertex buffers of the Surface3D.

materialproperty 
material:Material3D

Material instance to render the surface.


Implementation
    public function get material():Material3D
    public function set material(value:Material3D):void
nameproperty 
public var name:String

The name of the surface.

numTrianglesproperty 
public var numTriangles:int = -1

Number of triangles that will be drawn.

offsetproperty 
public var offset:Vector.<int>

The offset of data index in the vertexVector.

sceneproperty 
scene:Scene3D  [read-only]


Implementation
    public function get scene():Scene3D
sizePerVertexproperty 
public var sizePerVertex:int = 0

The number of data values associated with each vertex

vertexBufferproperty 
public var vertexBuffer:VertexBuffer3D

Buffer of vertices that reference to a vertex buffers of the Surface3D.

vertexVectorproperty 
public var vertexVector:Vector.<Number>

Vector of vertices that reference to a vertex buffers of the Surface3D.

Constructor Detail
Surface3D()Constructor
public function Surface3D(name:String = null)

Creates a new Surface3D object.

Parameters
name:String (default = null)
Method Detail
addVertexData()method
public function addVertexData(dataIndex:uint, size:int = -1, vector:Vector.<Number> = null):int

Define a new attribute for each vertex. Each attribute can be a vector of 1-4 values (flotas) associated to each vertex.

The vertexVector can be for example: x,y,z,nx,ny,nz,u,v, x,y,z,nx,ny,nz,u,v, x,y,z,nx,ny,nz,u,v...

Parameters

dataIndex:uint — A value from 0 to 7 that define the type of data to be assocciated. The common values may be one of the POSITION, NORMALS, UV0, UV1, etc. constans of the Surface3D class.
 
size:int (default = -1) — The size of data associated to the attribute for each vertex (1 to 4).
 
vector:Vector.<Number> (default = null)

Returns
int
dispose()method 
public function dispose():void

download()method 
public function download():void

updateBoundings()method 
public function updateBoundings():Boundings3D

Returns
Boundings3D
upload()method 
public function upload(scene:Scene3D = null, force:Boolean = false):Boolean

Parameters

scene:Scene3D (default = null)
 
force:Boolean (default = false)

Returns
Boolean
Constant Detail
BITANGENTConstant
public static const BITANGENT:int = 5

Vertex bi-tangents attribute (float3).

COLOR0Constant 
public static const COLOR0:int = 9

Vertex color attribute (float3).

COLOR1Constant 
public static const COLOR1:int = 10

Vertex color attribute (float3).

COLOR2Constant 
public static const COLOR2:int = 11

Vertex color attribute (float3).

NORMALConstant 
public static const NORMAL:int = 3

Vertex normals attribute (float3).

PARTICLEConstant 
public static const PARTICLE:int = 6

Vertex particles attribute (float4). Life (0-1), rotation in radians and size x and y (-1 to 1).

POSITIONConstant 
public static const POSITION:int = 0

Vertex position attribute (float3).

SKIN_INDICESConstant 
public static const SKIN_INDICES:int = 8

Vertex skin indices attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).

SKIN_WEIGHTSConstant 
public static const SKIN_WEIGHTS:int = 7

Vertex skin weights attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).

TANGENTConstant 
public static const TANGENT:int = 4

Vertex tangents attribute (float3).

UV0Constant 
public static const UV0:int = 1

Vertex primary uv channel attribute (flaot2).

UV1Constant 
public static const UV1:int = 2

Vertex secondary uv channel attribute (float2).