1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
//! A Rust implementation of [glMatrix](http://glmatrix.net/) //! //! gl_matrix provides utilities or all [glMatrix](http://glmatrix.net/) functions in Rust. //! //! # Quick Start //! //! Getting started should be easy if you are already familiar with [glMatrix](http://glmatrix.net/) //! and Rust. All functions have been re-named to be idiomatic Rust. //! //! ``` //! use gl_matrix::common::*; //! use gl_matrix::{vec3, mat4}; //! //! let canvas_w = 800_f32; //! let canvas_h = 600_f32; //! //! let mut world_matrix: Mat4 = [0.; 16]; //! let mut view_matrix: Mat4 = [0.; 16]; //! let mut proj_matrix: Mat4 = [0.; 16]; //! //! let eye = vec3::from_values(0., 0., -8.); //! let center = vec3::from_values(0., 0., 0.); //! let up = vec3::from_values(0., 1., 0.); //! //! mat4::identity(&mut world_matrix); //! mat4::look_at(&mut view_matrix, &eye, ¢er, &up); //! mat4::perspective(&mut proj_matrix, to_radian(45.), canvas_w / canvas_h, 0.1, Some(100.0)); //! ``` //#![cfg_attr(not(feature = "std"), no_std)] #[deny(missing_docs)] pub mod common; #[deny(missing_docs)] pub mod mat2; #[deny(missing_docs)] pub mod mat2d; #[deny(missing_docs)] pub mod mat3; #[deny(missing_docs)] pub mod mat4; #[deny(missing_docs)] pub mod quat; #[deny(missing_docs)] pub mod quat2; #[deny(missing_docs)] pub mod vec2; #[deny(missing_docs)] pub mod vec3; #[deny(missing_docs)] pub mod vec4;