8#include <Common/assertion.h>
19template<
typename GetterType>
22 { getter() } -> std::same_as<const PrimitiveMetadata*>;
25template<
typename GetterType>
28 { getter() } -> std::convertible_to<const Primitive*>;
51 template<
typename... DeducedArgs>
62template<CDerived<Primitive> PrimitiveType>
77template<CDerived<Primitive> PrimitiveType>
82 template<
typename... DeducedArgs>
95template<detail::CPrimitiveMetaGetter PrimitiveMetaGetter, detail::CPrimitiveGetter PrimitiveGetter>
101 , m_metaGetter(
std::move(metaGetter))
102 , m_primitiveGetter(
std::move(primitiveGetter))
143 HitDetail*
const out_detail)
const override
165 return m_primitiveGetter()->calcAABB();
170 return m_primitiveGetter()->isOccluding(ray);
175 return m_primitiveGetter()->mayOverlapVolume(volume);
183 m_primitiveGetter()->genPosSample(query, sampleFlow, probe);
191 m_primitiveGetter()->calcPosPdf(query);
196 return m_primitiveGetter()->calcExtendedArea();
203 return m_metaGetter();
211 return m_primitiveGetter();
215 PrimitiveMetaGetter m_metaGetter;
216 PrimitiveGetter m_primitiveGetter;
Detailed information regarding a ray-primitive intersection.
Definition HitDetail.h:26
uint64 getFaceID() const
Get the face ID associated to the hit.
Definition HitDetail.h:153
math::Vector3R getUVW() const
Definition HitDetail.h:168
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
Lightweight ray intersection testing and reporting object. If an intersection is found,...
Definition HitProbe.h:27
const Intersectable * getTopHit() const
Definition HitProbe.h:154
void popHit()
Removes the most recent hit target from the stack.
Definition HitProbe.h:127
void pushIntermediateHit(const Intersectable *hitTarget)
Adds a hit target that will participate in hit detail's calculation to the stack.
Definition HitProbe.h:112
virtual bool reintersect(const Ray &ray, HitProbe &probe, const Ray &srcRay, HitProbe &srcProbe) const =0
Intersect the intersected object again with a different ray.
virtual void calcHitDetail(const Ray &ray, HitProbe &probe, HitDetail *out_detail) const =0
Calculates properties of a hit, such as coordinates and normal.
A physical shape in the scene.
Definition Primitive.h:23
Information for the probability of generating a specific sample point on a primitive.
Definition PrimitivePosPdfQuery.h:91
Information for generating a sample point on a primitive.
Definition PrimitivePosSampleQuery.h:132
Represents a ray in space.
Definition Ray.h:21
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
Definition TMetaInjectionPrimitive.h:26
The root for all renderer implementations.
Definition EEngineProject.h:6
Definition TMetaInjectionPrimitive.h:79
const PrimitiveType * operator()() const
Definition TMetaInjectionPrimitive.h:87
TEmbeddedPrimitiveGetter(DeducedArgs &&... args)
Definition TMetaInjectionPrimitive.h:83
PrimitiveType primitive
Definition TMetaInjectionPrimitive.h:80
Definition TMetaInjectionPrimitive.h:64
TReferencedPrimitiveGetter(const PrimitiveType *const primitive)
Definition TMetaInjectionPrimitive.h:67
const PrimitiveType * operator()() const
Definition TMetaInjectionPrimitive.h:71
const PrimitiveType * primitive
Definition TMetaInjectionPrimitive.h:65