19 #if !defined(__NORI_SCENE_H)
20 #define __NORI_SCENE_H
23 #include <nori/emitter.h>
61 const std::vector<Shape *> &
getShapes()
const {
return m_shapes; }
64 const std::vector<Emitter *> &
getLights()
const {
return m_emitters; }
68 auto const & n = m_emitters.size();
69 size_t index = std::min(
70 static_cast<size_t>(std::floor(n*rnd)),
72 return m_emitters[index];
117 return m_bvh->getBoundingBox();
132 virtual std::string
toString()
const override;
136 std::vector<Shape *> m_shapes;
139 Camera *m_camera =
nullptr;
140 BVH *m_bvh =
nullptr;
142 std::vector<Emitter *> m_emitters;
Bounding Volume Hierarchy for fast ray intersection queries.
bool rayIntersect(const Ray3f &ray, Intersection &its, bool shadowRay=false) const
Intersect a ray against all shapes registered with the BVH.
Generic camera interface.
Superclass of all emitters.
Abstract integrator (i.e. a rendering technique)
Base class of all objects.
This is an associative container used to supply the constructors of NoriObject subclasses with parame...
Abstract sample generator.
Main scene data structure.
const BVH * getBVH() const
Return a pointer to the scene's kd-tree.
virtual void activate() override
Inherited from NoriObject::activate()
virtual ~Scene()
Release all memory.
const Emitter * getRandomEmitter(float rnd) const
Return a random emitter.
const Camera * getCamera() const
Return a pointer to the scene's camera.
virtual EClassType getClassType() const override
Return the type of object (i.e. Mesh/BSDF/etc.) provided by this instance.
Integrator * getIntegrator()
Return a pointer to the scene's integrator.
const BoundingBox3f & getBoundingBox() const
Return an axis-aligned box that bounds the scene.
bool rayIntersect(const Ray3f &ray) const
Intersect a ray against all triangles stored in the scene and only determine whether or not there is ...
bool rayIntersect(const Ray3f &ray, Intersection &its) const
Intersect a ray against all triangles stored in the scene and return detailed intersection informatio...
virtual std::string toString() const override
Return a string summary of the scene (for debugging purposes)
Scene(const PropertyList &)
Construct a new scene object.
Sampler * getSampler()
Return a pointer to the scene's sample generator.
virtual void addChild(NoriObject *obj) override
Add a child object to the scene (meshes, integrators etc.)
const std::vector< Shape * > & getShapes() const
Return a reference to an array containing all shapes.
const Integrator * getIntegrator() const
Return a pointer to the scene's integrator.
const std::vector< Emitter * > & getLights() const
Return a reference to an array containing all lights.
const Sampler * getSampler() const
Return a pointer to the scene's sample generator (const version)
Intersection data structure.