diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-05-08 16:12:40 +0700 |
---|---|---|
committer | Poommetee Ketson <poommetee@protonmail.com> | 2017-05-08 16:12:40 +0700 |
commit | 64879e592b7a4687c9ea9f2fc858775a0c25b76f (patch) | |
tree | e2675502d5e14f94b9adbe0ee7a4df93663e700f /scene | |
parent | 66725d9b21dc50b0bb38baa4aa376b7bbb56e0e4 (diff) |
RayCast2D: fix detached arrow tip
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/ray_cast_2d.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 792861cbf3..0a1a8b56ff 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -157,16 +157,16 @@ void RayCast2D::_notification(int p_what) { break; Transform2D xf; xf.rotate(cast_to.angle()); - xf.translate(Vector2(0, cast_to.length())); + xf.translate(Vector2(cast_to.length(), 0)); //Vector2 tip = Vector2(0,s->get_length()); Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4); draw_line(Vector2(), cast_to, dcol, 3); Vector<Vector2> pts; float tsize = 4; - pts.push_back(xf.xform(Vector2(0, tsize))); - pts.push_back(xf.xform(Vector2(0.707 * tsize, 0))); - pts.push_back(xf.xform(Vector2(-0.707 * tsize, 0))); + pts.push_back(xf.xform(Vector2(tsize, 0))); + pts.push_back(xf.xform(Vector2(0, 0.707 * tsize))); + pts.push_back(xf.xform(Vector2(0, -0.707 * tsize))); Vector<Color> cols; for (int i = 0; i < 3; i++) cols.push_back(dcol); |