pub struct ViewCoordinates(pub [ViewDir; 3]);
Expand description
How we interpret the coordinate system of an entity/space.
For instance: What is “up”? What does the Z axis mean? Is this right-handed or left-handed?
For 3D view-space and image-space.
use re_components::ViewCoordinates;
use arrow2_convert::field::ArrowField;
use arrow2::datatypes::{DataType, Field};
assert_eq!(
ViewCoordinates::data_type(),
DataType::FixedSizeBinary(3)
);
Tuple Fields§
§0: [ViewDir; 3]
Implementations§
Source§impl ViewCoordinates
impl ViewCoordinates
Sourcepub const RDF: Self
pub const RDF: Self
Default right-handed pinhole, camera, and image coordinates: X=Right, Y=Down, Z=Forward.
Sourcepub const RUB: Self
pub const RUB: Self
Default right-handed view coordinates of re_renderer
: X=Right, Y=Up, Z=Back.
Sourcepub fn from_up_and_handedness(up: SignedAxis3, handedness: Handedness) -> Self
pub fn from_up_and_handedness(up: SignedAxis3, handedness: Handedness) -> Self
Choses a coordinate system based on just an up-axis.
Sourcepub fn sanity_check(&self) -> Result<(), String>
pub fn sanity_check(&self) -> Result<(), String>
Returns an error if this does not span all three dimensions.
pub fn up(&self) -> Option<SignedAxis3>
pub fn right(&self) -> Option<SignedAxis3>
pub fn forward(&self) -> Option<SignedAxis3>
pub fn describe_short(&self) -> String
pub fn describe(&self) -> String
Sourcepub fn from_other(&self, other: &Self) -> Mat3
pub fn from_other(&self, other: &Self) -> Mat3
Returns a matrix that transforms from another coordinate system to this (self) one.
Sourcepub fn to_rdf(&self) -> Mat3
pub fn to_rdf(&self) -> Mat3
Returns a matrix that transforms this coordinate system to RDF.
(RDF: X=Right, Y=Down, Z=Forward)
Sourcepub fn from_rdf(&self) -> Mat3
pub fn from_rdf(&self) -> Mat3
Returns a matrix that transforms from RDF to this coordinate system.
(RDF: X=Right, Y=Down, Z=Forward)
Sourcepub fn to_rub(&self) -> Mat3
pub fn to_rub(&self) -> Mat3
Returns a matrix that transforms this coordinate system to RUB.
(RUB: X=Right, Y=Up, Z=Back)
Sourcepub fn from_rub(&self) -> Mat3
pub fn from_rub(&self) -> Mat3
Returns a matrix that transforms from RUB to this coordinate system.
(RUB: X=Right, Y=Up, Z=Back)
Sourcepub fn from_rub_quat(&self) -> Result<Quat, String>
pub fn from_rub_quat(&self) -> Result<Quat, String>
Returns a quaternion that rotates from RUB to this coordinate system.
Errors if the coordinate system is left-handed or degenerate.
(RUB: X=Right, Y=Up, Z=Back)
pub fn handedness(&self) -> Option<Handedness>
Trait Implementations§
Source§impl ArrowDeserialize for ViewCoordinates
impl ArrowDeserialize for ViewCoordinates
Source§type ArrayType = <FixedSizeBinary<3> as ArrowDeserialize>::ArrayType
type ArrayType = <FixedSizeBinary<3> as ArrowDeserialize>::ArrayType
arrow2::Array
type corresponding to this fieldSource§fn arrow_deserialize(
bytes: <&Self::ArrayType as IntoIterator>::Item,
) -> Option<<Self as ArrowField>::Type>
fn arrow_deserialize( bytes: <&Self::ArrayType as IntoIterator>::Item, ) -> Option<<Self as ArrowField>::Type>
Source§impl ArrowField for ViewCoordinates
impl ArrowField for ViewCoordinates
Source§impl ArrowSerialize for ViewCoordinates
impl ArrowSerialize for ViewCoordinates
Source§type MutableArrayType = <FixedSizeBinary<3> as ArrowSerialize>::MutableArrayType
type MutableArrayType = <FixedSizeBinary<3> as ArrowSerialize>::MutableArrayType
arrow2::array::MutableArray
that holds this valueSource§fn new_array() -> Self::MutableArrayType
fn new_array() -> Self::MutableArrayType
Source§fn arrow_serialize(v: &Self, array: &mut Self::MutableArrayType) -> Result<()>
fn arrow_serialize(v: &Self, array: &mut Self::MutableArrayType) -> Result<()>
Source§impl Clone for ViewCoordinates
impl Clone for ViewCoordinates
Source§fn clone(&self) -> ViewCoordinates
fn clone(&self) -> ViewCoordinates
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ViewCoordinates
impl Debug for ViewCoordinates
Source§impl<'de> Deserialize<'de> for ViewCoordinates
impl<'de> Deserialize<'de> for ViewCoordinates
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> From<&'a ViewCoordinates> for Cow<'a, ViewCoordinates>
impl<'a> From<&'a ViewCoordinates> for Cow<'a, ViewCoordinates>
Source§fn from(value: &'a ViewCoordinates) -> Self
fn from(value: &'a ViewCoordinates) -> Self
Source§impl<'a> From<ViewCoordinates> for Cow<'a, ViewCoordinates>
impl<'a> From<ViewCoordinates> for Cow<'a, ViewCoordinates>
Source§fn from(value: ViewCoordinates) -> Self
fn from(value: ViewCoordinates) -> Self
Source§impl FromStr for ViewCoordinates
impl FromStr for ViewCoordinates
Source§impl LegacyComponent for ViewCoordinates
impl LegacyComponent for ViewCoordinates
Source§fn legacy_name() -> ComponentName
fn legacy_name() -> ComponentName
Source§impl Loggable for ViewCoordinates
impl Loggable for ViewCoordinates
type Name = ComponentName
type Item<'a> = <&'a <ViewCoordinates as ArrowDeserialize>::ArrayType as IntoIterator>::Item
type Iter<'a> = <&'a <ViewCoordinates as ArrowDeserialize>::ArrayType as IntoIterator>::IntoIter
Source§fn name() -> Self::Name
fn name() -> Self::Name
rerun.datatypes.Vec2D
.Source§fn to_arrow_datatype() -> DataType
fn to_arrow_datatype() -> DataType
arrow2::datatypes::DataType
.Source§fn try_to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
_extension_wrapper: Option<&str>,
) -> SerializationResult<Box<dyn Array>>where
Self: Clone + 'a,
fn try_to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
_extension_wrapper: Option<&str>,
) -> SerializationResult<Box<dyn Array>>where
Self: Clone + 'a,
Loggable
, serializes them into an Arrow array.
The Arrow array’s datatype will match Loggable::to_arrow_datatype
. Read moreSource§fn try_iter_from_arrow(
data: &dyn Array,
) -> DeserializationResult<Self::Iter<'_>>where
Self: Sized,
fn try_iter_from_arrow(
data: &dyn Array,
) -> DeserializationResult<Self::Iter<'_>>where
Self: Sized,
Loggable::Item
s. Read moreSource§fn convert_item_to_self(item: Self::Item<'_>) -> Option<Self>
fn convert_item_to_self(item: Self::Item<'_>) -> Option<Self>
Source§fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
extension_wrapper: Option<&str>,
) -> Box<dyn Array>where
Self: Clone + 'a,
fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
extension_wrapper: Option<&str>,
) -> Box<dyn Array>where
Self: Clone + 'a,
Loggable
, serializes
them into an Arrow array.
The Arrow array’s datatype will match Loggable::to_arrow_datatype
. Read moreSource§fn try_to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
extension_wrapper: Option<&str>,
) -> Result<Box<dyn Array>, SerializationError>where
Self: Clone + 'a,
fn try_to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
extension_wrapper: Option<&str>,
) -> Result<Box<dyn Array>, SerializationError>where
Self: Clone + 'a,
Loggable
, serializes
them into an Arrow array.
The Arrow array’s datatype will match Loggable::to_arrow_datatype
. Read moreSource§fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
extension_wrapper: Option<&str>,
) -> Box<dyn Array>where
Self: Clone + 'a,
fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
extension_wrapper: Option<&str>,
) -> Box<dyn Array>where
Self: Clone + 'a,
Loggable
, serializes them into an Arrow array.
The Arrow array’s datatype will match Loggable::to_arrow_datatype
. Read moreSource§fn from_arrow(data: &(dyn Array + 'static)) -> Vec<Self>
fn from_arrow(data: &(dyn Array + 'static)) -> Vec<Self>
Source§fn try_from_arrow(
data: &(dyn Array + 'static),
) -> Result<Vec<Self>, DeserializationError>
fn try_from_arrow( data: &(dyn Array + 'static), ) -> Result<Vec<Self>, DeserializationError>
Source§fn try_from_arrow_opt(
data: &(dyn Array + 'static),
) -> Result<Vec<Option<Self>>, DeserializationError>
fn try_from_arrow_opt( data: &(dyn Array + 'static), ) -> Result<Vec<Option<Self>>, DeserializationError>
Source§impl PartialEq for ViewCoordinates
impl PartialEq for ViewCoordinates
Source§impl Serialize for ViewCoordinates
impl Serialize for ViewCoordinates
impl Component for ViewCoordinates
impl Copy for ViewCoordinates
impl Eq for ViewCoordinates
impl StructuralPartialEq for ViewCoordinates
Auto Trait Implementations§
impl Freeze for ViewCoordinates
impl RefUnwindSafe for ViewCoordinates
impl Send for ViewCoordinates
impl Sync for ViewCoordinates
impl Unpin for ViewCoordinates
impl UnwindSafe for ViewCoordinates
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more