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

#include <PLatLong01Sphere.h>

Inheritance diagram for ph::PLatLong01Sphere:
ph::PBasicSphere ph::Primitive ph::Intersectable

Public Member Functions

 PLatLong01Sphere (real radius)
 
void calcHitDetail (const Ray &ray, HitProbe &probe, HitDetail *out_detail) const override
 Calculates properties of a hit, such as coordinates and normal.
 
void genPosSample (PrimitivePosSampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override
 Generates a sample point on the surface of this primitive.
 
void calcPosPdf (PrimitivePosPdfQuery &query) const override
 Given a point on the surface of this primitive, calculates the PDF of sampling this point.
 
math::Vector2R posToUV (const math::Vector3R &position) const
 Maps a position on the sphere surface to UV coordinates (lat-long-01 format).
 
- Public Member Functions inherited from ph::PBasicSphere
 PBasicSphere (real radius)
 
bool isIntersecting (const Ray &ray, HitProbe &probe) const override
 Determine whether a given ray hits the object.
 
bool reintersect (const Ray &ray, HitProbe &probe, const Ray &srcRay, HitProbe &srcProbe) const override
 Intersect the intersected object again with a different ray.
 
bool mayOverlapVolume (const math::AABB3D &volume) const override
 Conservatively checks whether this object overlaps a volume.
 
math::AABB3D calcAABB () const override
 Calculates Axis-Aligned Bounding Box (AABB) of itself.
 
real calcExtendedArea () const override
 Calculates the area extended by this primitive. The term "extended" implies single-sided, e.g., a triangle's extended area is half the absolute value of the cross product of its two edge vectors. To treat it as double-sided, you need to multiply the result by 2 manually.
 
real getRadius () const
 
real getRcpRadius () const
 
- Public Member Functions inherited from ph::Primitive
virtual const PrimitiveMetadatagetMetadata () const
 
- Public Member Functions inherited from ph::Intersectable
virtual ~Intersectable ()=default
 
virtual bool isOccluding (const Ray &ray) const
 Determines whether this object blocks the ray.
 

Additional Inherited Members

- Protected Member Functions inherited from ph::PBasicSphere
auto getRefinedSurfaceAndNormal (const math::Vector3R &srcSurface) const -> std::pair< math::Vector3R, math::Vector3R >
 

Constructor & Destructor Documentation

◆ PLatLong01Sphere()

ph::PLatLong01Sphere::PLatLong01Sphere ( real radius)
explicit

Member Function Documentation

◆ calcHitDetail()

void ph::PLatLong01Sphere::calcHitDetail ( const Ray & ray,
HitProbe & probe,
HitDetail * out_detail ) const
overridevirtual

Calculates properties of a hit, such as coordinates and normal.

This method calculates a detailed description of a hit from the ray and probe involved in a hit event. For example, the ray and probe used for calling isIntersecting() can be the inputs of this method (if an intersection is found). The process of calculating intersection detail will destroy the input probe.

Parameters
rayThe ray from a hit event.
probeThe probe from a hit event. The process of detail calculation will destroy the probe.
out_detailStores the calculated details. This method calculates the essential details only. Some information such as coordinate bases will only be available if specifically requested afterwards (for an example, see HitDetail::computeBases()).
Note
See Primitive for more methods that can generate a hit event.
Warning
This method will destroy the probe.

Implements ph::PBasicSphere.

◆ calcPosPdf()

void ph::PLatLong01Sphere::calcPosPdf ( PrimitivePosPdfQuery & query) const
overridevirtual

Given a point on the surface of this primitive, calculates the PDF of sampling this point.

Reimplemented from ph::Primitive.

◆ genPosSample()

void ph::PLatLong01Sphere::genPosSample ( PrimitivePosSampleQuery & query,
SampleFlow & sampleFlow,
HitProbe & probe ) const
overridevirtual

Generates a sample point on the surface of this primitive.

Note
Generates hit event (with PrimitivePosSampleOutput::getObservationRay() and probe).

Reimplemented from ph::Primitive.

◆ posToUV()

math::Vector2R ph::PLatLong01Sphere::posToUV ( const math::Vector3R & position) const

Maps a position on the sphere surface to UV coordinates (lat-long-01 format).


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