pslib
Class PSVertex

java.lang.Object
  extended by pslib.PSVertex
All Implemented Interfaces:
java.lang.Comparable

public class PSVertex
extends java.lang.Object
implements java.lang.Comparable

PSVertex Class

The PSVertex object allows a position vector, normal vector and colour to be stored alongside an index value. The class implements the Comparable interface to allow sorting based in index value.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.


Field Summary
 PSColour colour
           
 PSVector position
           
 PSVector uvcoord
           
 
Constructor Summary
PSVertex(int i, PSVector p, PSColour c)
          Create a new object instance with the specified values
PSVertex(int i, PSVector p, PSVector uv, PSColour c)
          Create a new object instance with the specified values
 
Method Summary
 int compareTo(java.lang.Object obj)
          Implementation of the Comparable interface
 int index()
          Return the index value of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

public final PSVector position

uvcoord

public final PSVector uvcoord

colour

public final PSColour colour
Constructor Detail

PSVertex

public PSVertex(int i,
                PSVector p,
                PSColour c)
Create a new object instance with the specified values

Parameters:
i - index
p - position
c - colour

PSVertex

public PSVertex(int i,
                PSVector p,
                PSVector uv,
                PSColour c)
Create a new object instance with the specified values

Parameters:
i - index
p - position
uv - uv coordinates
c - colour
Method Detail

index

public final int index()
Return the index value of this object

Returns:
the index value of this object

compareTo

public final int compareTo(java.lang.Object obj)
Implementation of the Comparable interface

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - object
Returns:
sort data based on index value