Crate dolly

Source
Expand description

Composable cameras for simple games and apps.

A dolly CameraRig comprises a chain of RigDrivers. Each driver in the chain applies a transformation or an animation on top of the previous one.

Every driver provides runtime controls over its functionality, e.g. YawPitch calculates rotation via yaw and pitch angles. Each frame, driver parameters can be modified, and will affect the subsequent call to CameraRig::update, which provides the final camera transformation.

§Example

use dolly::prelude::*;
let mut camera: CameraRig = CameraRig::builder()
    .with(Position::new(glam::Vec3::ZERO))
    .with(YawPitch::new())
    .with(Smooth::new_position_rotation(1.0, 1.0))
    .build();

// ...

camera
    .driver_mut::<YawPitch>()
    .rotate_yaw_pitch(10.0, 0.0);
camera.update(1.0 / 60.0);

Modules§

driver
drivers
handedness
prelude
rig
transform
util