Use ToObjectSpace and FromObjectSpace for ray components
This commit is contained in:
parent
07e75c663d
commit
301f5ff9aa
1 changed files with 4 additions and 2 deletions
|
@ -77,7 +77,8 @@ Object::Intersect(const basics::Ray& ray,
|
||||||
Stats& stats)
|
Stats& stats)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
return DoIntersect(ToObjectSpace(ray), t, stats);
|
Ray objSpaceRay = ToObjectSpace(ray);
|
||||||
|
return DoIntersect(objSpaceRay, t, stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +101,8 @@ Ray
|
||||||
Object::ToObjectSpace(Ray ray)
|
Object::ToObjectSpace(Ray ray)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
ray.origin = mTranslation * ray.origin;
|
ray.origin = ToObjectSpace(ray.origin);
|
||||||
|
//ray.direction = ToObjectSpace(ray.direction).Normalize();
|
||||||
return ray;
|
return ray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue