j3d.org Code

org.j3d.terrain.roam
Class VertexData

java.lang.Object
  extended by org.j3d.terrain.roam.VertexData

public class VertexData
extends java.lang.Object

Collection of vertex information for a patch of terrain.

The data held is coordinate, texture coordinate and vertex colours. Setting up the class with the right flags helps to reduce the amount of data that is kept around.

Version:
$Revision: 1.5 $
Author:
Justin Couch, based on original ideas by Paul Byrne

Constructor Summary
VertexData(int patchSize, boolean hasTexture, boolean hasColor)
          Creates new VertexData that represents a fixed number of vertices.
 
Method Summary
 byte[] getColors()
          Return the complete set of color values held by this node.
 float[] getCoords()
          Return the complete set of coordinates held by this node.
 float[] getTextureCoords()
          Return the complete set of texture coordinates of this node
 int getVertexCount()
          Get the number of vertices registered here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VertexData

public VertexData(int patchSize,
                  boolean hasTexture,
                  boolean hasColor)
Creates new VertexData that represents a fixed number of vertices. The patchsize is the number of points along one edge and represents a square piece of landscape.

Parameters:
patchSize - The number of points on a side
hasTexture - true if we have to represent texture coordinates
hasColor - true if we have to represent color values
Method Detail

getCoords

public float[] getCoords()
Return the complete set of coordinates held by this node.

Returns:
The flat array of coordinates

getColors

public byte[] getColors()
Return the complete set of color values held by this node.

Returns:
The flat array of color components

getTextureCoords

public float[] getTextureCoords()
Return the complete set of texture coordinates of this node

Returns:
The flat array of texture coordinates

getVertexCount

public int getVertexCount()
Get the number of vertices registered here.

Returns:
The total number of registered vertices

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org