01: /*
02: * $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/utils/vpbehaviors/RayCollision.java,v 1.1 2005/04/20 21:05:14 paulby Exp $
03: *
04: * Sun Public License Notice
05: *
06: * The contents of this file are subject to the Sun Public License Version
07: * 1.0 (the "License"). You may not use this file except in compliance with
08: * the License. A copy of the License is available at http://www.sun.com/
09: *
10: * The Original Code is Java 3D(tm) Fly Through.
11: * The Initial Developer of the Original Code is Paul Byrne.
12: * Portions created by Paul Byrne are Copyright (C) 2002.
13: * All Rights Reserved.
14: *
15: * Contributor(s): Paul Byrne.
16: *
17: **/
18: package org.jdesktop.j3dfly.utils.vpbehaviors;
19:
20: import javax.media.j3d.Shape3D;
21: import javax.media.j3d.Geometry;
22: import javax.vecmath.Point3d;
23: import javax.vecmath.Vector3f;
24:
25: /**
26: * Provides information on the collision of a ray with geometry
27: * in the scene. The amount of information set in an object of
28: * this class will depend on the mode set in VPDefaultCollision.
29: *
30: * @author Paul Byrne
31: * @version 1.5, 01/18/02
32: */
33: public class RayCollision extends java.lang.Object {
34:
35: public static int FRONT = 0;
36: public static int BACK = 1;
37: public static int LEFT = 2;
38: public static int RIGHT = 3;
39: public static int UP = 4;
40: public static int DOWN = 5;
41:
42: public int rayIndex;
43:
44: /**
45: * The ray direction flag
46: * FRONT, BACK, LEFT, RIGHT, UP, DOWN
47: */
48: public int rayDirection;
49:
50: /**
51: * The Shape with which we collided, this may be null depending
52: * on the mode settings of VPDefaultCollision
53: */
54: public Shape3D collisionShape = null;
55:
56: /**
57: * The Geometry with which we collided, this may be null depending
58: * on the mode settings of VPDefaultCollision
59: */
60: public Geometry collisionGeometryArray = null;
61:
62: /**
63: * The Collision Point in Virtual World coordinates
64: */
65: public Point3d collisionPoint = null;
66:
67: /**
68: * The Normal of this Ray at the Collision point
69: */
70: public Vector3f collisionNormal = null;
71:
72: }
|