Skip to content

Commit

Permalink
fix h2d.Object.move implementation (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
daimahou authored Dec 4, 2024
1 parent 22c0f94 commit c17a7b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.0.1 (December, 3, 2024)
* fix h2d.Object.move method to perform local movement as intended

## 2.0 (January 1, 2024)

* changed h3d.Vector to be a 3 component vector (alias to h3d.col.Point), added h3d.Vector4
Expand Down
4 changes: 2 additions & 2 deletions h2d/Object.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ class Object #if (domkit && !domkit_heaps) implements domkit.Model<h2d.Object> #
Move the object by the specified amount along its current direction (`Object.rotation` angle).
**/
public function move( dx : Float, dy : Float ) {
x += dx * Math.cos(rotation);
y += dy * Math.sin(rotation);
x += dx * Math.cos(rotation) - dy * Math.sin(rotation);
y += dx * Math.sin(rotation) + dy * Math.cos(rotation);
}

/**
Expand Down

0 comments on commit c17a7b7

Please sign in to comment.