Skip to content

struct

Orbit

pub struct Orbit {
    pub azimuth: f32,
    pub elevation: f32,
    pub zoom: f32,
}

Orbit-control state for a scene3d(controls: "orbit"): offsets from the template's camera.

Fields

azimuth

pub azimuth: f32

Degrees around the target (positive = to the right).

elevation

pub elevation: f32

Degrees above the starting angle.

zoom

pub zoom: f32

Distance multiplier (< 1 is closer).

Methods

drag

pub fn drag(&mut self, dx: f32, dy: f32)

Apply a pointer drag of (dx, dy) CSS pixels.

wheel

pub fn wheel(&mut self, delta: f32)

Apply a wheel delta (positive zooms out).

key

pub fn key(&mut self, key: &str) -> bool

Arrow keys rotate, +/- zoom; returns whether the key was used.

Trait implementations