Fix error when there is no hit
This commit is contained in:
@@ -64,7 +64,7 @@ def search_square(point, factor=0.05, cam=None):
|
||||
mat = cam.matrix_world.copy()
|
||||
mat.translation = point
|
||||
depth = vector_magnitude(point - cam.matrix_world.to_translation())
|
||||
mat_scale = Matrix.Scale(tan(cam.data.angle*0.5)*depth*factor, 4)
|
||||
mat_scale = Matrix.Scale(tan(cam.data.angle * 0.5) * depth * factor, 4)
|
||||
|
||||
return matrix_transform(plane, mat @ mat_scale)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user