Ocean
Loading...
Searching...
No Matches
TracingBox.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_RENDERING_GI_TRACING_BOX_H
9#define META_OCEAN_RENDERING_GI_TRACING_BOX_H
10
14
17
19
20namespace Ocean
21{
22
23namespace Rendering
24{
25
26namespace GlobalIllumination
27{
28
29/**
30 * This class implements the tracing object for a box.
31 * @ingroup renderinggi
32 */
33class OCEAN_RENDERING_GI_EXPORT TracingBox : public TracingObject
34{
35 public:
36
37 /**
38 * Creates a new tracing object.
39 */
41
42 /**
43 * Destructs this tracing object.
44 */
45 ~TracingBox() override;
46
47 /**
48 * Sets the main characteristics of the box by providing the object-world transformation and the box's dimension.
49 * @param objectTransformation The transformation transforming points located in the coordinate system of the box to points located in the world coordinate system, must be valid
50 * @param localBoundingBox The bounding box object defining the dimension of the box, must be valid
51 */
52 void setBox(const HomogenousMatrix4& objectTransformation, const BoundingBox& localBoundingBox);
53
54 /**
55 * Determines the nearest intersection with between this tracing object and a given 3D ray.
56 * @see TracingObject::findNearestIntersection().
57 */
58 void findNearestIntersection(const Line3& ray, RayIntersection& intersection, const bool frontFace, const Scalar eps, const TracingObject* excludedObject = nullptr) const override;
59
60 /**
61 * Determines whether this tracing object has an intersection with a provided 3D ray.
62 * @see TracingObject::hasIntersection().
63 */
64 bool hasIntersection(const Line3& ray, const Scalar maximalDistance = Numeric::maxValue(), const TracingObject* excludedObject = nullptr) const override;
65
66 /**
67 * Determines the amount of light that transmits trough this object in the case e.g., this object is transparent.
68 * @see TracingObject::determineDampingColor().
69 */
70 bool determineDampingColor(const Line3& ray, RGBAColor& color, const Scalar maximalDistance = Numeric::maxValue()) const override;
71
72 /**
73 * Determines the light (the color) for a specified viewing ray this object does reflect.
74 * @see TracingObject::determineColor().
75 */
76 bool determineColor(const Vector3& viewPosition, const Vector3& viewObjectDirection, const RayIntersection& intersection, const TracingGroup& group, const unsigned int bounces, const TracingObject* excludedObject, const Lighting::LightingModes lightingModes, RGBAColor& color) const override;
77
78 private:
79
80 /// The bounding box of this tracing object.
82
83 /// The bounding sphere of this tracing object.
85};
86
87}
88
89}
90
91}
92
93#endif // META_OCEAN_RENDERING_GI_TRACING_BOX_H
This class implements a 3D bounding box.
Definition BoundingBox.h:23
This class implements a bounding sphere.
Definition BoundingSphere.h:23
This class implements an infinite line in 3D space.
Definition Line3.h:68
This class implements a color defined by red, green, blue and alpha parameters.
Definition RGBAColor.h:41
LightingModes
Definition of individual lighting modes.
Definition Lighting.h:47
This class implements a ray intersection object.
Definition RayIntersection.h:44
This class implements the tracing object for a box.
Definition TracingBox.h:34
void setBox(const HomogenousMatrix4 &objectTransformation, const BoundingBox &localBoundingBox)
Sets the main characteristics of the box by providing the object-world transformation and the box's d...
bool determineColor(const Vector3 &viewPosition, const Vector3 &viewObjectDirection, const RayIntersection &intersection, const TracingGroup &group, const unsigned int bounces, const TracingObject *excludedObject, const Lighting::LightingModes lightingModes, RGBAColor &color) const override
Determines the light (the color) for a specified viewing ray this object does reflect.
BoundingBox tracingLocalBoundingBox
The bounding box of this tracing object.
Definition TracingBox.h:81
BoundingSphere tracingLocalBoundingSphere
The bounding sphere of this tracing object.
Definition TracingBox.h:84
~TracingBox() override
Destructs this tracing object.
TracingBox()
Creates a new tracing object.
void findNearestIntersection(const Line3 &ray, RayIntersection &intersection, const bool frontFace, const Scalar eps, const TracingObject *excludedObject=nullptr) const override
Determines the nearest intersection with between this tracing object and a given 3D ray.
bool determineDampingColor(const Line3 &ray, RGBAColor &color, const Scalar maximalDistance=Numeric::maxValue()) const override
Determines the amount of light that transmits trough this object in the case e.g.,...
bool hasIntersection(const Line3 &ray, const Scalar maximalDistance=Numeric::maxValue(), const TracingObject *excludedObject=nullptr) const override
Determines whether this tracing object has an intersection with a provided 3D ray.
This class implements a group of tracing objects.
Definition TracingGroup.h:28
This class is the abstract base class for all tracing objects.
Definition TracingObject.h:39
float Scalar
Definition of a scalar type.
Definition Math.h:129
The namespace covering the entire Ocean framework.
Definition Accessor.h:15