Skip to content

Commit

Permalink
1.3.0 final commit (deprecate Camera#render and add Camera#getView)
Browse files Browse the repository at this point in the history
  • Loading branch information
valoeghese committed Dec 1, 2021
1 parent 908b432 commit d53e9a9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/valoeghese/scalpel/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ private void rebuildView() {
this.view.translate(this.pos);
}

/**
* @deprecated in favour of the {@linkplain valoeghese.scalpel.scene.Model new model system introduced in scalpel 1.3.0}. Instead, get the view with {@link Camera#getView}, set the shader transform and view with {@link Shader#uniformMat4f(String, Matrix4f)}, and then render the model.
*/
@Deprecated
public void render(Model model, Matrix4f transform) {
model.getShader().uniformMat4f("view", this.view);
model.render(transform);
Expand All @@ -54,9 +58,8 @@ public float getPitch() {
return this.pitch;
}

public void setPos(float x, float y, float z) {
this.pos = new Vector3f(x, y, z);
this.rebuildView();
public Matrix4f getView() {
return this.view;
}

public void wrapYaw() {
Expand Down Expand Up @@ -88,4 +91,9 @@ public void setPitch(float f) {
public void setYaw(float f) {
this.yaw = f;
}

public void setPos(float x, float y, float z) {
this.pos = new Vector3f(x, y, z);
this.rebuildView();
}
}

0 comments on commit d53e9a9

Please sign in to comment.