Packageaway3d.core.base
Classpublic class SubGeometry
InheritanceSubGeometry Inheritance Object
Subclasses SkinnedSubGeometry

The SubGeometry class is a collections of geometric data that describes a triangle mesh. It is owned by a Geometry instance, and wrapped by a SubMesh in the scene graph. Several SubGeometries are grouped so they can be rendered with different materials, but still represent a single object.

See also

away3d.core.base.Geometry
away3d.core.base.SubMesh


Public Properties
 PropertyDefined By
  autoDeriveVertexNormals : Boolean
True if the vertex normals should be derived from the geometry, false if the vertex normals are set explicitly.
SubGeometry
  autoDeriveVertexTangents : Boolean
True if the vertex tangents should be derived from the geometry, false if the vertex normals are set explicitly.
SubGeometry
  autoGenerateDummyUVs : Boolean
Defines whether a UV buffer should be automatically generated to contain dummy UV coordinates.
SubGeometry
  normalBufferOffset : int
[read-only]
SubGeometry
  numTriangles : uint
[read-only] The total amount of triangles in the SubGeometry.
SubGeometry
  numVertices : uint
[read-only] The total amount of vertices in the SubGeometry.
SubGeometry
  scaleU : Number
[read-only]
SubGeometry
  scaleV : Number
[read-only]
SubGeometry
  secondaryUVBufferOffset : int
[read-only]
SubGeometry
  secondaryUVData : Vector.<Number>
[read-only]
SubGeometry
  tangentBufferOffset : int
[read-only]
SubGeometry
  useFaceWeights : Boolean
Indicates whether or not to take the size of faces into account when auto-deriving vertex normals and tangents.
SubGeometry
  UVBufferOffset : int
[read-only]
SubGeometry
  UVData : Vector.<Number>
[read-only] The raw texture coordinate data.
SubGeometry
  vertexBufferOffset : int
[read-only]
SubGeometry
  vertexData : Vector.<Number>
[read-only] The raw vertex position data.
SubGeometry
  vertexNormalData : Vector.<Number>
[read-only] The raw vertex normal data.
SubGeometry
Protected Properties
 PropertyDefined By
  _customBuffer : Vector.<VertexBuffer3D>
SubGeometry
  _customBufferContext : Vector.<Context3D>
SubGeometry
  _customData : Vector.<Number>
SubGeometry
  _faceNormalsData : Vector.<Number>
SubGeometry
  _faceNormalsDirty : Boolean = true
SubGeometry
  _faceTangents : Vector.<Number>
SubGeometry
  _faceTangentsDirty : Boolean = true
SubGeometry
  _faceWeights : Vector.<Number>
SubGeometry
  _indexBuffer : Vector.<IndexBuffer3D>
SubGeometry
  _indexBufferContext : Vector.<Context3D>
SubGeometry
  _indices : Vector.<uint>
SubGeometry
  _numIndices : uint
SubGeometry
  _numTriangles : uint
SubGeometry
  _numVertices : uint
SubGeometry
  _secondaryUvBuffer : Vector.<VertexBuffer3D>
SubGeometry
  _secondaryUvBufferContext : Vector.<Context3D>
SubGeometry
  _secondaryUvs : Vector.<Number>
SubGeometry
  _uvBuffer : Vector.<VertexBuffer3D>
SubGeometry
  _uvBufferContext : Vector.<Context3D>
SubGeometry
  _uvs : Vector.<Number>
SubGeometry
  _uvsDirty : Boolean = true
SubGeometry
  _vertexBuffer : Vector.<VertexBuffer3D>
SubGeometry
  _vertexBufferContext : Vector.<Context3D>
SubGeometry
  _vertexNormalBuffer : Vector.<VertexBuffer3D>
SubGeometry
  _vertexNormalBufferContext : Vector.<Context3D>
SubGeometry
  _vertexNormals : Vector.<Number>
SubGeometry
  _vertexNormalsDirty : Boolean = true
SubGeometry
  _vertexTangentBuffer : Vector.<VertexBuffer3D>
SubGeometry
  _vertexTangentBufferContext : Vector.<Context3D>
SubGeometry
  _vertexTangents : Vector.<Number>
SubGeometry
  _vertexTangentsDirty : Boolean = true
SubGeometry
  _vertices : Vector.<Number>
SubGeometry
Public Methods
 MethodDefined By
  
Creates a new SubGeometry object.
SubGeometry
  
applyTransformation(transform:Matrix3D):void
SubGeometry
  
Clones the current object
SubGeometry
  
dispose():void
Clears all resources used by the SubGeometry object.
SubGeometry
  
getCustomBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
A buffer allowing you any sort of data.
SubGeometry
  
getIndexBuffer(stage3DProxy:Stage3DProxy):IndexBuffer3D
Retrieves the VertexBuffer3D object that contains triangle indices.
SubGeometry
  
getSecondaryUVBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
SubGeometry
  
getUVBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
Retrieves the VertexBuffer3D object that contains texture coordinates.
SubGeometry
  
getVertexBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
Retrieves the VertexBuffer3D object that contains vertex positions.
SubGeometry
  
getVertexNormalBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
Retrieves the VertexBuffer3D object that contains vertex normals.
SubGeometry
  
getVertexTangentBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
Retrieves the VertexBuffer3D object that contains vertex tangents.
SubGeometry
  
initCustomBuffer(numVertices:int, elementsPerVertex:int):void
SubGeometry
  
scale(scale:Number):void
Scales the geometry.
SubGeometry
  
scaleUV(scaleU:Number = 1, scaleV:Number = 1):void
SubGeometry
  
updateCustomData(data:Vector.<Number>):void
SubGeometry
  
updateIndexData(indices:Vector.<uint>):void
Updates the face indices of the SubGeometry.
SubGeometry
  
updateSecondaryUVData(uvs:Vector.<Number>):void
SubGeometry
  
updateUVData(uvs:Vector.<Number>):void
Updates the uv coordinates of the SubGeometry.
SubGeometry
  
updateVertexData(vertices:Vector.<Number>):void
Updates the vertex data of the SubGeometry.
SubGeometry
  
updateVertexNormalData(vertexNormals:Vector.<Number>):void
Updates the vertex normals of the SubGeometry.
SubGeometry
  
updateVertexTangentData(vertexTangents:Vector.<Number>):void
Updates the vertex tangents of the SubGeometry.
SubGeometry
Protected Methods
 MethodDefined By
  
SubGeometry
  
disposeForStage3D(stage3DProxy:Stage3DProxy):void
SubGeometry
  
disposeIndexBuffers(buffers:Vector.<IndexBuffer3D>):void
Disposes all buffers in a given vector.
SubGeometry
  
disposeVertexBuffers(buffers:Vector.<VertexBuffer3D>):void
Disposes all buffers in a given vector.
SubGeometry
  
invalidateBuffers(buffers:Vector.<Context3D>):void
Invalidates all buffers in a vector, causing them the update when they are first requested.
SubGeometry
Property Detail
_customBufferproperty
protected var _customBuffer:Vector.<VertexBuffer3D>

_customBufferContextproperty 
protected var _customBufferContext:Vector.<Context3D>

_customDataproperty 
protected var _customData:Vector.<Number>

_faceNormalsDataproperty 
protected var _faceNormalsData:Vector.<Number>

_faceNormalsDirtyproperty 
protected var _faceNormalsDirty:Boolean = true

_faceTangentsproperty 
protected var _faceTangents:Vector.<Number>

_faceTangentsDirtyproperty 
protected var _faceTangentsDirty:Boolean = true

_faceWeightsproperty 
protected var _faceWeights:Vector.<Number>

_indexBufferproperty 
protected var _indexBuffer:Vector.<IndexBuffer3D>

_indexBufferContextproperty 
protected var _indexBufferContext:Vector.<Context3D>

_indicesproperty 
protected var _indices:Vector.<uint>

_numIndicesproperty 
protected var _numIndices:uint

_numTrianglesproperty 
protected var _numTriangles:uint

_numVerticesproperty 
protected var _numVertices:uint

_secondaryUvBufferproperty 
protected var _secondaryUvBuffer:Vector.<VertexBuffer3D>

_secondaryUvBufferContextproperty 
protected var _secondaryUvBufferContext:Vector.<Context3D>

_secondaryUvsproperty 
protected var _secondaryUvs:Vector.<Number>

_uvBufferproperty 
protected var _uvBuffer:Vector.<VertexBuffer3D>

_uvBufferContextproperty 
protected var _uvBufferContext:Vector.<Context3D>

_uvsproperty 
protected var _uvs:Vector.<Number>

_uvsDirtyproperty 
protected var _uvsDirty:Boolean = true

_vertexBufferproperty 
protected var _vertexBuffer:Vector.<VertexBuffer3D>

_vertexBufferContextproperty 
protected var _vertexBufferContext:Vector.<Context3D>

_vertexNormalBufferproperty 
protected var _vertexNormalBuffer:Vector.<VertexBuffer3D>

_vertexNormalBufferContextproperty 
protected var _vertexNormalBufferContext:Vector.<Context3D>

_vertexNormalsproperty 
protected var _vertexNormals:Vector.<Number>

_vertexNormalsDirtyproperty 
protected var _vertexNormalsDirty:Boolean = true

_vertexTangentBufferproperty 
protected var _vertexTangentBuffer:Vector.<VertexBuffer3D>

_vertexTangentBufferContextproperty 
protected var _vertexTangentBufferContext:Vector.<Context3D>

_vertexTangentsproperty 
protected var _vertexTangents:Vector.<Number>

_vertexTangentsDirtyproperty 
protected var _vertexTangentsDirty:Boolean = true

_verticesproperty 
protected var _vertices:Vector.<Number>

autoDeriveVertexNormalsproperty 
autoDeriveVertexNormals:Boolean

True if the vertex normals should be derived from the geometry, false if the vertex normals are set explicitly.


Implementation
    public function get autoDeriveVertexNormals():Boolean
    public function set autoDeriveVertexNormals(value:Boolean):void
autoDeriveVertexTangentsproperty 
autoDeriveVertexTangents:Boolean

True if the vertex tangents should be derived from the geometry, false if the vertex normals are set explicitly.


Implementation
    public function get autoDeriveVertexTangents():Boolean
    public function set autoDeriveVertexTangents(value:Boolean):void
autoGenerateDummyUVsproperty 
autoGenerateDummyUVs:Boolean

Defines whether a UV buffer should be automatically generated to contain dummy UV coordinates. Set to true if a geometry lacks UV data but uses a material that requires it, or leave as false in cases where UV data is explicitly defined or the material does not require UV data.


Implementation
    public function get autoGenerateDummyUVs():Boolean
    public function set autoGenerateDummyUVs(value:Boolean):void
normalBufferOffsetproperty 
normalBufferOffset:int  [read-only]


Implementation
    public function get normalBufferOffset():int
numTrianglesproperty 
numTriangles:uint  [read-only]

The total amount of triangles in the SubGeometry.


Implementation
    public function get numTriangles():uint
numVerticesproperty 
numVertices:uint  [read-only]

The total amount of vertices in the SubGeometry.


Implementation
    public function get numVertices():uint
parentGeometryproperty 
parentGeometry:Geometry


Implementation
    arcane function get parentGeometry():Geometry
    arcane function set parentGeometry(value:Geometry):void
scaleUproperty 
scaleU:Number  [read-only]


Implementation
    public function get scaleU():Number
scaleVproperty 
scaleV:Number  [read-only]


Implementation
    public function get scaleV():Number
secondaryUVBufferOffsetproperty 
secondaryUVBufferOffset:int  [read-only]


Implementation
    public function get secondaryUVBufferOffset():int
secondaryUVDataproperty 
secondaryUVData:Vector.<Number>  [read-only]


Implementation
    public function get secondaryUVData():Vector.<Number>
tangentBufferOffsetproperty 
tangentBufferOffset:int  [read-only]


Implementation
    public function get tangentBufferOffset():int
useFaceWeightsproperty 
useFaceWeights:Boolean

Indicates whether or not to take the size of faces into account when auto-deriving vertex normals and tangents.


Implementation
    public function get useFaceWeights():Boolean
    public function set useFaceWeights(value:Boolean):void
UVBufferOffsetproperty 
UVBufferOffset:int  [read-only]


Implementation
    public function get UVBufferOffset():int
UVDataproperty 
UVData:Vector.<Number>  [read-only]

The raw texture coordinate data.


Implementation
    public function get UVData():Vector.<Number>
vertexBufferOffsetproperty 
vertexBufferOffset:int  [read-only]


Implementation
    public function get vertexBufferOffset():int
vertexDataproperty 
vertexData:Vector.<Number>  [read-only]

The raw vertex position data.


Implementation
    public function get vertexData():Vector.<Number>
vertexNormalDataproperty 
vertexNormalData:Vector.<Number>  [read-only]

The raw vertex normal data.


Implementation
    public function get vertexNormalData():Vector.<Number>
Constructor Detail
SubGeometry()Constructor
public function SubGeometry()

Creates a new SubGeometry object.

Method Detail
applyTransformation()method
public function applyTransformation(transform:Matrix3D):void

Parameters

transform:Matrix3D

clone()method 
public function clone():SubGeometry

Clones the current object

Returns
SubGeometry — An exact duplicate of the current object.
dispose()method 
public function dispose():void

Clears all resources used by the SubGeometry object.

disposeAllVertexBuffers()method 
protected function disposeAllVertexBuffers():void

disposeForStage3D()method 
protected function disposeForStage3D(stage3DProxy:Stage3DProxy):void

Parameters

stage3DProxy:Stage3DProxy

disposeIndexBuffers()method 
protected function disposeIndexBuffers(buffers:Vector.<IndexBuffer3D>):void

Disposes all buffers in a given vector.

Parameters

buffers:Vector.<IndexBuffer3D> — The vector of buffers to dispose.

disposeVertexBuffers()method 
protected function disposeVertexBuffers(buffers:Vector.<VertexBuffer3D>):void

Disposes all buffers in a given vector.

Parameters

buffers:Vector.<VertexBuffer3D> — The vector of buffers to dispose.

getCustomBuffer()method 
public function getCustomBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D

A buffer allowing you any sort of data. Needs to be initialized by calling initCustomBuffer

Parameters

stage3DProxy:Stage3DProxy

Returns
VertexBuffer3D
getIndexBuffer()method 
public function getIndexBuffer(stage3DProxy:Stage3DProxy):IndexBuffer3D

Retrieves the VertexBuffer3D object that contains triangle indices.

Parameters

stage3DProxy:Stage3DProxy — The Context3D for which we request the buffer

Returns
IndexBuffer3D — The VertexBuffer3D object that contains triangle indices.
getSecondaryUVBuffer()method 
public function getSecondaryUVBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D

Parameters

stage3DProxy:Stage3DProxy

Returns
VertexBuffer3D
getUVBuffer()method 
public function getUVBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D

Retrieves the VertexBuffer3D object that contains texture coordinates.

Parameters

stage3DProxy:Stage3DProxy — The Context3D for which we request the buffer

Returns
VertexBuffer3D — The VertexBuffer3D object that contains texture coordinates.
getVertexBuffer()method 
public function getVertexBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D

Retrieves the VertexBuffer3D object that contains vertex positions.

Parameters

stage3DProxy:Stage3DProxy — The Context3D for which we request the buffer

Returns
VertexBuffer3D — The VertexBuffer3D object that contains vertex positions.
getVertexNormalBuffer()method 
public function getVertexNormalBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D

Retrieves the VertexBuffer3D object that contains vertex normals.

Parameters

stage3DProxy:Stage3DProxy — The Context3D for which we request the buffer

Returns
VertexBuffer3D — The VertexBuffer3D object that contains vertex normals.
getVertexTangentBuffer()method 
public function getVertexTangentBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D

Retrieves the VertexBuffer3D object that contains vertex tangents.

Parameters

stage3DProxy:Stage3DProxy — The Context3D for which we request the buffer

Returns
VertexBuffer3D — The VertexBuffer3D object that contains vertex tangents.
initCustomBuffer()method 
public function initCustomBuffer(numVertices:int, elementsPerVertex:int):void

Parameters

numVertices:int
 
elementsPerVertex:int

invalidateBuffers()method 
protected function invalidateBuffers(buffers:Vector.<Context3D>):void

Invalidates all buffers in a vector, causing them the update when they are first requested.

Parameters

buffers:Vector.<Context3D> — The vector of buffers to invalidate.

scale()method 
public function scale(scale:Number):void

Scales the geometry.

Parameters

scale:Number — The amount by which to scale.

scaleUV()method 
public function scaleUV(scaleU:Number = 1, scaleV:Number = 1):void

Parameters

scaleU:Number (default = 1)
 
scaleV:Number (default = 1)

updateCustomData()method 
public function updateCustomData(data:Vector.<Number>):void

Parameters

data:Vector.<Number>

updateIndexData()method 
public function updateIndexData(indices:Vector.<uint>):void

Updates the face indices of the SubGeometry.

Parameters

indices:Vector.<uint> — The face indices to upload.

updateSecondaryUVData()method 
public function updateSecondaryUVData(uvs:Vector.<Number>):void

Parameters

uvs:Vector.<Number>

updateUVData()method 
public function updateUVData(uvs:Vector.<Number>):void

Updates the uv coordinates of the SubGeometry.

Parameters

uvs:Vector.<Number> — The uv coordinates to upload.

updateVertexData()method 
public function updateVertexData(vertices:Vector.<Number>):void

Updates the vertex data of the SubGeometry.

Parameters

vertices:Vector.<Number> — The new vertex data to upload.

updateVertexNormalData()method 
public function updateVertexNormalData(vertexNormals:Vector.<Number>):void

Updates the vertex normals of the SubGeometry. When updating the vertex normals like this, autoDeriveVertexNormals will be set to false and vertex normals will no longer be calculated automatically.

Parameters

vertexNormals:Vector.<Number> — The vertex normals to upload.

updateVertexTangentData()method 
public function updateVertexTangentData(vertexTangents:Vector.<Number>):void

Updates the vertex tangents of the SubGeometry. When updating the vertex tangents like this, autoDeriveVertexTangents will be set to false and vertex tangents will no longer be calculated automatically.

Parameters

vertexTangents:Vector.<Number> — The vertex tangents to upload.