Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
BVHScene Class Referencefinal

Public Member Functions

 LM_COMPONENT_IMPL_DEF ("bvh")
 
virtual bool Build () override
 
virtual bool IntersectTriangles (Ray &ray, Intersection &isect) const override
 
virtual AABB GetAABBTriangles () const override
 
virtual boost::signals2::connection Connect_ReportBuildProgress (const std::function< void(double, bool)> &func) override
 
virtual bool Configure (const ConfigNode &node) override
 
- Public Member Functions inherited from Scene
 LM_COMPONENT_INTERFACE_DEF ("scene")
 
LM_PUBLIC_API void Load (Primitives *primitives)
 
LM_PUBLIC_API bool PostConfigure ()
 
LM_PUBLIC_API bool Intersect (Ray &ray, Intersection &isect) const
 
LM_PUBLIC_API const CameraMainCamera () const
 
LM_PUBLIC_API const LightSampleLightSelection (Math::Vec2 &lightSampleP, Math::PDFEval &selectionPdf) const
 
LM_PUBLIC_API const LightSampleLightSelection (const Math::Float &lightSample, Math::PDFEval &selectionPdf) const
 
LM_PUBLIC_API Math::PDFEval LightSelectionPdf () const
 
LM_PUBLIC_API AABB GetAABB () const
 
- Public Member Functions inherited from Component
virtual std::string ComponentInterfaceTypeName () const =0
 
virtual std::string ComponentImplTypeName () const =0
 
- Public Member Functions inherited from SIMDAlignedType
void * operator new (std::size_t size) throw (std::bad_alloc)
 
void operator delete (void *p)
 

Additional Inherited Members

- Protected Member Functions inherited from Scene
void StoreIntersectionFromBarycentricCoords (unsigned int primitiveIndex, unsigned int triangleIndex, const Ray &ray, const Math::Vec2 &b, Intersection &isect) const
 
- Protected Attributes inherited from Scene
std::unique_ptr< Primitivesprimitives
 

Detailed Description

BVH scene. Naive bounding volume hierarchy implementation. Based on pbrt's BVH implementation.

Inheritance diagram for BVHScene:
Scene Component SIMDAlignedType

Member Function Documentation

bool BVHScene::Build ( )
overridevirtual

Build acceleration structure. Some scene may have an acceleration structure for the optimization. The function must be called after Load. The function must be called before any intersection queries.

Return values
trueSucceeded to build.
falseFailed to build.

Implements Scene.

virtual bool BVHScene::Configure ( const ConfigNode node)
inlineoverridevirtual

Configure the scene.

Parameters
nodeXML node for the configuration.
Return values
trueSucceeded to configure the scene.
falseFailed to configure the scene.

Implements Scene.

virtual boost::signals2::connection BVHScene::Connect_ReportBuildProgress ( const std::function< void(double, bool)> &  func)
inlineoverridevirtual

Connect to ReportBuildProgress signal. The signal is emitted when the progress of asset loading is changed.

Parameters
funcSlot function.

Implements Scene.

virtual AABB BVHScene::GetAABBTriangles ( ) const
inlineoverridevirtual

Get AABB of triangles in the scene.

Returns
AABB of triangles in the scene.

Implements Scene.

bool BVHScene::IntersectTriangles ( Ray ray,
Intersection isect 
) const
overridevirtual

Intersection query with triangles. The function checks if #ray hits with the scene. This function is supposed to be accelerated by spatial acceleration structure. When intersected, information on the hit point is stored in the intersection data.

Parameters
rayRay.
isectIntersection data.
Return values
trueIntersected with the scene.
falseNot intersected with the scene.

Implements Scene.


The documentation for this class was generated from the following file: