Skip to content

Instantly share code, notes, and snippets.

@tuttlem
Created December 30, 2013 06:52
Show Gist options
  • Save tuttlem/8178706 to your computer and use it in GitHub Desktop.
Save tuttlem/8178706 to your computer and use it in GitHub Desktop.
Camera movement
// z movement
void camera::advance(const float distance) {
this->position += (this->viewDir * -distance);
}
// y movement
void camera::ascend(const float distance) {
this->position += (this->upVector * distance);
}
// x movement
void camera::strafe(const float distance) {
this->position += (this->rightVector * distance);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment