source: trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h @ 331

Revision 331, 1.2 KB checked in by mattausch, 19 years ago (diff)

fixed box error at from ray construction of bsp view cells

RevLine 
[162]1#ifndef _SamplingPreprocessor_H__
2#define _SamplingPreprocessor_H__
3
[245]4#include <fstream>
5using namespace std;
6
[162]7#include "Preprocessor.h"
8
[245]9struct SimpleRay {
10  Vector3 mOrigin;
11  Vector3 mDirection;
12};
[162]13
14/** Sampling based visibility preprocessing. The implementation is based on heuristical
15    sampling of view space */
16class SamplingPreprocessor : public Preprocessor {
17public:
[256]18        int mPass;
19
[176]20  int mSamplesPerPass;
21  int mTotalSamples;
22  int mKdPvsDepth;
[245]23  ofstream mStats;
24  ObjectContainer mObjects;
[331]25  RayContainer mSampleRays;
[329]26  int mBspConstructionSamples;
[245]27
[176]28  SamplingPreprocessor();
29
[329]30  ~SamplingPreprocessor();
31
[162]32  virtual bool ComputeVisibility();
[176]33
34  void
35  SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction);
36
37  KdNode *
38  GetNodeForPvs(KdLeaf *leaf);
39
40  int
[256]41  AddNodeSamples(Intersectable *object, const Ray &ray);
[176]42
[191]43  void
44  HoleSamplingPass();
45
[256]46        int
47        CastRay(Intersectable *object, Ray &ray);
48
49        void
50        CastEdgeSamples(
51                                                                        Intersectable *object,
52                                                                        const Vector3 &point,
53                                                                        Mesh &mesh,
54                                                                        const int samples
55                                                                        );
56
[308]57        /** Adds objects samples to view cells.
58        */
59        int AddObjectSamples(Intersectable *obj, const Ray &ray);
[329]60
61        bool BuildBspTree();
[162]62};
63
64
65
66#endif
Note: See TracBrowser for help on using the repository browser.