Skip to content

Instantly share code, notes, and snippets.

@febret
Last active December 21, 2015 05:39
Show Gist options
  • Save febret/6258665 to your computer and use it in GitHub Desktop.
Save febret/6258665 to your computer and use it in GitHub Desktop.
GamepadCameraController camera update
///////////////////////////////////////////////////////////////////////////////////////////////////
void GamepadCameraController::update(const UpdateContext& context)
{
if(!isEnabled()) return;
Camera* c = getCamera();
c->setOrientation(Math::quaternionFromEuler(Vector3f(myPitch, myYaw, 0)));
c->translate(mySpeedVector * context.dt, Node::TransformLocal);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment