consolidate imports
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#[macro_use] extern crate gfx;
|
#[macro_use] extern crate gfx;
|
||||||
#[macro_use] extern crate log;
|
#[macro_use] extern crate log;
|
||||||
|
extern crate nalgebra as na;
|
||||||
|
extern crate num_traits;
|
||||||
|
extern crate piston;
|
||||||
|
|
||||||
pub mod arena;
|
pub mod arena;
|
||||||
pub mod ega;
|
pub mod ega;
|
||||||
|
|||||||
10
src/scene.rs
10
src/scene.rs
@@ -1,11 +1,9 @@
|
|||||||
|
use gfx;
|
||||||
|
use na;
|
||||||
|
use piston;
|
||||||
use view;
|
use view;
|
||||||
use vr;
|
use vr;
|
||||||
|
|
||||||
extern crate gfx;
|
|
||||||
extern crate gfx_device_gl;
|
|
||||||
extern crate nalgebra as na;
|
|
||||||
extern crate piston_window;
|
|
||||||
|
|
||||||
pub trait Scene<D: gfx::Device,
|
pub trait Scene<D: gfx::Device,
|
||||||
F: gfx::Factory<D::Resources>> {
|
F: gfx::Factory<D::Resources>> {
|
||||||
fn event(&mut self, event: Event);
|
fn event(&mut self, event: Event);
|
||||||
@@ -24,5 +22,5 @@ pub trait Scene<D: gfx::Device,
|
|||||||
|
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
Vr(vr::Event),
|
Vr(vr::Event),
|
||||||
Piston(piston_window::Input),
|
Piston(piston::input::Input),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,22 +5,17 @@ use vr;
|
|||||||
use world as model;
|
use world as model;
|
||||||
use world::HasMap;
|
use world::HasMap;
|
||||||
|
|
||||||
extern crate gfx;
|
|
||||||
extern crate memmap;
|
extern crate memmap;
|
||||||
extern crate nalgebra as na;
|
|
||||||
extern crate num_traits;
|
|
||||||
extern crate openvr_sys;
|
|
||||||
extern crate piston;
|
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
|
|
||||||
use gfx::tex;
|
use gfx::{self, tex};
|
||||||
use gfx::traits::FactoryExt;
|
use gfx::traits::FactoryExt;
|
||||||
use self::na::ToHomogeneous;
|
use na::{self, ToHomogeneous};
|
||||||
use self::num_traits::identities::One;
|
use num_traits::identities::One;
|
||||||
use self::piston::input::{Button, Input, Key};
|
use piston::input::{Button, Input, Key};
|
||||||
|
|
||||||
const PI: f32 = ::std::f32::consts::PI;
|
const PI: f32 = ::std::f32::consts::PI;
|
||||||
const TWO_PI_CIRC: f32 = 2.0 * PI / 256.0;
|
const TWO_PI_CIRC: f32 = 2.0 * PI / 256.0;
|
||||||
@@ -140,7 +135,7 @@ pub struct WorldScene<D: gfx::Device,
|
|||||||
|
|
||||||
start_time: SystemTime,
|
start_time: SystemTime,
|
||||||
treadmills: (f32, f32),
|
treadmills: (f32, f32),
|
||||||
pads: BTreeMap<u32, (TrackMode, Option<openvr_sys::VRControllerState_t>)>,
|
pads: BTreeMap<u32, (TrackMode, Option<vr::VRControllerState_t>)>,
|
||||||
|
|
||||||
_worldmap: model::World,
|
_worldmap: model::World,
|
||||||
lat: u8,
|
lat: u8,
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
extern crate gfx;
|
|
||||||
|
|
||||||
use ega;
|
use ega;
|
||||||
|
|
||||||
use ::std;
|
use ::std;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use self::gfx::{CommandBuffer, Typed};
|
use gfx::{self, CommandBuffer, Typed};
|
||||||
use self::gfx::tex;
|
use gfx::tex;
|
||||||
|
|
||||||
const TILEDIM: u16 = 16;
|
const TILEDIM: u16 = 16;
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
use vr;
|
use vr::{self, AsMatrix4, VR};
|
||||||
use vr::{AsMatrix4, VR};
|
|
||||||
|
|
||||||
extern crate gfx_device_gl;
|
extern crate gfx_device_gl;
|
||||||
extern crate nalgebra as na;
|
|
||||||
extern crate num_traits;
|
|
||||||
extern crate piston_window;
|
extern crate piston_window;
|
||||||
|
|
||||||
use gfx;
|
use gfx;
|
||||||
use gfx::Device;
|
use gfx::Device;
|
||||||
use gfx::traits::FactoryExt;
|
use gfx::traits::FactoryExt;
|
||||||
use self::na::{Inverse, ToHomogeneous};
|
use na::{self, Inverse, ToHomogeneous};
|
||||||
use self::piston_window::{PistonWindow, Window};
|
use self::piston_window::{PistonWindow, Window};
|
||||||
|
|
||||||
pub type ColorFormat = gfx::format::Srgba8;
|
pub type ColorFormat = gfx::format::Srgba8;
|
||||||
|
|||||||
14
src/vr.rs
14
src/vr.rs
@@ -1,19 +1,17 @@
|
|||||||
extern crate gfx;
|
|
||||||
extern crate gfx_device_gl;
|
extern crate gfx_device_gl;
|
||||||
extern crate nalgebra as na;
|
|
||||||
extern crate num_traits;
|
|
||||||
extern crate openvr as vr;
|
extern crate openvr as vr;
|
||||||
extern crate openvr_sys;
|
extern crate openvr_sys;
|
||||||
|
|
||||||
pub use self::vr::Eye;
|
pub use self::vr::Eye;
|
||||||
pub use self::vr::common::Size;
|
pub use self::vr::common::Size;
|
||||||
pub use self::vr::tracking::{TrackedDeviceClass, TrackedDevicePoses};
|
pub use self::openvr_sys::VRControllerState_t;
|
||||||
|
|
||||||
|
use gfx::{self, tex, Factory, Typed};
|
||||||
|
use na::{self, Inverse};
|
||||||
|
use num_traits::identities::Zero;
|
||||||
|
use num_traits::identities::One;
|
||||||
|
|
||||||
use self::gfx::{tex, Factory, Typed};
|
|
||||||
use self::gfx_device_gl::Resources as GLResources;
|
use self::gfx_device_gl::Resources as GLResources;
|
||||||
use self::na::Inverse;
|
|
||||||
use self::num_traits::identities::Zero;
|
|
||||||
use self::num_traits::identities::One;
|
|
||||||
use self::openvr_sys::{VREvent_Controller_t, VREvent_t};
|
use self::openvr_sys::{VREvent_Controller_t, VREvent_t};
|
||||||
|
|
||||||
pub struct VR {
|
pub struct VR {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
extern crate core;
|
|
||||||
extern crate itertools;
|
extern crate itertools;
|
||||||
|
|
||||||
use self::itertools::Itertools;
|
use self::itertools::Itertools;
|
||||||
|
|||||||
Reference in New Issue
Block a user