source: GTP/trunk/App/Demos/Illum/pathmap/Occluder.hpp @ 2197

Revision 2197, 743 bytes checked in by szirmay, 18 years ago (diff)
Line 
1#pragma once
2
3#include "Vector.hpp"
4#include "Intersectable.hpp"
5
6class Occluder : public Intersectable
7{
8public:
9        Vector  centre;
10        float   solidRadius;
11        Intersectable*  owner;
12        Occluder(){}
13        Occluder(const Vector& centre, const float hardRadius);
14        ~Occluder(void);
15
16        float cosAngle;
17        Vector dirToCentre;
18        float distance;
19        bool intersect(const Ray& ray, float& depth, float rayMin, float rayMax)
20        {
21                lastTestedRayId = ray.id;
22                register bool boo = (distance < rayMax) && (ray.dir * dirToCentre < cosAngle);
23                lastTestedRayResult.isIntersect = boo;
24                lastTestedRayResult.depth = distance;
25                return boo;
26        }
27        bool intersectBackSide(const Ray& ray, float& depth, float rayMin, float rayMax) {return false;}
28        void setupBBox();
29};
Note: See TracBrowser for help on using the repository browser.