Skip to content

Commit

Permalink
Vec3: add a double-precision constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 28, 2024
1 parent d496166 commit 68db5db
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/github/stephengold/joltjni/Vec3.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ public Vec3() {
this.z = 0f;
}

/**
* Instantiate a vector with specified components.
*
* @param x the desired X component
* @param y the desired Y component
* @param z the desired Z component
*/
public Vec3(double x, double y, double z) {
this.x = (float) x;
this.y = (float) y;
this.z = (float) z;
}

/**
* Instantiate a vector with specified components.
*
Expand Down

0 comments on commit 68db5db

Please sign in to comment.