Package | flare.core |
Class | public class Surface3D |
Inheritance | Surface3D flash.events.EventDispatcher |
Implements | ILibraryItem |
Property | Defined 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 | ||
format : Vector.<String>
The buffer format specified for each input. | Surface3D | ||
indexBuffer : IndexBuffer3D
Buffer of indices that reference to a vertex buffers of the Surface3D. | Surface3D | ||
indexBytes : ByteArray
Vector 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 | ||
instanceOf : Surface3D
Gets or sets the instance reference of the surface if there is one. | 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 | ||
polys : Vector.<Poly3D> | Surface3D | ||
scene : Scene3D
Gets the scene context of the surface. | Surface3D | ||
sizePerVertex : int = 0
The number of data values associated with each vertex
| Surface3D | ||
sources : Vector.<Surface3D>
The surface sources of data index from where the input should be read. | Surface3D | ||
vertexAttributes : uint = 0
A 32bit flag values which defines the vertex attributes associated to this surface (including external surface sources). | Surface3D | ||
vertexBuffer : VertexBuffer3D
Buffer of vertices that reference to a vertex buffers of the Surface3D. | Surface3D | ||
vertexBytes : ByteArray
Vector 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 | ||
visible : Boolean = true | Surface3D |
Method | Defined By | ||
---|---|---|---|
Surface3D(name:String)
Creates a new Surface3D object. | Surface3D | ||
addExternalSource(dataIndex:int, source:Surface3D):void
Adds a new attribute from an external source which is not directly stored on the surface. | Surface3D | ||
addVertexData(dataIndex:int, size:int = -1, vector:Vector.<Number> = null):int
Define a new attribute for each vertex. | Surface3D | ||
dispose():void
Destroys, downloads and removes all the used memory by the surface, thus it can't longer be used. | Surface3D | ||
download():void
Downloads and removes the GPU buffers immediately, but the surface data remains intact so it could be changed or uploaded for later use. | Surface3D | ||
getVertexData(data:int):Vector.<Number> | Surface3D | ||
getVertexDataSize(data:int):int | Surface3D | ||
hasVertexData(data:int, includeExternalSources:Boolean = true):Boolean | Surface3D | ||
removeVertexData(data:int):Boolean | Surface3D | ||
Goes through each vertex to calculate the surface boundings. | Surface3D | ||
updateIndexBuffer(startIndex:int = 0, numIndices:int = -1):void
Updates a portion or all the surface index data into the GPU buffers. | Surface3D | ||
updateVertexBuffer(startVertex:int = 0, numVertices:int = -1):void
Updates a portion or all the surface vertex data into the GPU buffers. | Surface3D | ||
Link the surface to be uploaded on a specific scene context. | Surface3D |
Constant | Defined 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 | ||
TARGET_NORMAL : int = 13 [static]
Vertex target normal attribute (float3). | Surface3D | ||
TARGET_POSITION : int = 12 [static]
Vertex target position 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 | ||
UV2 : int = 14 [static]
Vertex third uv channel attribute (float2). | Surface3D | ||
UV3 : int = 15 [static]
Vertex four uv channel attribute (float2). | Surface3D |
bounds | property |
public var bounds:Boundings3D
Returns or sets a Boundings3D object with object properties, such as radius, dimensions, etc.
See also
firstIndex | property |
public var firstIndex:int = 0
The index of the first vertex index selected to render.
format | property |
public var format:Vector.<String>
The buffer format specified for each input.
indexBuffer | property |
public var indexBuffer:IndexBuffer3D
Buffer of indices that reference to a vertex buffers of the Surface3D.
indexBytes | property |
public var indexBytes:ByteArray
Vector of indices that reference to a vertex buffers of the Surface3D.
indexVector | property |
indexVector:Vector.<uint>
Vector of indices that reference to a vertex buffers of the Surface3D.
public function get indexVector():Vector.<uint>
public function set indexVector(value:Vector.<uint>):void
instanceOf | property |
instanceOf:Surface3D
Gets or sets the instance reference of the surface if there is one.
public function get instanceOf():Surface3D
public function set instanceOf(value:Surface3D):void
material | property |
material:Material3D
Material instance to render the surface.
public function get material():Material3D
public function set material(value:Material3D):void
name | property |
public var name:String
The name of the surface.
numTriangles | property |
public var numTriangles:int = -1
Number of triangles that will be drawn.
offset | property |
public var offset:Vector.<int>
The offset of data index in the vertexVector.
polys | property |
polys:Vector.<Poly3D>
public function get polys():Vector.<Poly3D>
public function set polys(value:Vector.<Poly3D>):void
scene | property |
public var scene:Scene3D
Gets the scene context of the surface. Do not change this property manually, to change the scene context, call to download() and then to upload() methods.
sizePerVertex | property |
public var sizePerVertex:int = 0
The number of data values associated with each vertex
sources | property |
public var sources:Vector.<Surface3D>
The surface sources of data index from where the input should be read. A null value means the same surface.
vertexAttributes | property |
public var vertexAttributes:uint = 0
A 32bit flag values which defines the vertex attributes associated to this surface (including external surface sources). Do not change this value manually, it is updated when using its own Surface3D methods.
See also
vertexBuffer | property |
public var vertexBuffer:VertexBuffer3D
Buffer of vertices that reference to a vertex buffers of the Surface3D.
vertexBytes | property |
public var vertexBytes:ByteArray
Vector of vertices that reference to a vertex buffers of the Surface3D.
vertexVector | property |
vertexVector:Vector.<Number>
Vector of vertices that reference to a vertex buffers of the Surface3D.
public function get vertexVector():Vector.<Number>
public function set vertexVector(value:Vector.<Number>):void
visible | property |
public var visible:Boolean = true
Surface3D | () | Constructor |
public function Surface3D(name:String)
Creates a new Surface3D object.
Parametersname:String |
addExternalSource | () | method |
public function addExternalSource(dataIndex:int, source:Surface3D):void
Adds a new attribute from an external source which is not directly stored on the surface. These external sources are usually temporal or dynamic buffers which are generated at runtime. Some examples includes tangents and bitangents, dynamic vertex offset positions, etc. Note that the external surface must have the propper data values for each particular attribute you want to aasociate, which also correspond to the associated dataIndex.
Parameters
dataIndex:int — A value from 0 to 15 which defines the type of data to be assocciated. Common values are POSITION, NORMALS, UV0, UV1, etc. constans of the Surface3D class.
| |
source:Surface3D — The external surface data.
|
addVertexData | () | method |
public function addVertexData(dataIndex:int, 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:int — A value from 0 to 15 which defines the type of data to be assocciated. Common values are 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 )
|
int —
|
dispose | () | method |
public function dispose():void
Destroys, downloads and removes all the used memory by the surface, thus it can't longer be used.
See also
download | () | method |
public function download():void
Downloads and removes the GPU buffers immediately, but the surface data remains intact so it could be changed or uploaded for later use. When unsing download method, it is correct to remove the meshes or objects that are using it from the scene, otherwise, the surface will be uploaded again during the next frame render.
See also
getVertexData | () | method |
public function getVertexData(data:int):Vector.<Number>
Parameters
data:int |
Vector.<Number> |
getVertexDataSize | () | method |
public function getVertexDataSize(data:int):int
Parameters
data:int |
int |
hasVertexData | () | method |
public function hasVertexData(data:int, includeExternalSources:Boolean = true):Boolean
Parameters
data:int | |
includeExternalSources:Boolean (default = true )
|
Boolean |
removeVertexData | () | method |
public function removeVertexData(data:int):Boolean
Parameters
data:int |
Boolean |
updateBoundings | () | method |
public function updateBoundings():Boundings3D
Goes through each vertex to calculate the surface boundings.
ReturnsBoundings3D — A new Boundings3D object with the result.
|
updateIndexBuffer | () | method |
public function updateIndexBuffer(startIndex:int = 0, numIndices:int = -1):void
Updates a portion or all the surface index data into the GPU buffers.
Parameters
startIndex:int (default = 0 ) — The index of the first index to be loaded. A value not equal to zero may be used to load a sub-region of the index data.
| |
numIndices:int (default = -1 ) — The number of indices to be updated.
|
See also
updateVertexBuffer | () | method |
public function updateVertexBuffer(startVertex:int = 0, numVertices:int = -1):void
Updates a portion or all the surface vertex data into the GPU buffers.
Parameters
startVertex:int (default = 0 ) — The index of the first vertex to be loaded. A value for startVertex not equal to zero may be used to load a sub-region of the vertex data.
| |
numVertices:int (default = -1 ) — The number of vertices to be updated.
|
See also
upload | () | method |
public function upload(scene:Scene3D):void
Link the surface to be uploaded on a specific scene context. If the scene context is already avaiable and the surface isn't linked to any context yet, it is uploaded immediately, otherwise, it will wait until a scene context is available or the surface needs to be render, in which case it is linked to the current scene context in use. Calling to this method multiple times has no effect. To update buffers data on the GPU, use updateVertexBuffer and updateIndexBuffer methods instead. If the size of the surface data needs to be changed, call first to download method to dispose the current buffers.
Parameters
scene:Scene3D — The scene context in which the surface will be uploaded.
|
See also
BITANGENT | Constant |
public static const BITANGENT:int = 5
Vertex bi-tangents attribute (float3).
COLOR0 | Constant |
public static const COLOR0:int = 9
Vertex color attribute (float3).
COLOR1 | Constant |
public static const COLOR1:int = 10
Vertex color attribute (float3).
COLOR2 | Constant |
public static const COLOR2:int = 11
Vertex color attribute (float3).
NORMAL | Constant |
public static const NORMAL:int = 3
Vertex normals attribute (float3).
PARTICLE | Constant |
public static const PARTICLE:int = 6
Vertex particles attribute (float4). Life (0-1), rotation in radians and size x and y (-1 to 1).
POSITION | Constant |
public static const POSITION:int = 0
Vertex position attribute (float3).
SKIN_INDICES | Constant |
public static const SKIN_INDICES:int = 8
Vertex skin indices attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).
SKIN_WEIGHTS | Constant |
public static const SKIN_WEIGHTS:int = 7
Vertex skin weights attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).
TANGENT | Constant |
public static const TANGENT:int = 4
Vertex tangents attribute (float3).
TARGET_NORMAL | Constant |
public static const TARGET_NORMAL:int = 13
Vertex target normal attribute (float3).
TARGET_POSITION | Constant |
public static const TARGET_POSITION:int = 12
Vertex target position attribute (float3).
UV0 | Constant |
public static const UV0:int = 1
Vertex primary uv channel attribute (flaot2).
UV1 | Constant |
public static const UV1:int = 2
Vertex secondary uv channel attribute (float2).
UV2 | Constant |
public static const UV2:int = 14
Vertex third uv channel attribute (float2).
UV3 | Constant |
public static const UV3:int = 15
Vertex four uv channel attribute (float2).