Function quat::set_axis_angle[][src]

pub fn set_axis_angle<'out, T>(
    out: &'out mut [T; 4],
    axis: &[T; 3],
    angle: &T
) -> &'out mut [T; 4] where
    T: Real + FromPrimitive

Example

use std::f32::consts::FRAC_2_PI;
let mut q = quat::new_identity::<f32>();
quat::set_axis_angle(&mut q, &[0_f32, 0_f32, 1_f32], &FRAC_2_PI);
assert_eq!(q, [0_f32, 0_f32, 0.3129618_f32, 0.94976574_f32]);