Skip to content

Commit c43e25c

Browse files
committed
Fix bug in Vector2::rotated()
1 parent b3b548e commit c43e25c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gdnative-core/src/core_types/vector2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl Vector2 {
251251
#[inline]
252252
pub fn rotated(self, angle: f32) -> Self {
253253
let (cos, sin) = (angle.cos(), angle.sin());
254-
Self::new(cos * self.x + sin * self.y, sin * self.x + cos * self.y)
254+
Self::new(cos * self.x - sin * self.y, sin * self.x + cos * self.y)
255255
}
256256

257257
/// Returns the vector with all components rounded to the nearest integer, with halfway cases

0 commit comments

Comments
 (0)