BenQ Mobile

javax.microedition.m3g
Class VertexBuffer

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.VertexBuffer

public class VertexBuffer
extends Object3D

VertexBuffer holds references to VertexArrays that contain the positions, colors, normals, and texture coordinates for a set of vertices.


Constructor Summary
VertexBuffer()
          Constructs an empty vertex buffer, with all vertex attributes set to null.
 
Method Summary
 VertexArray getColors()
          Gets the current color array, or null if per-vertex colors are not set.
 int getDefaultColor()
          Retrieves the default color of this VertexBuffer.
 VertexArray getNormals()
          Gets the current normal vector array, or null if normals are not set.
 VertexArray getPositions(float[] scaleBias)
          Returns the current vertex position array, or null if positions are not set.
 VertexArray getTexCoords(int index, float[] scaleBias)
          Gets the current texture coordinate array for the specified texturing unit, or null if texture coordinates for that unit are not set.
 int getVertexCount()
          Retrieves the current number of vertices in this VertexBuffer.
 void setColors(VertexArray colors)
          Sets the per-vertex colors for this VertexBuffer.
 void setDefaultColor(int ARGB)
          Sets the color to use in absence of per-vertex colors.
 void setNormals(VertexArray normals)
          Sets the normal vectors for this VertexBuffer.
 void setPositions(VertexArray positions, float scale, float[] bias)
          Sets the vertex positions for this VertexBuffer.
 void setTexCoords(int index, VertexArray texCoords, float scale, float[] bias)
          Sets the texture coordinates for the specified texturing unit.
 
Methods inherited from class javax.microedition.m3g.Object3D
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VertexBuffer

public VertexBuffer()
Constructs an empty vertex buffer, with all vertex attributes set to null.

Method Detail

getVertexCount

public int getVertexCount()
Retrieves the current number of vertices in this VertexBuffer.


setPositions

public void setPositions(VertexArray positions,
                         float scale,
                         float[] bias)
Sets the vertex positions for this VertexBuffer.


setTexCoords

public void setTexCoords(int index,
                         VertexArray texCoords,
                         float scale,
                         float[] bias)
Sets the texture coordinates for the specified texturing unit.


setNormals

public void setNormals(VertexArray normals)
Sets the normal vectors for this VertexBuffer.


setColors

public void setColors(VertexArray colors)
Sets the per-vertex colors for this VertexBuffer.


getPositions

public VertexArray getPositions(float[] scaleBias)
Returns the current vertex position array, or null if positions are not set.


getTexCoords

public VertexArray getTexCoords(int index,
                                float[] scaleBias)
Gets the current texture coordinate array for the specified texturing unit, or null if texture coordinates for that unit are not set.


getNormals

public VertexArray getNormals()
Gets the current normal vector array, or null if normals are not set.


getColors

public VertexArray getColors()
Gets the current color array, or null if per-vertex colors are not set.


setDefaultColor

public void setDefaultColor(int ARGB)
Sets the color to use in absence of per-vertex colors.


getDefaultColor

public int getDefaultColor()
Retrieves the default color of this VertexBuffer.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.