Struct 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) -> Self
pub const fn new(x: ViewDir, y: ViewDir, z: ViewDir) -> Self
Construct a new ViewCoordinates
from an array of ViewDir
s.
sourcepub fn from_up_and_handedness(up: SignedAxis3, handedness: Handedness) -> Self
pub fn from_up_and_handedness(up: SignedAxis3, handedness: Handedness) -> Self
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.
sourcepub fn up(&self) -> Option<SignedAxis3>
pub fn up(&self) -> Option<SignedAxis3>
The up-axis.
sourcepub fn right(&self) -> Option<SignedAxis3>
pub fn right(&self) -> Option<SignedAxis3>
The right-axis.
sourcepub fn forward(&self) -> Option<SignedAxis3>
pub fn forward(&self) -> Option<SignedAxis3>
The forward-axis.
sourcepub fn describe_short(&self) -> String
pub fn describe_short(&self) -> String
Describe using three letters, e.g. RDF
for X=Right, Y=Down, Z=Forward.
source§impl ViewCoordinates
impl ViewCoordinates
sourcepub const RIGHT_HAND_X_UP: Self = _
pub const RIGHT_HAND_X_UP: Self = _
X=Up, Y=Right, Z=Forward
sourcepub const RIGHT_HAND_X_DOWN: Self = _
pub const RIGHT_HAND_X_DOWN: Self = _
X=Down, Y=Right, Z=Back
sourcepub const RIGHT_HAND_Y_UP: Self = _
pub const RIGHT_HAND_Y_UP: Self = _
X=Right, Y=Up, Z=Back
sourcepub const RIGHT_HAND_Y_DOWN: Self = _
pub const RIGHT_HAND_Y_DOWN: Self = _
X=Right, Y=Down, Z=Forward
sourcepub const RIGHT_HAND_Z_UP: Self = _
pub const RIGHT_HAND_Z_UP: Self = _
X=Right, Y=Forward, Z=Up
sourcepub const RIGHT_HAND_Z_DOWN: Self = _
pub const RIGHT_HAND_Z_DOWN: Self = _
X=Right, Y=Back, Z=Down
sourcepub const LEFT_HAND_X_UP: Self = _
pub const LEFT_HAND_X_UP: Self = _
X=Up, Y=Right, Z=Back
sourcepub const LEFT_HAND_X_DOWN: Self = _
pub const LEFT_HAND_X_DOWN: Self = _
X=Down, Y=Right, Z=Forward
sourcepub const LEFT_HAND_Y_UP: Self = _
pub const LEFT_HAND_Y_UP: Self = _
X=Right, Y=Up, Z=Forward
sourcepub const LEFT_HAND_Y_DOWN: Self = _
pub const LEFT_HAND_Y_DOWN: Self = _
X=Right, Y=Down, Z=Back
sourcepub const LEFT_HAND_Z_UP: Self = _
pub const LEFT_HAND_Z_UP: Self = _
X=Right, Y=Back, Z=Up
sourcepub const LEFT_HAND_Z_DOWN: Self = _
pub const LEFT_HAND_Z_DOWN: Self = _
X=Right, Y=Forward, Z=Down
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 Debug for ViewCoordinates
impl Debug for ViewCoordinates
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 From<ViewCoordinates> for [u8; 3]
impl From<ViewCoordinates> for [u8; 3]
source§fn from(value: ViewCoordinates) -> Self
fn from(value: 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 Loggable for ViewCoordinates
impl Loggable for ViewCoordinates
type Name = ComponentName
source§fn name() -> Self::Name
fn name() -> Self::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, Self>>>>
) -> SerializationResult<Box<dyn Array>>where
Self: Clone + 'a,
fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>
) -> SerializationResult<Box<dyn Array>>where
Self: 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
) -> DeserializationResult<Vec<Option<Self>>>where
Self: Sized,
fn from_arrow_opt(
arrow_data: &dyn Array
) -> DeserializationResult<Vec<Option<Self>>>where
Self: Sized,
source§fn from_arrow(arrow_data: &dyn Array) -> DeserializationResult<Vec<Self>>where
Self: Sized,
fn from_arrow(arrow_data: &dyn Array) -> DeserializationResult<Vec<Self>>where
Self: 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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moresource§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.