home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-01-14 | 1.1 KB | 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);
- }
-
- }
-
-