lib/cyberarm_engine/ray.rb in cyberarm_engine-0.14.0 vs lib/cyberarm_engine/ray.rb in cyberarm_engine-0.15.0
- old
+ new
@@ -2,11 +2,11 @@
class Ray
def initialize(origin, direction, range = Float::INFINITY)
raise "Origin must be a Vector!" unless origin.is_a?(Vector)
raise "Direction must be a Vector!" unless direction.is_a?(Vector)
- @origin = origin
+ @origin = origin
@direction = direction
@range = range
@inverse_direction = @direction.inverse
end
@@ -40,17 +40,17 @@
tz2 = (box.max.z - @origin.z) * @inverse_direction.z
tmin = max(tmin, min(tz1, tz2))
tmax = min(tmax, max(tz1, tz2))
- return tmax >= max(tmin, 0.0);
+ tmax >= max(tmin, 0.0)
end
def min(x, y)
- ((x) < (y) ? (x) : (y))
+ ((x) < (y) ? x : y)
end
def max(x, y)
- ((x) > (y) ? (x) : (y))
+ ((x) > (y) ? x : y)
end
end
-end
\ No newline at end of file
+end