Struct rerun::external::re_types::components::ViewCoordinates
source · #[repr(transparent)]pub struct ViewCoordinates(pub [u8; 3]);
Expand description
Component: 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?
The three coordinates are always ordered as [x, y, z].
For example [Right, Down, Forward] means that the X axis points to the right, the Y axis points down, and the Z axis points forward.
The following constants are used to represent the different directions:
- Up = 1
- Down = 2
- Right = 3
- Left = 4
- Forward = 5
- Back = 6
Tuple Fields§
§0: [u8; 3]
The directions of the [x, y, z] axes.
Implementations§
source§impl ViewCoordinates
impl ViewCoordinates
sourcepub const fn new(x: ViewDir, y: ViewDir, z: ViewDir) -> ViewCoordinates
pub const fn new(x: ViewDir, y: ViewDir, z: ViewDir) -> ViewCoordinates
Construct a new ViewCoordinates
from an array of ViewDir
s.
sourcepub fn from_up_and_handedness(
up: SignedAxis3,
handedness: Handedness
) -> ViewCoordinates
pub fn from_up_and_handedness( up: SignedAxis3, handedness: Handedness ) -> ViewCoordinates
Chooses 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: &ViewCoordinates) -> Mat3
pub fn from_other(&self, other: &ViewCoordinates) -> 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) -> Result<Handedness, String>
source§impl ViewCoordinates
impl ViewCoordinates
pub const ULF: ViewCoordinates = _
pub const UFL: ViewCoordinates = _
pub const LUF: ViewCoordinates = _
pub const LFU: ViewCoordinates = _
pub const FUL: ViewCoordinates = _
pub const FLU: ViewCoordinates = _
pub const ULB: ViewCoordinates = _
pub const UBL: ViewCoordinates = _
pub const LUB: ViewCoordinates = _
pub const LBU: ViewCoordinates = _
pub const BUL: ViewCoordinates = _
pub const BLU: ViewCoordinates = _
pub const URF: ViewCoordinates = _
pub const UFR: ViewCoordinates = _
pub const RUF: ViewCoordinates = _
pub const RFU: ViewCoordinates = _
pub const FUR: ViewCoordinates = _
pub const FRU: ViewCoordinates = _
pub const URB: ViewCoordinates = _
pub const UBR: ViewCoordinates = _
pub const RUB: ViewCoordinates = _
pub const RBU: ViewCoordinates = _
pub const BUR: ViewCoordinates = _
pub const BRU: ViewCoordinates = _
pub const DLF: ViewCoordinates = _
pub const DFL: ViewCoordinates = _
pub const LDF: ViewCoordinates = _
pub const LFD: ViewCoordinates = _
pub const FDL: ViewCoordinates = _
pub const FLD: ViewCoordinates = _
pub const DLB: ViewCoordinates = _
pub const DBL: ViewCoordinates = _
pub const LDB: ViewCoordinates = _
pub const LBD: ViewCoordinates = _
pub const BDL: ViewCoordinates = _
pub const BLD: ViewCoordinates = _
pub const DRF: ViewCoordinates = _
pub const DFR: ViewCoordinates = _
pub const RDF: ViewCoordinates = _
pub const RFD: ViewCoordinates = _
pub const FDR: ViewCoordinates = _
pub const FRD: ViewCoordinates = _
pub const DRB: ViewCoordinates = _
pub const DBR: ViewCoordinates = _
pub const RDB: ViewCoordinates = _
pub const RBD: ViewCoordinates = _
pub const BDR: ViewCoordinates = _
pub const BRD: ViewCoordinates = _
pub const RIGHT_HAND_X_UP: ViewCoordinates = _
pub const RIGHT_HAND_X_DOWN: ViewCoordinates = _
pub const RIGHT_HAND_Y_UP: ViewCoordinates = _
pub const RIGHT_HAND_Y_DOWN: ViewCoordinates = _
pub const RIGHT_HAND_Z_UP: ViewCoordinates = _
pub const RIGHT_HAND_Z_DOWN: ViewCoordinates = _
pub const LEFT_HAND_X_UP: ViewCoordinates = _
pub const LEFT_HAND_X_DOWN: ViewCoordinates = _
pub const LEFT_HAND_Y_UP: ViewCoordinates = _
pub const LEFT_HAND_Y_DOWN: ViewCoordinates = _
pub const LEFT_HAND_Z_UP: ViewCoordinates = _
pub const LEFT_HAND_Z_DOWN: ViewCoordinates = _
Trait Implementations§
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 DataUi for ViewCoordinates
impl DataUi for ViewCoordinates
source§fn data_ui(
&self,
_ctx: &ViewerContext<'_>,
ui: &mut Ui,
verbosity: UiVerbosity,
_query: &LatestAtQuery,
_store: &DataStore
)
fn data_ui( &self, _ctx: &ViewerContext<'_>, ui: &mut Ui, verbosity: UiVerbosity, _query: &LatestAtQuery, _store: &DataStore )
source§impl Debug for ViewCoordinates
impl Debug for ViewCoordinates
source§impl FromStr for ViewCoordinates
impl FromStr for ViewCoordinates
source§impl Loggable for ViewCoordinates
impl Loggable for ViewCoordinates
type Name = ComponentName
source§fn name() -> <ViewCoordinates as Loggable>::Name
fn name() -> <ViewCoordinates as Loggable>::Name
rerun.datatypes.Vec2D
.source§fn arrow_datatype() -> DataType
fn arrow_datatype() -> DataType
arrow2::datatypes::DataType
, excluding datatype extensions.source§fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, ViewCoordinates>>>>
) -> Result<Box<dyn Array>, SerializationError>where
ViewCoordinates: Clone + 'a,
fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, ViewCoordinates>>>>
) -> Result<Box<dyn Array>, SerializationError>where
ViewCoordinates: Clone + 'a,
Loggable
, serializes them into an Arrow array.
The Arrow array’s datatype will match Loggable::arrow_field
. Read moresource§fn from_arrow_opt(
arrow_data: &(dyn Array + 'static)
) -> Result<Vec<Option<ViewCoordinates>>, DeserializationError>where
ViewCoordinates: Sized,
fn from_arrow_opt(
arrow_data: &(dyn Array + 'static)
) -> Result<Vec<Option<ViewCoordinates>>, DeserializationError>where
ViewCoordinates: Sized,
source§fn from_arrow(
arrow_data: &(dyn Array + 'static)
) -> Result<Vec<ViewCoordinates>, DeserializationError>where
ViewCoordinates: Sized,
fn from_arrow(
arrow_data: &(dyn Array + 'static)
) -> Result<Vec<ViewCoordinates>, DeserializationError>where
ViewCoordinates: Sized,
source§fn extended_arrow_datatype() -> DataType
fn extended_arrow_datatype() -> DataType
arrow2::datatypes::DataType
, including datatype extensions. Read moresource§fn arrow_field() -> Field
fn arrow_field() -> Field
arrow2::datatypes::Field
, including datatype extensions. Read moresource§fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> Result<Box<dyn Array>, SerializationError>where
Self: 'a,
fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> Result<Box<dyn Array>, SerializationError>where
Self: 'a,
Loggable
, serializes
them into an Arrow array.
The Arrow array’s datatype will match Loggable::arrow_field
. Read moresource§impl PartialEq for ViewCoordinates
impl PartialEq 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 ==
.source§impl SizeBytes for ViewCoordinates
impl SizeBytes for ViewCoordinates
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self
on the heap, in bytes.source§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self
in bytes, accounting for both stack and heap space.source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self
on the stack, in bytes. Read moreimpl Copy for ViewCoordinates
impl Eq for ViewCoordinates
impl Pod 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<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> EntityDataUi for Twhere
T: DataUi,
impl<T> EntityDataUi for Twhere
T: DataUi,
source§fn entity_data_ui(
&self,
ctx: &ViewerContext<'_>,
ui: &mut Ui,
verbosity: UiVerbosity,
entity: &EntityPath,
query: &LatestAtQuery,
store: &DataStore
)
fn entity_data_ui( &self, ctx: &ViewerContext<'_>, ui: &mut Ui, verbosity: UiVerbosity, entity: &EntityPath, query: &LatestAtQuery, store: &DataStore )
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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<L> LoggableBatch for L
impl<L> LoggableBatch for L
type Name = <L as Loggable>::Name
source§fn name(&self) -> <L as LoggableBatch>::Name
fn name(&self) -> <L as LoggableBatch>::Name
rerun.datatypes.Vec2D
.source§fn num_instances(&self) -> usize
fn num_instances(&self) -> usize
source§fn arrow_field(&self) -> Field
fn arrow_field(&self) -> Field
arrow2::datatypes::Field
, including datatype extensions.