6#include <Common/primitive_type.h>
21 HitDetail* out_detail)
const override = 0;
46 -> std::pair<math::Vector3R, math::Vector3R>;
66-> std::pair<math::Vector3R, math::Vector3R>
68 const auto refinedNormal = srcSurface.safeNormalize({0, 1, 0});
69 const auto refinedSurface = refinedNormal * getRadius();
70 return {refinedSurface, refinedNormal};
Detailed information regarding a ray-primitive intersection.
Definition HitDetail.h:26
Lightweight ray intersection testing and reporting object. If an intersection is found,...
Definition HitProbe.h:27
Definition PBasicSphere.h:14
void calcHitDetail(const Ray &ray, HitProbe &probe, HitDetail *out_detail) const override=0
Calculates properties of a hit, such as coordinates and normal.
math::AABB3D calcAABB() const override
Calculates Axis-Aligned Bounding Box (AABB) of itself.
Definition PBasicSphere.cpp:47
bool reintersect(const Ray &ray, HitProbe &probe, const Ray &srcRay, HitProbe &srcProbe) const override
Intersect the intersected object again with a different ray.
Definition PBasicSphere.cpp:31
auto getRefinedSurfaceAndNormal(const math::Vector3R &srcSurface) const -> std::pair< math::Vector3R, math::Vector3R >
Definition PBasicSphere.h:65
real getRcpRadius() const
Definition PBasicSphere.h:60
real calcExtendedArea() const override
Calculates the area extended by this primitive. The term "extended" implies single-sided,...
Definition PBasicSphere.cpp:52
PBasicSphere(real radius)
Definition PBasicSphere.cpp:11
bool mayOverlapVolume(const math::AABB3D &volume) const override
Conservatively checks whether this object overlaps a volume.
Definition PBasicSphere.cpp:42
bool isIntersecting(const Ray &ray, HitProbe &probe) const override
Determine whether a given ray hits the object.
Definition PBasicSphere.cpp:19
real getRadius() const
Definition PBasicSphere.h:55
A physical shape in the scene.
Definition Primitive.h:23
Represents a ray in space.
Definition Ray.h:21
The root for all renderer implementations.
Definition EEngineProject.h:6