Skip to content

Commit

Permalink
Geometry: rename both setTranslation() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Aug 9, 2023
1 parent 846dc01 commit d6bce0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ public void initialize() {
mars.setProgram("Unshaded/Texture");
mars.setTexture(marsKey);
mars.scale(0.4f);
mars.setTranslation(1f, 0f, 0.2f);
mars.setLocation(1f, 0f, 0.2f);

Geometry photo = new Geometry(squareMesh);
photo.setProgram("Unshaded/Texture");
photo.setTexture(photoKey);
photo.setOrientation(FastMath.PI, 0f, 0f, 1f);
photo.setTranslation(1f, 1.4f, -0.2f);
photo.setLocation(1f, 1.4f, -0.2f);

Geometry room = new Geometry(roomMesh);
room.setProgram("Unshaded/Texture");
Expand Down
20 changes: 10 additions & 10 deletions lib/src/main/java/com/github/stephengold/vsport/Geometry.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,27 +251,27 @@ public Geometry setTexture(TextureKey textureKey) {
}

/**
* Alter the mesh-to-world offset.
* Translate the mesh origin to the specified location.
*
* @param x the desired X offset (in world coordinates)
* @param y the desired Y offset (in world coordinates)
* @param z the desired Z offset (in world coordinates)
* @param x the desired X coordinate (in world coordinates)
* @param y the desired Y coordinate (in world coordinates)
* @param z the desired Z coordinate (in world coordinates)
* @return the (modified) current instance (for chaining)
*/
public Geometry setTranslation(float x, float y, float z) {
public Geometry setLocation(float x, float y, float z) {
uniformValues.setLocation(x, y, z);
return this;
}

/**
* Alter the mesh-to-world offset.
* Translate the mesh origin to the specified location.
*
* @param desiredOffset the desired offset (in world coordinates, not null)
* @param desiredLocation the desired location (in world coordinates, not
* @return the (modified) current instance (for chaining)
*/
public Geometry setTranslation(Vector3fc desiredOffset) {
Validate.nonNull(desiredOffset, "desired offset");
uniformValues.setLocation(desiredOffset);
public Geometry setLocation(Vector3fc desiredLocation) {
Validate.nonNull(desiredLocation, "desired location");
uniformValues.setLocation(desiredLocation);
return this;
}

Expand Down

0 comments on commit d6bce0c

Please sign in to comment.