A CC3VertexArray that manages the texture coordinates aspect of an array of vertices. More...
#import <CC3VertexArrays.h>
Public Member Functions | |
(void) | - alignWithInvertedTexture: |
(void) | - alignWithInvertedTextureMapSize: |
(void) | - alignWithTexture: |
(void) | - alignWithTextureMapSize: |
(void) | - setTexCoord2F:at: |
(ccTex2F) | - texCoord2FAt: |
This class includes several convenience methods that allow the texture coordinates to be adjusted to match the visible area of a particular texture.
- (void) alignWithInvertedTexture: | (CC3Texture *) | texture |
Aligns the texture coordinate array with the specfied texture.
The texture coordinates are aligned assuming that the texture is inverted in the Y-direction. Certain texture formats are inverted during loading, and this method can be used to compensate.
Care should be taken when using this method, as it changes the actual vertex data. This may cause mapping conflicts if the same vertex data is shared by other CC3MeshNodes that use different textures.
- (void) alignWithInvertedTextureMapSize: | (ccTex2F) | texMapSize |
Aligns the texture coordinate array with the specfied texture map size, which is typically extracted from a specific texture.
The texture coordinates are aligned assuming that the texture is inverted in the Y-direction. Certain texture formats are inverted during loading, and this method can be used to compensate.
Care should be taken when using this method, as it changes the actual vertex data. This may cause mapping conflicts if the same vertex data is shared by other CC3MeshNodes that use different textures.
- (void) alignWithTexture: | (CC3Texture *) | texture |
Aligns the texture coordinate array with the specfied texture.
Care should be taken when using this method, as it changes the actual vertex data. This may cause mapping conflicts if the same vertex data is shared by other CC3MeshNodes that use different textures.
- (void) alignWithTextureMapSize: | (ccTex2F) | texMapSize |
Aligns the texture coordinate array with the specfied texture map size, which is typically extracted from a specific texture.
Care should be taken when using this method, as it changes the actual vertex data. This may cause mapping conflicts if the same vertex data is shared by other CC3MeshNodes that use different textures.
+ (id) arrayFromSPODMesh: | (PODStructPtr) | aSPODMesh | |
forTextureChannel: | (GLuint) | texChannelIndex | |
Allocates and initializes an autoreleased instance from the specified SPODMesh structure, using the specified texture channel.
- (id) initFromSPODMesh: | (PODStructPtr) | aSPODMesh |
Initializes this instance from the specified SPODMesh structure, using texture channel zero.
- (id) initFromSPODMesh: | (PODStructPtr) | aSPODMesh | |
forTextureChannel: | (GLuint) | texChannelIndex | |
Initializes this instance from the specified SPODMesh structure, using the specified texture channel.
- (void) setTexCoord2F: | (ccTex2F) | aTex2F | |
at: | (GLsizei) | index | |
Sets the texture coordinate element at the specified index in the underlying vertex data to the specified texture coordinate value.
The index refers to elements, not bytes. The implementation takes into consideration the elementStride and elementOffset properties to access the correct element.
If the createGLBuffer method has been invoked and the underlying vertex data has been released, this method will raise an assertion exception.
- (ccTex2F) texCoord2FAt: | (GLsizei) | index |
Returns the texture coordinate element at the specified index in the underlying vertex data.
The index refers to elements, not bytes. The implementation takes into consideration the elementStride and elementOffset properties to access the correct element.
If the createGLBuffer method has been invoked and the underlying vertex data has been released, this method will raise an assertion exception.