diff options
| author | Juan Linietsky | 2014-07-06 11:49:27 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-07-06 11:49:27 -0300 |
| commit | 3d68949a1cc41b4865618bddde23122f66764ee1 (patch) | |
| tree | 53a988954a59793223542ff362f70089515dd630 /core/math/math_2d.cpp | |
| parent | cd80d442a212a119b4bfce95dce78a08cbc49490 (diff) | |
| download | godot-3d68949a1cc41b4865618bddde23122f66764ee1.tar.gz godot-3d68949a1cc41b4865618bddde23122f66764ee1.tar.zst godot-3d68949a1cc41b4865618bddde23122f66764ee1.zip | |
2D Animation Improvements
-=-=-=-=-=-=-=-=-=--=-=-=
-Ability to set 2D nodes as bones
-Abity to set 2D nodes as IK chains
-2D IK Solver
-Improvements in the UI for adding keyframes (separate loc,rot,scale buttons)
Diffstat (limited to 'core/math/math_2d.cpp')
| -rw-r--r-- | core/math/math_2d.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index acaaa327f..6c160abac 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -74,7 +74,7 @@ float Vector2::distance_squared_to(const Vector2& p_vector2) const { float Vector2::angle_to(const Vector2& p_vector2) const { - return Math::atan2( x-p_vector2.x, y - p_vector2.y ); + return Math::atan2( tangent().dot(p_vector2), dot(p_vector2) ); } float Vector2::dot(const Vector2& p_other) const { @@ -594,6 +594,10 @@ Matrix32 Matrix32::rotated(float p_phi) const { } +float Matrix32::basis_determinant() const { + + return elements[0].x * elements[1].y - elements[0].y * elements[1].x; +} Matrix32 Matrix32::interpolate_with(const Matrix32& p_transform, float p_c) const { |
