Orbit camera that revolves around a target point.
void reset()
Reset all parameters to defaults.
float radius() const
Current orbit radius (distance to target).
glm::vec3 position() const
Current camera world position.
void setLookAt(const glm::vec3 &target)
Set the point the camera orbits around.
float yaw() const
Current yaw angle in radians.
void setPitch(float pitch)
Set the pitch angle (vertical elevation).
void setRadius(float radius)
Set the distance from the camera to the target.
void resetFromBounds(float zMin, float zMax, float fovDegrees)
Reset the camera to frame a model whose bounding box spans [zMin, zMax].
void setPosition(const glm::vec3 &position)
Set the camera world position directly.
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).
glm::mat4 getViewMatrix() const
Compute the current view matrix from yaw, pitch, and radius.
void setYaw(float yaw)
Set the yaw angle (horizontal rotation around the target).
void setYawAndPitch(float yaw, float pitch)
Set both yaw and pitch simultaneously.