use ffi;
use std::default::Default;
pub fn from_ptr(vec: ffi::FMOD_VECTOR) -> Vector {
Vector {
x: vec.x,
y: vec.y,
z: vec.z,
}
}
pub fn get_ffi(vec: &Vector) -> ffi::FMOD_VECTOR {
ffi::FMOD_VECTOR {
x: vec.x,
y: vec.y,
z: vec.z,
}
}
#[derive(Debug, Clone, Copy)]
pub struct Vector {
pub x: f32,
pub y: f32,
pub z: f32,
}
impl Default for Vector {
fn default() -> Vector {
Vector::new()
}
}
impl Vector {
pub fn new() -> Vector {
Vector {
x: 0f32,
y: 0f32,
z: 0f32,
}
}
}
impl PartialEq for Vector {
fn eq(&self, other: &Vector) -> bool {
self.x == other.x && self.y == other.y && self.z == other.z
}
fn ne(&self, other: &Vector) -> bool {
!self.eq(other)
}
}