Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/peasy/PeasyCam.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ public PeasyCam(final PApplet parent, PGraphics pg, final double lookAtX, final
this.startCenter = this.center = new Vector3D(lookAtX, lookAtY, lookAtZ);
this.startDistance = this.distance = distance;
this.rotation = new Rotation();
this.originalMatrix = parent.getMatrix((PMatrix3D)null);
g.beginDraw(); //Make sure camera on the PGraphics is initialized. We basically use beginDraw to call the protected setViewport method of PGraphicsOpenGL
g.endDraw();
this.originalMatrix = g.getMatrix((PMatrix3D)null);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems hackish. I wonder why I wasn't just saving the matrix at the top of beginHUD() and restoring that, rather than restoring the "original matrix". Was I stupid, or is there a good reason?


feed();

Expand Down