Deprecate `to_pnt`, `as_pnt` and `VecAsPnt`.

Those are meaningless. Use `na::orig() + the_vector` instead.
This commit is contained in:
Sébastien Crozet 2014-10-20 22:35:43 +02:00
parent 276bf3f999
commit e2fc8aa764
3 changed files with 5 additions and 2 deletions

View File

@ -332,7 +332,7 @@ impl<N: Num + Clone> UnitQuatMulRhs<N, Vec3<N>> for Vec3<N> {
impl<N: Num + Clone> UnitQuatMulRhs<N, Pnt3<N>> for Pnt3<N> { impl<N: Num + Clone> UnitQuatMulRhs<N, Pnt3<N>> for Pnt3<N> {
#[inline] #[inline]
fn binop(left: &UnitQuat<N>, right: &Pnt3<N>) -> Pnt3<N> { fn binop(left: &UnitQuat<N>, right: &Pnt3<N>) -> Pnt3<N> {
(left * *right.as_vec()).to_pnt() ::orig::<Pnt3<N>>() + *left * *right.as_vec()
} }
} }
@ -349,7 +349,7 @@ impl<N: Num + Clone> Vec3MulRhs<N, Vec3<N>> for UnitQuat<N> {
impl<N: Num + Clone> Pnt3MulRhs<N, Pnt3<N>> for UnitQuat<N> { impl<N: Num + Clone> Pnt3MulRhs<N, Pnt3<N>> for UnitQuat<N> {
#[inline] #[inline]
fn binop(left: &Pnt3<N>, right: &UnitQuat<N>) -> Pnt3<N> { fn binop(left: &Pnt3<N>, right: &UnitQuat<N>) -> Pnt3<N> {
(left.as_vec() * *right).to_pnt() ::orig::<Pnt3<N>>() + *left.as_vec() * *right
} }
} }

View File

@ -686,6 +686,7 @@ macro_rules! transform_impl(
macro_rules! vec_as_pnt_impl( macro_rules! vec_as_pnt_impl(
($tv: ident, $t: ident, $comp0: ident $(,$compN: ident)*) => ( ($tv: ident, $t: ident, $comp0: ident $(,$compN: ident)*) => (
impl<N> $tv<N> { impl<N> $tv<N> {
#[deprecated = "use `na::orig() + this_vector` instead."]
#[inline] #[inline]
pub fn to_pnt(self) -> $t<N> { pub fn to_pnt(self) -> $t<N> {
$t::new( $t::new(
@ -694,6 +695,7 @@ macro_rules! vec_as_pnt_impl(
) )
} }
#[deprecated = "use `&(na::orig() + *this_vector)` instead."]
#[inline] #[inline]
pub fn as_pnt<'a>(&'a self) -> &'a $t<N> { pub fn as_pnt<'a>(&'a self) -> &'a $t<N> {
unsafe { unsafe {

View File

@ -146,6 +146,7 @@ pub trait IterableMut<N> {
* Vec related traits. * Vec related traits.
*/ */
/// Trait that relates a point of an affine space to a vector of the associated vector space. /// Trait that relates a point of an affine space to a vector of the associated vector space.
#[deprecated = "This will be removed in the future. Use point + vector operations instead."]
pub trait VecAsPnt<P> { pub trait VecAsPnt<P> {
/// Converts this point to its associated vector. /// Converts this point to its associated vector.
fn to_pnt(self) -> P; fn to_pnt(self) -> P;