Jazz3D API


com.sygem.jazz3d3
Class Vertex

java.lang.Object
  |
  +--com.sygem.jazz3d3.Vertex

public class Vertex
extends java.lang.Object

The vertex class holds various useful bits of information about points in the Jazz3D universe.

The user should never need to create a Vertex object, but may be given them by methods from the Object3d class (like getCenter).

Version:
3.0a
Author:
SyGem Software
See Also:
Object3d.getCenter()

Constructor Summary
Vertex()
          Default constructor.
Vertex(double xa, double ya, double za)
          Create a vertex at position (x,y,z)
Vertex(float xa, float ya, float za)
          Create a vertex at position (x,y,z)
 
Method Summary
 Vertex getVertexNormal()
          Returns the normal vector for this vertex.
 double getX()
          Returns the X component of the vertex.
 double getY()
          Returns the Y component of the vertex.
 double getZ()
          Returns the Z component of the vertex.
 void set(double newx, double newy, double newz)
          Set the position of this vertex.
 void set(Vertex v)
          Set the position of this vertex to be the same as another.
 void setUV(double u, double v)
          Set the UV coordinates of a Vertex.
 void setVertexNormal(Vertex norm)
          Set the normal vector for this vertex.
 void setX(double newx)
          Set the X component of the vertex.
 void setY(double newy)
          Set the Y component of the vertex.
 void setZ(double newz)
          Set the Z component of the vertex.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vertex

public Vertex(float xa,
              float ya,
              float za)
Create a vertex at position (x,y,z)
Parameters:
x - The x coordinate of the vertex
y - The y coordinate of the vertex
z - The z coordinate of the vertex

Vertex

public Vertex(double xa,
              double ya,
              double za)
Create a vertex at position (x,y,z)
Parameters:
x - The x coordinate of the vertex
y - The y coordinate of the vertex
z - The z coordinate of the vertex

Vertex

public Vertex()
Default constructor. Constructs a Vertex at position (0,0,0)
Method Detail

getZ

public final double getZ()
Returns the Z component of the vertex.

getY

public final double getY()
Returns the Y component of the vertex.

getX

public final double getX()
Returns the X component of the vertex.

setZ

public final void setZ(double newz)
Set the Z component of the vertex.
Parameters:
newz - The new Z component

setY

public final void setY(double newy)
Set the Y component of the vertex.
Parameters:
newy - The new Y component

setX

public final void setX(double newx)
Set the X component of the vertex.
Parameters:
newx - The new X component

set

public final void set(Vertex v)
Set the position of this vertex to be the same as another. Performs a deep-copy.
Parameters:
v - A vertex to set the current values from.

set

public final void set(double newx,
                      double newy,
                      double newz)
Set the position of this vertex.
Parameters:
newx - The new X component
newy - The new Y component
newz - The new Z component

getVertexNormal

public final Vertex getVertexNormal()
Returns the normal vector for this vertex. The normal is actually returned as a Vertex.
See Also:
setVertexNormal(com.sygem.jazz3d3.Vertex)

setVertexNormal

public final void setVertexNormal(Vertex norm)
Set the normal vector for this vertex. The normal is actually represented by a Vertex.
Parameters:
norm - The new vertex normal
See Also:
getVertexNormal()

setUV

public final void setUV(double u,
                        double v)
Set the UV coordinates of a Vertex.

©2001 SyGem Software