home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-02-21 | 675 b | 34 lines |
- // A simple 3D vector class
-
- // Written by Bernie Roehl, December 1996
-
- package multi;
-
- import java.io.*;
-
- public class Vec3 {
- protected float x = 0, y = 0, z = 0;
-
- public Vec3() { }
-
- public Vec3(float xval, float yval, float zval) {
- x = xval;
- y = yval;
- z = zval;
- }
-
- public float getX() { return x; }
- public float getY() { return y; }
- public float getZ() { return z; }
-
- public void read(DataInputStream in) throws IOException {
- x = in.readFloat();
- y = in.readFloat();
- z = in.readFloat();
- }
-
- public String toString() { return x + " " + y + " " + z; }
-
- }
-
-