00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef PLANE_H
00022
#define PLANE_H
00023
00024
#include "object3d.h"
00025
#include "intersection.h"
00026
00031 class Plane:
public Object3D {
00032
00033
public:
00037 Plane(
const Vector3& n): normal(n) {};
00038 ~
Plane() {}
00039
00040
public:
00041
00042
00043 Object3D*
duplicate()
const {
return new Plane(*
this);}
00044
Intersection* intersectLocal(
const Ray& r)
const;
00045
Intersection* intersectLocalLimitedTime(
const Ray &r, DBL maxtime)
const;
00046
bool isInsideAt(
const Vector3 &locallocation)
const;
00047
00048
private:
00049
00052
static HitStatistics stat;
00053
00054
private:
00055
#ifdef WRONG_INNER_CLASSES_ACCESS
00056
public:
00057
#endif
00058
Vector3 normal;
00059
00060
private:
00061
00064
class PlaneIntersection:
public Intersection {
00065
private:
00066 DBL time;
00067
00068
public:
00069 PlaneIntersection(
const Plane* o,
const Ray& r, DBL hittime):
00070
Intersection(o,r), time(hittime) {}
00071 ~PlaneIntersection() {}
00072
00073
public:
00074 DBL currentTime() {
return time;}
00075
void next() {time = INTERSECTION_INFINIT_TIME;}
00076
Vector3 normal();
00077 };
00078
00079 };
00080
00081
#endif