diff options
| author | Juan Linietsky | 2014-08-01 22:10:38 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-08-01 22:10:38 -0300 |
| commit | 678948068bbde7f12a9c5f28a467b6cf4d127851 (patch) | |
| tree | 75572f3a5cc6089a6ca3046e9307d0a7c0b72c51 /core/math/math_2d.cpp | |
| parent | 9ff6d55822647c87eef392147ea15641d0922d47 (diff) | |
| download | godot-678948068bbde7f12a9c5f28a467b6cf4d127851.tar.gz godot-678948068bbde7f12a9c5f28a467b6cf4d127851.tar.zst godot-678948068bbde7f12a9c5f28a467b6cf4d127851.zip | |
Diffstat (limited to 'core/math/math_2d.cpp')
| -rw-r--r-- | core/math/math_2d.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 6c160abac..3aaa539fb 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -77,6 +77,11 @@ float Vector2::angle_to(const Vector2& p_vector2) const { return Math::atan2( tangent().dot(p_vector2), dot(p_vector2) ); } +float Vector2::angle_to_point(const Vector2& p_vector2) const { + + return Math::atan2( x-p_vector2.x, y - p_vector2.y ); +} + float Vector2::dot(const Vector2& p_other) const { return x*p_other.x + y*p_other.y; |
