Skip to content

Commit

Permalink
Fix Vector2f/d.perpendicular() (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
ieperen3039 authored Apr 28, 2020
1 parent c5b9b4a commit 2c119bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/org/joml/Vector2d.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,9 @@ public Vector2dc getToAddress(long address) {
* @return this
*/
public Vector2d perpendicular() {
this.x = y;
double xTemp = y;
this.y = x * -1;
this.x = xTemp;
return this;
}

Expand Down
5 changes: 3 additions & 2 deletions src/org/joml/Vector2f.java
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,9 @@ public Vector2fc getToAddress(long address) {
* @return this
*/
public Vector2f perpendicular() {
this.x = y;
this.y = x * -1;
float xTemp = y;
this.y = this.x * -1;
this.x = xTemp;
return this;
}

Expand Down

0 comments on commit 2c119bd

Please sign in to comment.