Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::HitDetail Class Referencefinal

Detailed information regarding a ray-primitive intersection. More...

#include <HitDetail.h>

Public Member Functions

 HitDetail ()
 Creates a hit detail filled with default values.
 
HitDetailsetHitIntrinsics (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.
 
void computeBases ()
 
math::Vector3R getPos (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getShadingNormal (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getGeometryNormal (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getdPdU (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getdPdV (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getdNdU (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getdNdV (ECoordSys coordSys=ECoordSys::World) const
 
math::Vector3R getUVW () const
 
const math::Basis3RgetGeometryBasis (ECoordSys coordSys=ECoordSys::World) const
 
const math::Basis3RgetShadingBasis (ECoordSys coordSys=ECoordSys::World) const
 
real getRayT () const
 Get the parametric distance from the incident ray's origin. Notice that parametric distance is not ordinary distance but defined in terms of a ray direction vector's length.
 
uint64 getFaceID () const
 Get the face ID associated to the hit.
 
FaceTopology getFaceTopology () const
 
const PrimitivegetPrimitive () const
 
const HitInfogetHitInfo (ECoordSys coordSys=ECoordSys::World) const
 
HitInfogetHitInfo (ECoordSys coordSys=ECoordSys::World)
 
std::pair< real, real > getDistanceErrorFactors () const
 
void setDistanceErrorFactors (real meanFactor, real maxFactor)
 

Static Public Attributes

static constexpr auto NO_FACE_ID = static_cast<uint64>(-1)
 

Detailed Description

Detailed information regarding a ray-primitive intersection.

Constructor & Destructor Documentation

◆ HitDetail()

ph::HitDetail::HitDetail ( )

Creates a hit detail filled with default values.

Member Function Documentation

◆ computeBases()

void ph::HitDetail::computeBases ( )

◆ getDistanceErrorFactors()

std::pair< real, real > ph::HitDetail::getDistanceErrorFactors ( ) const
inline

◆ getdNdU()

math::Vector3R ph::HitDetail::getdNdU ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getdNdV()

math::Vector3R ph::HitDetail::getdNdV ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getdPdU()

math::Vector3R ph::HitDetail::getdPdU ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getdPdV()

math::Vector3R ph::HitDetail::getdPdV ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getFaceID()

uint64 ph::HitDetail::getFaceID ( ) const
inline

Get the face ID associated to the hit.

Returns
The ID for the face that was hit. The ID is not globally unique–it is unique only for the primitive that was hit. For instanced triangle meshes, each mesh typically has the same set of face IDs. May be NO_FACE_ID if not available.

◆ getFaceTopology()

FaceTopology ph::HitDetail::getFaceTopology ( ) const
inline
Returns
Surface topology locally around the hit point.

◆ getGeometryBasis()

const math::Basis3R & ph::HitDetail::getGeometryBasis ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getGeometryNormal()

math::Vector3R ph::HitDetail::getGeometryNormal ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getHitInfo() [1/2]

HitInfo & ph::HitDetail::getHitInfo ( ECoordSys coordSys = ECoordSys::World)
inline

◆ getHitInfo() [2/2]

const HitInfo & ph::HitDetail::getHitInfo ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getPos()

math::Vector3R ph::HitDetail::getPos ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getPrimitive()

const Primitive * ph::HitDetail::getPrimitive ( ) const
inline
Returns
The primitive that was hit.

◆ getRayT()

real ph::HitDetail::getRayT ( ) const
inline

Get the parametric distance from the incident ray's origin. Notice that parametric distance is not ordinary distance but defined in terms of a ray direction vector's length.

◆ getShadingBasis()

const math::Basis3R & ph::HitDetail::getShadingBasis ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getShadingNormal()

math::Vector3R ph::HitDetail::getShadingNormal ( ECoordSys coordSys = ECoordSys::World) const
inline

◆ getUVW()

math::Vector3R ph::HitDetail::getUVW ( ) const
inline

◆ setDistanceErrorFactors()

void ph::HitDetail::setDistanceErrorFactors ( real meanFactor,
real maxFactor )
inline

◆ setHitIntrinsics()

HitDetail & ph::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.

Parameters
primitiveThe primitive that was hit.
uvwThe parametric coordinates of the hit.
rayTThe parametric distance of the hit relative to the ray. The unit of this value depends on the length of the ray's direction vector.
faceIDID of the face that was hit. This ID may not be globally unique, see getFaceID().
faceTopologySurface topology locally around the hit point.

Member Data Documentation

◆ NO_FACE_ID

auto ph::HitDetail::NO_FACE_ID = static_cast<uint64>(-1)
inlinestaticconstexpr

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