Fix error when there is no hit

This commit is contained in:
pullusb
2024-07-15 15:47:24 +02:00
parent 6707d693d6
commit 4da4c2801d
6 changed files with 229 additions and 4 deletions
+1 -1
View File
@@ -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)