Struct rerun::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.
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 ULF: ViewCoordinates = _
pub const ULF: ViewCoordinates = _
X=Up, Y=Left, Z=Forward
sourcepub const UFL: ViewCoordinates = _
pub const UFL: ViewCoordinates = _
X=Up, Y=Forward, Z=Left
sourcepub const LUF: ViewCoordinates = _
pub const LUF: ViewCoordinates = _
X=Left, Y=Up, Z=Forward
sourcepub const LFU: ViewCoordinates = _
pub const LFU: ViewCoordinates = _
X=Left, Y=Forward, Z=Up
sourcepub const FUL: ViewCoordinates = _
pub const FUL: ViewCoordinates = _
X=Forward, Y=Up, Z=Left
sourcepub const FLU: ViewCoordinates = _
pub const FLU: ViewCoordinates = _
X=Forward, Y=Left, Z=Up
sourcepub const ULB: ViewCoordinates = _
pub const ULB: ViewCoordinates = _
X=Up, Y=Left, Z=Back
sourcepub const UBL: ViewCoordinates = _
pub const UBL: ViewCoordinates = _
X=Up, Y=Back, Z=Left
sourcepub const LUB: ViewCoordinates = _
pub const LUB: ViewCoordinates = _
X=Left, Y=Up, Z=Back
sourcepub const LBU: ViewCoordinates = _
pub const LBU: ViewCoordinates = _
X=Left, Y=Back, Z=Up
sourcepub const BUL: ViewCoordinates = _
pub const BUL: ViewCoordinates = _
X=Back, Y=Up, Z=Left
sourcepub const BLU: ViewCoordinates = _
pub const BLU: ViewCoordinates = _
X=Back, Y=Left, Z=Up
sourcepub const URF: ViewCoordinates = _
pub const URF: ViewCoordinates = _
X=Up, Y=Right, Z=Forward
sourcepub const UFR: ViewCoordinates = _
pub const UFR: ViewCoordinates = _
X=Up, Y=Forward, Z=Right
sourcepub const RUF: ViewCoordinates = _
pub const RUF: ViewCoordinates = _
X=Right, Y=Up, Z=Forward
sourcepub const RFU: ViewCoordinates = _
pub const RFU: ViewCoordinates = _
X=Right, Y=Forward, Z=Up
sourcepub const FUR: ViewCoordinates = _
pub const FUR: ViewCoordinates = _
X=Forward, Y=Up, Z=Right
sourcepub const FRU: ViewCoordinates = _
pub const FRU: ViewCoordinates = _
X=Forward, Y=Right, Z=Up
sourcepub const URB: ViewCoordinates = _
pub const URB: ViewCoordinates = _
X=Up, Y=Right, Z=Back
sourcepub const UBR: ViewCoordinates = _
pub const UBR: ViewCoordinates = _
X=Up, Y=Back, Z=Right
sourcepub const RUB: ViewCoordinates = _
pub const RUB: ViewCoordinates = _
X=Right, Y=Up, Z=Back
sourcepub const RBU: ViewCoordinates = _
pub const RBU: ViewCoordinates = _
X=Right, Y=Back, Z=Up
sourcepub const BUR: ViewCoordinates = _
pub const BUR: ViewCoordinates = _
X=Back, Y=Up, Z=Right
sourcepub const BRU: ViewCoordinates = _
pub const BRU: ViewCoordinates = _
X=Back, Y=Right, Z=Up
sourcepub const DLF: ViewCoordinates = _
pub const DLF: ViewCoordinates = _
X=Down, Y=Left, Z=Forward
sourcepub const DFL: ViewCoordinates = _
pub const DFL: ViewCoordinates = _
X=Down, Y=Forward, Z=Left
sourcepub const LDF: ViewCoordinates = _
pub const LDF: ViewCoordinates = _
X=Left, Y=Down, Z=Forward
sourcepub const LFD: ViewCoordinates = _
pub const LFD: ViewCoordinates = _
X=Left, Y=Forward, Z=Down
sourcepub const FDL: ViewCoordinates = _
pub const FDL: ViewCoordinates = _
X=Forward, Y=Down, Z=Left
sourcepub const FLD: ViewCoordinates = _
pub const FLD: ViewCoordinates = _
X=Forward, Y=Left, Z=Down
sourcepub const DLB: ViewCoordinates = _
pub const DLB: ViewCoordinates = _
X=Down, Y=Left, Z=Back
sourcepub const DBL: ViewCoordinates = _
pub const DBL: ViewCoordinates = _
X=Down, Y=Back, Z=Left
sourcepub const LDB: ViewCoordinates = _
pub const LDB: ViewCoordinates = _
X=Left, Y=Down, Z=Back
sourcepub const LBD: ViewCoordinates = _
pub const LBD: ViewCoordinates = _
X=Left, Y=Back, Z=Down
sourcepub const BDL: ViewCoordinates = _
pub const BDL: ViewCoordinates = _
X=Back, Y=Down, Z=Left
sourcepub const BLD: ViewCoordinates = _
pub const BLD: ViewCoordinates = _
X=Back, Y=Left, Z=Down
sourcepub const DRF: ViewCoordinates = _
pub const DRF: ViewCoordinates = _
X=Down, Y=Right, Z=Forward
sourcepub const DFR: ViewCoordinates = _
pub const DFR: ViewCoordinates = _
X=Down, Y=Forward, Z=Right
sourcepub const RDF: ViewCoordinates = _
pub const RDF: ViewCoordinates = _
X=Right, Y=Down, Z=Forward
sourcepub const RFD: ViewCoordinates = _
pub const RFD: ViewCoordinates = _
X=Right, Y=Forward, Z=Down
sourcepub const FDR: ViewCoordinates = _
pub const FDR: ViewCoordinates = _
X=Forward, Y=Down, Z=Right
sourcepub const FRD: ViewCoordinates = _
pub const FRD: ViewCoordinates = _
X=Forward, Y=Right, Z=Down
sourcepub const DRB: ViewCoordinates = _
pub const DRB: ViewCoordinates = _
X=Down, Y=Right, Z=Back
sourcepub const DBR: ViewCoordinates = _
pub const DBR: ViewCoordinates = _
X=Down, Y=Back, Z=Right
sourcepub const RDB: ViewCoordinates = _
pub const RDB: ViewCoordinates = _
X=Right, Y=Down, Z=Back
sourcepub const RBD: ViewCoordinates = _
pub const RBD: ViewCoordinates = _
X=Right, Y=Back, Z=Down
sourcepub const BDR: ViewCoordinates = _
pub const BDR: ViewCoordinates = _
X=Back, Y=Down, Z=Right
sourcepub const BRD: ViewCoordinates = _
pub const BRD: ViewCoordinates = _
X=Back, Y=Right, Z=Down
sourcepub const RIGHT_HAND_X_UP: ViewCoordinates = _
pub const RIGHT_HAND_X_UP: ViewCoordinates = _
X=Up, Y=Right, Z=Forward
sourcepub const RIGHT_HAND_X_DOWN: ViewCoordinates = _
pub const RIGHT_HAND_X_DOWN: ViewCoordinates = _
X=Down, Y=Right, Z=Back
sourcepub const RIGHT_HAND_Y_UP: ViewCoordinates = _
pub const RIGHT_HAND_Y_UP: ViewCoordinates = _
X=Right, Y=Up, Z=Back
sourcepub const RIGHT_HAND_Y_DOWN: ViewCoordinates = _
pub const RIGHT_HAND_Y_DOWN: ViewCoordinates = _
X=Right, Y=Down, Z=Forward
sourcepub const RIGHT_HAND_Z_UP: ViewCoordinates = _
pub const RIGHT_HAND_Z_UP: ViewCoordinates = _
X=Right, Y=Forward, Z=Up
sourcepub const RIGHT_HAND_Z_DOWN: ViewCoordinates = _
pub const RIGHT_HAND_Z_DOWN: ViewCoordinates = _
X=Right, Y=Back, Z=Down
sourcepub const LEFT_HAND_X_UP: ViewCoordinates = _
pub const LEFT_HAND_X_UP: ViewCoordinates = _
X=Up, Y=Right, Z=Back
sourcepub const LEFT_HAND_X_DOWN: ViewCoordinates = _
pub const LEFT_HAND_X_DOWN: ViewCoordinates = _
X=Down, Y=Right, Z=Forward
sourcepub const LEFT_HAND_Y_UP: ViewCoordinates = _
pub const LEFT_HAND_Y_UP: ViewCoordinates = _
X=Right, Y=Up, Z=Forward
sourcepub const LEFT_HAND_Y_DOWN: ViewCoordinates = _
pub const LEFT_HAND_Y_DOWN: ViewCoordinates = _
X=Right, Y=Down, Z=Back
sourcepub const LEFT_HAND_Z_UP: ViewCoordinates = _
pub const LEFT_HAND_Z_UP: ViewCoordinates = _
X=Right, Y=Back, Z=Up
sourcepub const LEFT_HAND_Z_DOWN: ViewCoordinates = _
pub const LEFT_HAND_Z_DOWN: ViewCoordinates = _
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 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<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<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.