window.runtime property | window.runtime.flash.display3D.IndexBuffer3D |
Inheritance | IndexBuffer3D Object |
Runtime Versions: | 3 |
Each value in an index buffer is an index into the current vertex buffer. A sequence of three values defines a triangle. You can upload the index list either from a Vector array or a ByteArray. (Once uploaded, the data in the original array is no longer referenced; changing or discarding the source array does not change the triangle list.)
An index is a 16-bit unsigned integer. The maximum allowable index value is 65535 (0xffff).
Render the triangles defined in an index buffer using the Context3D drawTriangles()
method. To draw a triangle defined in the index buffer, the rendering context looks up the data for
each triangle point in the vertex buffer at the specified index and passes that data as an input to the
vertex shader program. The vertex buffer to use for an input is specified by the most recent call
to the Context3D setVertexBufferAt()
method.
You cannot create an IndexBuffer3D object directly; use the
Context3D createIndexBuffer()
method instead.
To free the render context resources associated with an index buffer, call the object's dispose()
method.
Method | Defined By | ||
---|---|---|---|
dispose():void
Frees all resources associated with this object. | IndexBuffer3D | ||
hasOwnProperty(name:String):Boolean
Indicates whether an object has a specified property defined. | Object | ||
isPrototypeOf(theClass:Object):Boolean
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
propertyIsEnumerable(name:String):Boolean
Indicates whether the specified property exists and is enumerable. | Object | ||
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations. | Object | ||
toLocaleString():String
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
toString():String
Returns the string representation of the specified object. | Object | ||
uploadFromByteArray(data:ByteArray, byteArrayOffset:int, startOffset:int, count:int):void
Uploads a set of triangle indices to the rendering context from a byte array. | IndexBuffer3D | ||
uploadFromVector(data:Vector.<uint>, startOffset:int, count:int):void
Uploads a set of triangle indices to the rendering context from a vector array. | IndexBuffer3D | ||
valueOf():Object
Returns the primitive value of the specified object. | Object |
dispose | () | method |
public function dispose():void
Runtime Versions: | 3 |
Frees all resources associated with this object. After disposing an index buffer, calling upload() and rendering using this object will fail.
uploadFromByteArray | () | method |
public function uploadFromByteArray(data:ByteArray, byteArrayOffset:int, startOffset:int, count:int):void
Runtime Versions: | 3 |
Uploads a set of triangle indices to the rendering context from a byte array.
Parameters
data:ByteArray — a ByteArray containing index data. Each index is represented by 16-bits (two bytes) in the array.
The number of bytes in data must be at least byteArrayOffset plus two times count .
The ByteArray object must use the little endian format.
| |
byteArrayOffset:int — offset, in bytes, into the data ByteArray from where to start reading.
| |
startOffset:int — The index in this IndexBuffer3D object of the first index to be loaded in this IndexBuffer3D object.
A value for startIndex not equal to zero may be used to load a subregion of the index data.
| |
count:int — The number of indices represented by data .
|
Throws
TypeError — when data is null.
| |
RangeError — when any of count , byteArrayOffset ,
or startOffset is less than 0,
or if byteArrayOffset is greater than or equal to the length of data ,
or if two times count plus byteArrayOffset is greater than the
length of data .
|
uploadFromVector | () | method |
public function uploadFromVector(data:Vector.<uint>, startOffset:int, count:int):void
Runtime Versions: | 3 |
Uploads a set of triangle indices to the rendering context from a vector array.
Parameters
data:Vector.<uint> — a vector of vertex indices. Only the low 16 bits of each index value are used.
The length of the vector must be greater than or equal to count .
| |
startOffset:int — The index in this IndexBuffer3D object of the first index to be loaded.
A value for startOffset not equal to zero can be used to load a subregion of the index data.
| |
count:int — The number of indices in data .
|
Throws
TypeError — when data is null .
| |
RangeError — when count is less than 0 or greater than the length of data .
|
Thu Sep 29 2011, 02:34 AM -07:00