home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch13
/
quake
/
Frame.java
< prev
next >
Wrap
Text File
|
1997-01-14
|
1KB
|
36 lines
// Simple frame from an MDL file
// Written by Bernie Roehl, November 1996
package quake;
import java.io.*;
public class Frame {
protected Trivertex min, max;
protected String name;
protected Trivertex vertices[];
public Trivertex getMin() { return min; }
public Trivertex getMax() { return max; }
public String getName() { return name; }
public Trivertex getVertex(int n) { return vertices[n]; }
public Frame(ByteFlipInputStream input, int nverts)
throws IOException {
byte[] buffer = new byte[16];
min = new Trivertex(input);
max = new Trivertex(input);
input.read(buffer);
name = new String(buffer, 0);
int zerobyte = name.indexOf(0);
if (zerobyte >= 0)
name = name.substring(0, zerobyte);
vertices = new Trivertex[nverts];
for (int i = 0; i < nverts; ++i)
vertices[i] = new Trivertex(input);
}
}