Struct re_types::archetypes::ViewCoordinates
source · #[repr(transparent)]pub struct ViewCoordinates {
pub xyz: ViewCoordinates,
}
Expand description
Archetype: 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.
§Example
§View coordinates for adjusting the eye camera
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rec = rerun::RecordingStreamBuilder::new("rerun_example_view_coordinates").spawn()?;
rec.log_static("world", &rerun::ViewCoordinates::RIGHT_HAND_Z_UP)?; // Set an up-axis
rec.log(
"world/xyz",
&rerun::Arrows3D::from_vectors(
[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]], //
)
.with_colors([[255, 0, 0], [0, 255, 0], [0, 0, 255]]),
)?;
Ok(())
}
Fields§
§xyz: ViewCoordinates
The directions of the [x, y, z] axes.
Implementations§
source§impl ViewCoordinates
impl ViewCoordinates
sourcepub const NUM_COMPONENTS: usize = 2usize
pub const NUM_COMPONENTS: usize = 2usize
The total number of components in the archetype: 1 required, 1 recommended, 0 optional
source§impl ViewCoordinates
impl ViewCoordinates
sourcepub fn new(xyz: impl Into<ViewCoordinates>) -> Self
pub fn new(xyz: impl Into<ViewCoordinates>) -> Self
Create a new ViewCoordinates
.
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 Archetype for ViewCoordinates
impl Archetype for ViewCoordinates
§type Indicator = GenericIndicatorComponent<ViewCoordinates>
type Indicator = GenericIndicatorComponent<ViewCoordinates>
source§fn name() -> ArchetypeName
fn name() -> ArchetypeName
rerun.archetypes.Points2D
.source§fn indicator() -> MaybeOwnedComponentBatch<'static>
fn indicator() -> MaybeOwnedComponentBatch<'static>
source§fn required_components() -> Cow<'static, [ComponentName]>
fn required_components() -> Cow<'static, [ComponentName]>
source§fn recommended_components() -> Cow<'static, [ComponentName]>
fn recommended_components() -> Cow<'static, [ComponentName]>
source§fn optional_components() -> Cow<'static, [ComponentName]>
fn optional_components() -> Cow<'static, [ComponentName]>
source§fn all_components() -> Cow<'static, [ComponentName]>
fn all_components() -> Cow<'static, [ComponentName]>
source§fn from_arrow_components(
arrow_data: impl IntoIterator<Item = (ComponentName, Box<dyn Array>)>
) -> DeserializationResult<Self>
fn from_arrow_components( arrow_data: impl IntoIterator<Item = (ComponentName, Box<dyn Array>)> ) -> DeserializationResult<Self>
ComponentNames
, deserializes them
into this archetype. Read moresource§fn from_arrow(
data: impl IntoIterator<Item = (Field, Box<dyn Array>)>
) -> Result<Self, DeserializationError>where
Self: Sized,
fn from_arrow(
data: impl IntoIterator<Item = (Field, Box<dyn Array>)>
) -> Result<Self, DeserializationError>where
Self: Sized,
source§impl AsComponents for ViewCoordinates
impl AsComponents for ViewCoordinates
source§fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
ComponentBatch
s. Read moresource§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 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 more