11#include <Common/assertion.h>
12#include <Common/primitive_type.h>
18namespace ph {
class Primitive; }
28 inline static constexpr auto NO_FACE_ID =
static_cast<uint64
>(-1);
97 int8 m_meanDistanceErrorFactorExp2;
98 int8 m_maxDistanceErrorFactorExp2;
188 static_cast<real
>(std::exp2(m_meanDistanceErrorFactorExp2)),
189 static_cast<real
>(std::exp2(m_maxDistanceErrorFactorExp2))};
195 PH_ASSERT_GE(meanFactor, 0.0_r);
196 PH_ASSERT_GE(maxFactor, 0.0_r);
198 m_meanDistanceErrorFactorExp2 =
static_cast<int8
>(std::round(std::log2(meanFactor)));
199 m_maxDistanceErrorFactorExp2 =
static_cast<int8
>(std::ceil(std::log2(maxFactor)));
Detailed information regarding a ray-primitive intersection.
Definition HitDetail.h:26
math::Vector3R getdPdV(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:123
math::Vector3R getdPdU(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:118
math::Vector3R getShadingNormal(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:108
math::Vector3R getdNdU(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:128
uint64 getFaceID() const
Get the face ID associated to the hit.
Definition HitDetail.h:153
const Primitive * getPrimitive() const
Definition HitDetail.h:163
math::Vector3R getUVW() const
Definition HitDetail.h:168
const math::Basis3R & getShadingBasis(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:143
void setDistanceErrorFactors(real meanFactor, real maxFactor)
Definition HitDetail.h:192
HitDetail()
Creates a hit detail filled with default values.
Definition HitDetail.cpp:12
std::pair< real, real > getDistanceErrorFactors() const
Definition HitDetail.h:185
void computeBases()
Definition HitDetail.cpp:39
static constexpr auto NO_FACE_ID
Definition HitDetail.h:28
real getRayT() const
Get the parametric distance from the incident ray's origin. Notice that parametric distance is not or...
Definition HitDetail.h:148
FaceTopology getFaceTopology() const
Definition HitDetail.h:158
HitDetail & setHitIntrinsics(const Primitive *primitive, const math::Vector3R &uvw, real rayT, uint64 faceID=NO_FACE_ID, FaceTopology faceTopology=FaceTopology(EFaceTopology::General))
Set essential attributes that are independent to the coordinate system.
Definition HitDetail.cpp:23
math::Vector3R getPos(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:103
math::Vector3R getdNdV(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:133
math::Vector3R getGeometryNormal(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:113
const HitInfo & getHitInfo(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:173
const math::Basis3R & getGeometryBasis(ECoordSys coordSys=ECoordSys::World) const
Definition HitDetail.h:138
General information for a ray-primitive intersection.
Definition HitInfo.h:18
math::Vector3R getShadingNormal() const
Definition HitInfo.h:68
math::Vector3R getdNdU() const
Definition HitInfo.h:88
const math::Basis3R & getShadingBasis() const
Definition HitInfo.h:104
math::Vector3R getPos() const
Definition HitInfo.h:63
const math::Basis3R & getGeometryBasis() const
Definition HitInfo.h:98
math::Vector3R getGeometryNormal() const
Definition HitInfo.h:73
math::Vector3R getdPdU() const
Definition HitInfo.h:78
math::Vector3R getdNdV() const
Definition HitInfo.h:93
math::Vector3R getdPdV() const
Definition HitInfo.h:83
A physical shape in the scene.
Definition Primitive.h:23
Manipulate a value type where each bit is a binary flag.
Definition TBitFlags.h:17
Miscellaneous math utilities.
The root for all renderer implementations.
Definition EEngineProject.h:6
constexpr auto enum_size()
Definition utility.h:179
TEnumFlags< EFaceTopology > FaceTopology
Definition FaceTopology.h:36
ECoordSys
Definition ECoordSys.h:7
constexpr auto enum_to_value(const EnumType enumValue)
Definition utility.h:166