Skip to content

Commit

Permalink
Vec3: add a copy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Sep 24, 2024
1 parent 5739336 commit 9b7ebad
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/github/stephengold/joltjni/Vec3.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ public Vec3(float[] array) {
this.y = array[1];
this.z = array[2];
}

/**
* Instantiate a copy of the argument.
*
* @param vec the vector to copy (not null, unaffected)
*/
public Vec3(Vec3Arg vec) {
this.x = vec.getX();
this.y = vec.getY();
this.z = vec.getZ();
}
// *************************************************************************
// new methods exposed

Expand Down

0 comments on commit 9b7ebad

Please sign in to comment.