Struct re_components::coordinates::ViewCoordinates
source · 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
§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
§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, Global>where
Self: Clone + 'a,
fn to_arrow<'a>( data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>, extension_wrapper: Option<&str> ) -> Box<dyn Array, Global>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, Global>, 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, Global>, 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, Global>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, Global>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_from_arrow(
data: &(dyn Array + 'static)
) -> Result<Vec<Self, Global>, DeserializationError>
fn try_from_arrow( data: &(dyn Array + 'static) ) -> Result<Vec<Self, Global>, DeserializationError>
source§impl PartialEq<ViewCoordinates> for ViewCoordinates
impl PartialEq<ViewCoordinates> for ViewCoordinates
source§fn eq(&self, other: &ViewCoordinates) -> bool
fn eq(&self, other: &ViewCoordinates) -> bool
self
and other
values to be equal, and is used
by ==
.