lib/mittsu/objects/point_cloud.rb in mittsu-0.4.0 vs lib/mittsu/objects/point_cloud.rb in mittsu-0.4.1
- old
+ new
@@ -14,15 +14,15 @@
@_ray = Ray.new
end
def raycast(raycaster, intersects)
threshold = raycaster.params[:point_cloud][:threshold]
- @_inverse_matrix.inverse(self.materix_world)
+ @_inverse_matrix.inverse(self.matrix_world)
@_ray.copy(raycaster.ray).apply_matrix4(@_inverse_matrix)
if !geometry.bounding_box.nil?
- return if ray.intersection_box?(geometry.bounding_box) == false
+ return if @_ray.intersection_box?(geometry.bounding_box) == false
end
local_threshold = threshold / ((self.scale.x + self.scale.y + self.scale.z) / 3.0)
position = Vector3.new
@@ -80,10 +80,10 @@
private
def test_point(point, index, local_threshold, raycaster, intersects)
ray_point_distance = @_ray.distance_to_point(point)
if ray_point_distance < local_threshold
- intersect_point = @_ray.closes_point_to_point(point)
+ intersect_point = @_ray.closest_point_to_point(point)
intersect_point.apply_matrix4(self.matrix_world)
distance = raycaster.ray.origin.distance_to(intersect_point)
intersects << {
distance: distance,