-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create configurable camera #16
Conversation
src/renderer/Camera.ts
Outdated
private dirty: boolean = true; | ||
|
||
/** | ||
* @param {vec3} position The world-space coordinate to move the camera to, preserving rotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
src/renderer/Camera.ts
Outdated
private position: vec3 = vec3.fromValues(0, 0, 0); | ||
private target: vec3 = vec3.copy(vec3.create(), Camera.defaultDirection); | ||
private transform: mat4 = mat4.create(); | ||
private dirty: boolean = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment for what dirty
refers to please?
src/renderer/Camera.ts
Outdated
|
||
/** | ||
* Represents the orientation of the camera in a scene, defined by a position for the camera and a | ||
* target for the camera to look at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge nit, but do you think you could use periods at the end of your comments to be consistent with the commenting I have in #11?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, and nice specs!! 💯
Addresses #12
This models the camera using a position and a target to look at. I added some convenience methods to modify those values. I lazily generate the transformation matrix so we don't do extra work if multiple changes are made before the matrix is read.