Update index impls.
This commit is contained in:
parent
fbb484408b
commit
a467bf7032
7 changed files with 14 additions and 14 deletions
|
@ -381,10 +381,10 @@ impl<T:Copy + Float + FuzzyEq<T> + Add<T,T> + Sub<T,T> + Mul<T,T> + Div<T,T> + N
|
||||||
|
|
||||||
impl<T:Copy> Index<uint, Vec2<T>> for Mat2<T> {
|
impl<T:Copy> Index<uint, Vec2<T>> for Mat2<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> Vec2<T> {
|
fn index(&self, i: uint) -> Vec2<T> {
|
||||||
unsafe { do buf_as_slice(
|
unsafe { do buf_as_slice(
|
||||||
transmute::<*Mat2<T>, *Vec2<T>>(
|
transmute::<*Mat2<T>, *Vec2<T>>(
|
||||||
to_unsafe_ptr(self)), 2) |slice| { slice[*i] }
|
to_unsafe_ptr(self)), 2) |slice| { slice[i] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -558,10 +558,10 @@ impl<T:Copy + Float + FuzzyEq<T> + Add<T,T> + Sub<T,T> + Mul<T,T> + Div<T,T> + N
|
||||||
|
|
||||||
impl<T:Copy> Index<uint, Vec3<T>> for Mat3<T> {
|
impl<T:Copy> Index<uint, Vec3<T>> for Mat3<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> Vec3<T> {
|
fn index(&self, i: uint) -> Vec3<T> {
|
||||||
unsafe { do buf_as_slice(
|
unsafe { do buf_as_slice(
|
||||||
transmute::<*Mat3<T>, *Vec3<T>>(
|
transmute::<*Mat3<T>, *Vec3<T>>(
|
||||||
to_unsafe_ptr(self)), 3) |slice| { slice[*i] }
|
to_unsafe_ptr(self)), 3) |slice| { slice[i] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -501,10 +501,10 @@ impl<T:Copy + Float + FuzzyEq<T> + Add<T,T> + Sub<T,T> + Mul<T,T> + Div<T,T> + N
|
||||||
|
|
||||||
impl<T:Copy> Index<uint, Vec4<T>> for Mat4<T> {
|
impl<T:Copy> Index<uint, Vec4<T>> for Mat4<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> Vec4<T> {
|
fn index(&self, i: uint) -> Vec4<T> {
|
||||||
unsafe { do buf_as_slice(
|
unsafe { do buf_as_slice(
|
||||||
transmute::<*Mat4<T>, *Vec4<T>>(
|
transmute::<*Mat4<T>, *Vec4<T>>(
|
||||||
to_unsafe_ptr(self)), 4) |slice| { slice[*i] }
|
to_unsafe_ptr(self)), 4) |slice| { slice[i] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,10 +391,10 @@ pub impl<T:Copy + Float + FuzzyEq<T> + Add<T,T> + Sub<T,T> + Mul<T,T> + Div<T,T>
|
||||||
|
|
||||||
impl<T:Copy> Index<uint, T> for Quat<T> {
|
impl<T:Copy> Index<uint, T> for Quat<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> T {
|
fn index(&self, i: uint) -> T {
|
||||||
unsafe { do buf_as_slice(
|
unsafe { do buf_as_slice(
|
||||||
transmute::<*Quat<T>, *T>(
|
transmute::<*Quat<T>, *T>(
|
||||||
to_unsafe_ptr(self)), 4) |slice| { slice[*i] }
|
to_unsafe_ptr(self)), 4) |slice| { slice[i] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,8 @@ impl<T> Vector2<T> for Vec2<T> {
|
||||||
|
|
||||||
impl<T:Copy + Eq> Index<uint, T> for Vec2<T> {
|
impl<T:Copy + Eq> Index<uint, T> for Vec2<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> T {
|
fn index(&self, i: uint) -> T {
|
||||||
unsafe { do buf_as_slice(self.to_ptr(), 2) |slice| { slice[*i] } }
|
unsafe { do buf_as_slice(self.to_ptr(), 2) |slice| { slice[i] } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ impl<T> Vector3<T> for Vec3<T> {
|
||||||
|
|
||||||
impl<T:Copy + Eq> Index<uint, T> for Vec3<T> {
|
impl<T:Copy + Eq> Index<uint, T> for Vec3<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> T {
|
fn index(&self, i: uint) -> T {
|
||||||
unsafe { do buf_as_slice(self.to_ptr(), 3) |slice| { slice[*i] } }
|
unsafe { do buf_as_slice(self.to_ptr(), 3) |slice| { slice[i] } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,8 @@ impl<T> Vector4<T> for Vec4<T> {
|
||||||
|
|
||||||
impl<T:Copy + Eq> Index<uint, T> for Vec4<T> {
|
impl<T:Copy + Eq> Index<uint, T> for Vec4<T> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn index(&self, i: &uint) -> T {
|
fn index(&self, i: uint) -> T {
|
||||||
unsafe { do buf_as_slice(self.to_ptr(), 4) |slice| { slice[*i] } }
|
unsafe { do buf_as_slice(self.to_ptr(), 4) |slice| { slice[i] } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue