00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined(_MSC_VER)
00025 #pragma once
00026 #endif
00027
00028 #ifndef PBRT_CORE_SCENE_H
00029 #define PBRT_CORE_SCENE_H
00030
00031
00032 #include "pbrt.h"
00033 #include "primitive.h"
00034 #include "integrator.h"
00035
00036
00037 class Scene {
00038 public:
00039
00040 Scene(Primitive *accel, const vector<Light *> <s, VolumeRegion *vr);
00041 ~Scene();
00042 bool Intersect(const Ray &ray, Intersection *isect) const {
00043 PBRT_STARTED_RAY_INTERSECTION(const_cast<Ray *>(&ray));
00044 bool hit = aggregate->Intersect(ray, isect);
00045 PBRT_FINISHED_RAY_INTERSECTION(const_cast<Ray *>(&ray), isect, int(hit));
00046 return hit;
00047 }
00048 bool IntersectP(const Ray &ray) const {
00049 PBRT_STARTED_RAY_INTERSECTIONP(const_cast<Ray *>(&ray));
00050 bool hit = aggregate->IntersectP(ray);
00051 PBRT_FINISHED_RAY_INTERSECTIONP(const_cast<Ray *>(&ray), int(hit));
00052 return hit;
00053 }
00054 const BBox &WorldBound() const;
00055
00056
00057 Primitive *aggregate;
00058 vector<Light *> lights;
00059 VolumeRegion *volumeRegion;
00060 BBox bound;
00061 };
00062
00063
00064
00065 #endif // PBRT_CORE_SCENE_H