18 if (input.
zoom != 0.0f)
24 if (input.
panX != 0.0f || input.
panZ != 0.0f)
26 const auto look = camera.
lookAt();
27 const auto right = camera.
right();
29 look.y + right.y * input.
panX,
30 look.z + input.
panZ));
Orbit camera that revolves around a target point.
float radius() const
Current orbit radius (distance to target).
void setLookAt(const glm::vec3 &target)
Set the point the camera orbits around.
float yaw() const
Current yaw angle in radians.
void setRadius(float radius)
Set the distance from the camera to the target.
float pitch() const
Current pitch angle in radians.
glm::vec3 lookAt() const
Current orbit target position.
glm::vec3 right() const
Camera right vector (perpendicular to view direction and up).
void setYawAndPitch(float yaw, float pitch)
Set both yaw and pitch simultaneously.
void apply(const InputState &input, OrbitCamera &camera)
Apply the resolved input state to the orbit camera.