Move ray picking to DepthPass

This commit is contained in:
fieldOfView 2018-03-13 20:05:49 +01:00
parent 73558c9e36
commit d88724aff5
2 changed files with 12 additions and 7 deletions

View file

@ -34,9 +34,7 @@ class SupportEraser(Tool):
depth_pass = DepthPass(active_camera.getViewportWidth(), active_camera.getViewportHeight())
depth_pass.render()
distance = depth_pass.getDepthAtPosition(event.x, event.y)
ray = active_camera.getRay(event.x, event.y)
picked_position = ray.getPointAlongRay(distance)
picked_position = depth_pass.getPickedPosition(event.x, event.y)
# Add the anto_overhang_mesh cube:
self._createEraserMesh(picked_position)