#include <scene.h>
Scene class. A base class of the scene.
virtual bool Scene::Build |
( |
| ) |
|
|
pure virtual |
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
-
true | Succeeded to build. |
false | Failed to build. |
Implemented in BVHScene, StubScene, and NaiveScene.
virtual bool Scene::Configure |
( |
const ConfigNode & |
node | ) |
|
|
pure virtual |
Configure the scene.
- Parameters
-
node | XML node for the configuration. |
- Return values
-
true | Succeeded to configure the scene. |
false | Failed to configure the scene. |
Implemented in BVHScene, StubScene, and NaiveScene.
virtual boost::signals2::connection Scene::Connect_ReportBuildProgress |
( |
const std::function< void(double, bool)> & |
func | ) |
|
|
pure virtual |
Connect to ReportBuildProgress signal. The signal is emitted when the progress of asset loading is changed.
- Parameters
-
Implemented in BVHScene, and NaiveScene.
AABB Scene::GetAABB |
( |
| ) |
const |
Get AABB of the scene.
- Returns
- AABB of the scene.
virtual AABB Scene::GetAABBTriangles |
( |
| ) |
const |
|
pure virtual |
Intersection query. The function checks if #ray hits with the scene. When intersected, information on the hit point is stored in the intersection data.
- Parameters
-
- Return values
-
true | Intersected with the scene. |
false | Not intersected with the scene. |
virtual bool Scene::IntersectTriangles |
( |
Ray & |
ray, |
|
|
Intersection & |
isect |
|
) |
| const |
|
pure virtual |
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
-
- Return values
-
true | Intersected with the scene. |
false | Not intersected with the scene. |
Implemented in BVHScene, and NaiveScene.
Math::PDFEval Scene::LightSelectionPdf |
( |
| ) |
const |
PDF evaluation for light selection sampling.
- Returns
- Evaluated PDF.
Load primitives. Ownership of #primitives is delegated to this class.
- Parameters
-
const Camera * Scene::MainCamera |
( |
| ) |
const |
Get a main camera.
- Returns
- Main camera.
bool Scene::PostConfigure |
( |
| ) |
|
Post configuration of the scene. This function must be called after Build.
- Return values
-
true | Succeeded to configure the scene. |
false | Failed to configure the scene. |
const Light * Scene::SampleLightSelection |
( |
Math::Vec2 & |
lightSampleP, |
|
|
Math::PDFEval & |
selectionPdf |
|
) |
| const |
Choose a light included in the scene (reusable version). Note that only the x component of #lightSampleP is used and reusable in the following procedure, e.g. positional sampling on the light.
- Parameters
-
lightSampleP | Light sample. |
selectionPdf | PDF evaluation of the selection (discrete measure). |
- Returns
- Selected light.
const Light * Scene::SampleLightSelection |
( |
const Math::Float & |
lightSample, |
|
|
Math::PDFEval & |
selectionPdf |
|
) |
| const |
Choose a light included in the scene.
- Parameters
-
lightSample | Light sample. |
selectionPdf | PDF evaluation of the selection (discrete measure). |
- Returns
- Selected light.
void Scene::StoreIntersectionFromBarycentricCoords |
( |
unsigned int |
primitiveIndex, |
|
|
unsigned int |
triangleIndex, |
|
|
const Ray & |
ray, |
|
|
const Math::Vec2 & |
b, |
|
|
Intersection & |
isect |
|
) |
| const |
|
protected |
Store intersection data using barycentric coordinates. Reconstruct intersection information from some information. The function is used internally.
- Parameters
-
primitiveIndex | A index of the primitive. |
triangleIndex | A index of the triangle of the primitive specified by #primitiveIndex. |
ray | Intersected ray. |
b | Barycentric coordinates of the intersection point. |
isect | Intersection structure to store data. |
The documentation for this class was generated from the following files:
- /home/travis/build/hi2p-perim/lightmetrica/include/lightmetrica/scene.h
- /home/travis/build/hi2p-perim/lightmetrica/src/liblightmetrica/scene.cpp