Interface ILspVertexArray
- All Known Subinterfaces:
ILspIndexedVertexArray,ILspMutableVertexArray,ILspNonIndexedVertexArray
public interface ILspVertexArray
Interface describing a vertex array. A vertex array consists of one or more
Buffers with vertex data, as well as a number of
ILspVertexAttribute objects describing the structure of the buffers.
Vertex arrays are usually modified asynchronously and rendered synchronously, hence
locking is needed.
- Since:
- 2012.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the point relative to which the coordinates in this vertex array are defined.getData(int aVertexAttributeIndex) Returns the buffer that contains the vertex array's data.getData(ILspVertexAttribute aVertexAttribute) Returns the buffer that contains the data for the given vertex attribute.intgetSize()Returns the number of vertices in this array.getVertexAttribute(int aVertexAttributeIndex) Returns the descriptor of the specified vertex attribute.intReturns the number of attributes of the vertices in this array.booleanhasVertexAttribute(ILspVertexAttribute aVertexAttribute) Checks whether this vertex array has the given vertex attribute.voidlock()Obtains exclusive access to this vertex array for the calling thread.voidunlock()Releases a previously obtained lock on this vertex array.
-
Method Details
-
getVertexAttributeCount
int getVertexAttributeCount()Returns the number of attributes of the vertices in this array.- Returns:
- the number of attributes of the vertices in this array
-
getVertexAttribute
Returns the descriptor of the specified vertex attribute.- Parameters:
aVertexAttributeIndex- an index between zero andgetVertexAttributeCount()- Returns:
- an
ILspVertexAttribute
-
hasVertexAttribute
Checks whether this vertex array has the given vertex attribute.- Parameters:
aVertexAttribute- the vertex attribute- Returns:
- whether or not this array contains the given attribute
-
lock
void lock()Obtains exclusive access to this vertex array for the calling thread. This method should be called when rendering from the vertex array and when modifying its contents. Each call tolock()must be paired with a call tounlock(). -
unlock
void unlock()Releases a previously obtained lock on this vertex array. This method must only be called if the calling thread has previously acquired a lock on the vertex array usinglock(). -
getData
Returns the buffer that contains the vertex array's data. For interleaved vertex arrays, the same buffer should be returned for every vertex attribute.- Parameters:
aVertexAttributeIndex- the index of the vertex attribute to get the buffer for- Returns:
- the buffer that contains the vertex array's data
-
getData
Returns the buffer that contains the data for the given vertex attribute. Can returnnullif no data is stored for the given attribute.- Parameters:
aVertexAttribute- the attribute to retrieve the data for- Returns:
- the buffer that contains the data for the given vertex attribute, or
nullif no data is available
-
getCoordinateOrigin
ILcdPoint getCoordinateOrigin()Returns the point relative to which the coordinates in this vertex array are defined. This method may return null if the vertex array is defined in absolute world coordinates.- Returns:
- the point relative to which the coordinates in this vertex array are defined
-
getSize
int getSize()Returns the number of vertices in this array.- Returns:
- the number of vertices in this vertex array
-