Skip to content
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

Merged
merged 4 commits into from
May 2, 2018
Merged

Create configurable camera #16

merged 4 commits into from
May 2, 2018

Conversation

davepagurek
Copy link
Member

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.

private dirty: boolean = true;

/**
* @param {vec3} position The world-space coordinate to move the camera to, preserving rotation
Copy link
Member

Choose a reason for hiding this comment

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

😍

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;
Copy link
Member

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?


/**
* 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
Copy link
Member

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?

Copy link
Member

@armcburney armcburney left a 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!! 💯

@davepagurek davepagurek merged commit 4dd1bc4 into master May 2, 2018
@davepagurek davepagurek deleted the camera branch May 2, 2018 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants