pub struct Sim3 {
pub scale: f64,
pub rotation: Quat,
pub translation: Vec3,
}Expand description
Similarity transform new_from_old: X_new = s·R·X_old + t.
Fields§
§scale: f64Scale s.
rotation: QuatRotation R.
translation: Vec3Translation t.
Implementations§
Source§impl Sim3
impl Sim3
Sourcepub fn from_matrix(m: &Mat3x4) -> Self
pub fn from_matrix(m: &Mat3x4) -> Self
[sR | t] -> Sim3. s = norm of the first column, R = upper-left 3×3 / s.
Sourcepub fn transform_point(&self, p: &Vec3) -> Vec3
pub fn transform_point(&self, p: &Vec3) -> Vec3
X_new = s·R·X_old + t.
Sourcepub fn transform_pose(&self, world_to_cam: &Rigid3) -> Rigid3
pub fn transform_pose(&self, world_to_cam: &Rigid3) -> Rigid3
Applies to a pose (world_to_cam or world_to_rig): R’ = R Qᵀ, t’ = s t − R’ T.
Trait Implementations§
impl Copy for Sim3
impl StructuralPartialEq for Sim3
Auto Trait Implementations§
impl Freeze for Sim3
impl RefUnwindSafe for Sim3
impl Send for Sim3
impl Sync for Sim3
impl Unpin for Sim3
impl UnsafeUnpin for Sim3
impl UnwindSafe for Sim3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.