mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
RayCast2D: fix detached arrow tip
(cherry picked from commit 64879e592b)
This commit is contained in:
parent
d8ae6e5815
commit
85e6a38c0b
1 changed files with 4 additions and 4 deletions
|
|
@ -127,16 +127,16 @@ void RayCast2D::_notification(int p_what) {
|
||||||
break;
|
break;
|
||||||
Matrix32 xf;
|
Matrix32 xf;
|
||||||
xf.rotate(cast_to.angle());
|
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());
|
//Vector2 tip = Vector2(0,s->get_length());
|
||||||
Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4);
|
Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4);
|
||||||
draw_line(Vector2(), cast_to, dcol, 3);
|
draw_line(Vector2(), cast_to, dcol, 3);
|
||||||
Vector<Vector2> pts;
|
Vector<Vector2> pts;
|
||||||
float tsize = 4;
|
float tsize = 4;
|
||||||
pts.push_back(xf.xform(Vector2(0, tsize)));
|
pts.push_back(xf.xform(Vector2(tsize, 0)));
|
||||||
pts.push_back(xf.xform(Vector2(0.707 * tsize, 0)));
|
pts.push_back(xf.xform(Vector2(0, 0.707 * tsize)));
|
||||||
pts.push_back(xf.xform(Vector2(-0.707 * tsize, 0)));
|
pts.push_back(xf.xform(Vector2(0, -0.707 * tsize)));
|
||||||
Vector<Color> cols;
|
Vector<Color> cols;
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
cols.push_back(dcol);
|
cols.push_back(dcol);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue