/** Intersection of ray with object in scene * (should not compute point and normal here, slow, fix later) * @author: Phil Gage */ class Intersection { /** Intersection count for statistics, every object's intersect method must increment this */ // static long intersectionCount = 0; //temp, should be per camera? Intersection () { this.point = new Point (); this.normal = new Vector3 (); this.incident = new Vector3 (); } /** Object intersected */ public AbstractObject obj; /** Intersection point on object */ public Point point; //? /** Surface normal at intersection point */ Vector3 normal; //? /** Incident ray direction at intersection point */ Vector3 incident; // (could add ray and distance...?) // (could add distances for CSG...?) // double far; /** Copy fields from another Intersection object */ void set (Intersection from) { obj = from.obj; point.set(from.point); normal.set(from.normal); incident.set(from.incident); } }