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.
protected var _customBuffer:Vector.<VertexBuffer3D>protected var _customBufferContext:Vector.<Context3D>protected var _customData:Vector.<Number>protected var _faceNormalsData:Vector.<Number>protected var _faceNormalsDirty:Boolean = trueprotected var _faceTangents:Vector.<Number>protected var _faceTangentsDirty:Boolean = trueprotected var _faceWeights:Vector.<Number>protected var _indexBuffer:Vector.<IndexBuffer3D>protected var _indexBufferContext:Vector.<Context3D>protected var _indices:Vector.<uint>protected var _numIndices:uintprotected var _numTriangles:uintprotected var _numVertices:uintprotected var _secondaryUvBuffer:Vector.<VertexBuffer3D>protected var _secondaryUvBufferContext:Vector.<Context3D>protected var _secondaryUvs:Vector.<Number>protected var _uvBuffer:Vector.<VertexBuffer3D>protected var _uvBufferContext:Vector.<Context3D>protected var _uvs:Vector.<Number>protected var _uvsDirty:Boolean = trueprotected var _vertexBuffer:Vector.<VertexBuffer3D>protected var _vertexBufferContext:Vector.<Context3D>protected var _vertexNormalBuffer:Vector.<VertexBuffer3D>protected var _vertexNormalBufferContext:Vector.<Context3D>protected var _vertexNormals:Vector.<Number>protected var _vertexNormalsDirty:Boolean = trueprotected var _vertexTangentBuffer:Vector.<VertexBuffer3D>protected var _vertexTangentBufferContext:Vector.<Context3D>protected var _vertexTangents:Vector.<Number>protected var _vertexTangentsDirty:Boolean = trueprotected var _vertices:Vector.<Number>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):voidautoDeriveVertexTangents: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):voidautoGenerateDummyUVs: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):voidnormalBufferOffset:int [read-only]
Implementation public function get normalBufferOffset():intnumTriangles:uint [read-only]
The total amount of triangles in the SubGeometry.
Implementation public function get numTriangles():uintnumVertices:uint [read-only]
The total amount of vertices in the SubGeometry.
Implementation public function get numVertices():uintparentGeometry:Geometry Implementation arcane function get parentGeometry():Geometry arcane function set parentGeometry(value:Geometry):voidscaleU:Number [read-only]
Implementation public function get scaleU():NumberscaleV:Number [read-only]
Implementation public function get scaleV():NumbersecondaryUVBufferOffset:int [read-only]
Implementation public function get secondaryUVBufferOffset():intsecondaryUVData:Vector.<Number> [read-only]
Implementation public function get secondaryUVData():Vector.<Number>tangentBufferOffset:int [read-only]
Implementation public function get tangentBufferOffset():intuseFaceWeights: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):voidUVBufferOffset:int [read-only]
Implementation public function get UVBufferOffset():intUVData:Vector.<Number> [read-only]
The raw texture coordinate data.
Implementation public function get UVData():Vector.<Number>vertexBufferOffset:int [read-only]
Implementation public function get vertexBufferOffset():intvertexData:Vector.<Number> [read-only]
The raw vertex position data.
Implementation public function get vertexData():Vector.<Number>vertexNormalData:Vector.<Number> [read-only]
The raw vertex normal data.
Implementation public function get vertexNormalData():Vector.<Number>public function SubGeometry()
Creates a new SubGeometry object.
public function applyTransformation(transform:Matrix3D):void Parameters
public function clone():SubGeometry
Clones the current object
Returns | SubGeometry — An exact duplicate of the current object.
|
public function dispose():void
Clears all resources used by the SubGeometry object.
protected function disposeAllVertexBuffers():void protected function disposeForStage3D(stage3DProxy:Stage3DProxy):void Parameters
protected function disposeIndexBuffers(buffers:Vector.<IndexBuffer3D>):void
Disposes all buffers in a given vector.
Parameters
| buffers:Vector.<IndexBuffer3D> — The vector of buffers to dispose.
|
protected function disposeVertexBuffers(buffers:Vector.<VertexBuffer3D>):void
Disposes all buffers in a given vector.
Parameters
| buffers:Vector.<VertexBuffer3D> — The vector of buffers to dispose.
|
public function getCustomBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D
A buffer allowing you any sort of data. Needs to be initialized by calling initCustomBuffer
Parameters
Returns 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.
|
public function getSecondaryUVBuffer(stage3DProxy:Stage3DProxy):VertexBuffer3D Parameters
Returns 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.
|
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.
|
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.
|
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.
|
public function initCustomBuffer(numVertices:int, elementsPerVertex:int):void Parameters
| numVertices:int |
| |
| elementsPerVertex:int |
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.
|
public function scale(scale:Number):void
Scales the geometry.
Parameters
| scale:Number — The amount by which to scale.
|
public function scaleUV(scaleU:Number = 1, scaleV:Number = 1):void Parameters
| scaleU:Number (default = 1) |
| |
| scaleV:Number (default = 1) |
public function updateCustomData(data:Vector.<Number>):void Parameters
public function updateIndexData(indices:Vector.<uint>):void
Updates the face indices of the SubGeometry.
Parameters
| indices:Vector.<uint> — The face indices to upload.
|
public function updateSecondaryUVData(uvs:Vector.<Number>):void Parameters
public function updateUVData(uvs:Vector.<Number>):void
Updates the uv coordinates of the SubGeometry.
Parameters
| uvs:Vector.<Number> — The uv coordinates to upload.
|
public function updateVertexData(vertices:Vector.<Number>):void
Updates the vertex data of the SubGeometry.
Parameters
| vertices:Vector.<Number> — The new vertex data to upload.
|
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.
|
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.
|
Tue Jul 17 2012, 10:37 AM +01:00