buttery
Exponentially smoothed transformations with a clean API.
Basic Example:
use ;
use ;
let mut camera = Camera ;
// Simulate user input:
camera.position.target += X;
camera.looking.target *= from_rotation_x;
// For each frame:
// Time since last frame in seconds.
let delta_time = 0.016;
let transform = camera.position.begin
.and_then
.drive;
let view_matrix = transform.inverse;
Following example:
This example makes the camera follow a target.
In this case, we can't quite use the .and_then
api:
use ;
use ;
let mut camera = Camera ;
// Simulate user input:
camera.position.target += X;
camera.target.target += NEG_Y;
// For each frame:
// Time since last frame in seconds.
let delta_time = 0.016;
let camera_position = camera.position.drive;
let partial = camera.target.begin
.drive;
let transform = partial * from_translation;
let view_matrix = transform.inverse;