aardvark-platform / aardvark.base

Aardvark.Base is the foundation of the open-source Aardvark Platform for visual computing, real-time graphics, and visualization.
https://aardvarkians.com/
Apache License 2.0
154 stars 9 forks source link

FastRay3d - Box3d intersection fails if Z-range of Box3d is zero #55

Open madorjan opened 3 years ago

madorjan commented 3 years ago

Example:

let ray = FastRay3d(10.0 * V3d.OOI, -V3d.OOI)

let boxSucceeds = Box3d(-V3d.IIO, V3d(1.0,1.0,1e-8))
let mutable tmin = 0.0
let mutable tmax = Double.MaxValue
let intersects = ray.Intersects(boxSucceeds, &tmin, &tmax)
Assert.IsTrue intersects

let boxFails = Box3d(-V3d.IIO, V3d.IIO)
tmin <- 0.0
tmax <- Double.MaxValue
let intersects = ray.Intersects(boxFails, &tmin, &tmax)
Assert.IsTrue intersects //this assertion fails