Fix for issue #2117
This commit is contained in:
parent
b0aa49accb
commit
d6aed94651
1 changed files with 5 additions and 0 deletions
|
@ -113,6 +113,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
|
|||
return false;
|
||||
|
||||
Transform gt = node->get_global_transform();
|
||||
Transform gi = gt.affine_inverse();
|
||||
float depth = node->get_depth()*0.5;
|
||||
Vector3 n = gt.basis.get_axis(2).normalized();
|
||||
Plane p(gt.origin+n*depth,n);
|
||||
|
@ -135,6 +136,8 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
|
|||
if (!p.intersects_ray(ray_from,ray_dir,&spoint))
|
||||
break;
|
||||
|
||||
spoint = gi.xform(spoint);
|
||||
|
||||
Vector2 cpoint(spoint.x,spoint.y);
|
||||
|
||||
cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint);
|
||||
|
@ -349,6 +352,8 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
|
|||
if (!p.intersects_ray(ray_from,ray_dir,&spoint))
|
||||
break;
|
||||
|
||||
spoint = gi.xform(spoint);
|
||||
|
||||
Vector2 cpoint(spoint.x,spoint.y);
|
||||
|
||||
cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint);
|
||||
|
|
Loading…
Reference in a new issue