home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch13
/
quake
/
Triangle.java
< prev
next >
Wrap
Text File
|
1996-11-17
|
846b
|
31 lines
// Triangle class for processing MDL files
// Written by Bernie Roehl, November 1996
package quake;
import java.io.*;
public class Triangle {
protected boolean facesfront;
protected int[] points = new int[3]; // indices into vertex array
public boolean isFrontFacing() { return facesfront; }
public String toString() {
return points[0] + " " + points[1] + " " + points[2];
}
public int getPoint(int n) { return points[n]; }
public Triangle(ByteFlipInputStream input) throws IOException {
facesfront = (input.readFlippedInt() == 0) ? false : true;
points[0] = input.readFlippedInt();
points[1] = input.readFlippedInt();
points[2] = input.readFlippedInt();
}
}