source: trunk/VUT/GtpVisibilityPreprocessor/src/Intersectable.h @ 340

Revision 340, 1.1 KB checked in by bittner, 19 years ago (diff)

mesh cleanup added

Line 
1#ifndef __INTERSECTABLE_H
2#define __INTERSECTABLE_H
3
4#include "AxisAlignedBox3.h"
5#include "Pvs.h"
6
7
8class Intersectable {
9public:
10        // last mail id -> warning not thread safe!
11        // both mailId and mailbox should be unique for each thread!!!
12        static int sMailId;
13        int mMailbox;
14       
15        // unique object Id
16        int mId;
17
18        // object based pvs
19        KdPvs mKdPvs;
20 
21  enum { MESH_INSTANCE, TRANSFORMED_MESH_INSTANCE, SPHERE, VIEW_CELL };
22 
23  Intersectable():mMailbox(0) {}
24
25        void SetId(const int id) { mId = id; }
26        int GetId() { return mId; }
27       
28        void Mail() { mMailbox = sMailId; }
29  static void NewMail() { sMailId++; }
30  bool Mailed() const { return mMailbox == sMailId; }
31  int IncMail() { return ++mMailbox - sMailId; }
32
33  virtual AxisAlignedBox3 GetBox() = 0;
34 
35  virtual int CastRay(Ray &ray) = 0;
36 
37  virtual bool IsConvex() = 0;
38  virtual bool IsWatertight() = 0;
39  virtual float IntersectionComplexity() = 0;
40 
41  virtual int Type() const = 0;
42
43  virtual void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) = 0;
44
45        virtual ostream &Describe(ostream &s) = 0;
46       
47};
48
49
50#endif
Note: See TracBrowser for help on using the repository browser.