mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
fix for speed node
This commit is contained in:
parent
2a68e2a909
commit
75faed07cc
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ bool isInRectangle(const Vector3f &p, const Vector3f &a, const Vector3f &b,
|
|||
|
||||
Optional<float> Rectangle::intersect(const Ray &r) const {
|
||||
float denom = normal_.dot(r.direction());
|
||||
if (abs(denom) < 1e-6f)
|
||||
if (std::fabs(denom) < 1e-6f)
|
||||
return Optional<float>::nullopt;
|
||||
|
||||
float t = -normal_.dot(r.origin() - p1) / denom;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue