Skip to main content

Overlay

Struct Overlay 

Source
pub struct Overlay(/* private fields */);

Implementations§

Source§

impl Overlay

Source

pub fn create_overlay( &mut self, key: &str, friendly_name: &str, ) -> Result<OverlayHandle, VROverlayError>

Source

pub fn set_visibility( &mut self, overlay: OverlayHandle, is_visible: bool, ) -> Result<(), VROverlayError>

Source

pub fn is_visible(&mut self, overlay: OverlayHandle) -> bool

Source

pub fn set_curvature( &mut self, overlay: OverlayHandle, curvature: f32, ) -> Result<(), VROverlayError>

Set the curvature of the overlay, with 0 being a quad and 1 being a cylinder.

§Panics

Panics if curvature is not in [0,1]

Source

pub fn curvature( &mut self, overlay: OverlayHandle, ) -> Result<f32, VROverlayError>

Source

pub fn set_opacity( &mut self, overlay: OverlayHandle, alpha: f32, ) -> Result<(), VROverlayError>

Sets the opacity of the overlay. alpha ranges from 0.0 (transparent) to 1.0 (opaque).

§Panics

Panics if alpha is not in [0,1]

Source

pub fn opacity(&mut self, overlay: OverlayHandle) -> Result<f32, VROverlayError>

Source

pub fn width(&mut self, overlay: OverlayHandle) -> Result<f32, VROverlayError>

Source

pub fn set_width( &mut self, overlay: OverlayHandle, width_in_meters: f32, ) -> Result<(), VROverlayError>

Source

pub fn sort_order( &mut self, overlay: OverlayHandle, ) -> Result<u32, VROverlayError>

Source

pub fn set_sort_order( &mut self, overlay: OverlayHandle, sort_order: u32, ) -> Result<(), VROverlayError>

Source

pub fn tint( &mut self, overlay: OverlayHandle, ) -> Result<ColorTint, VROverlayError>

Source

pub fn set_tint( &mut self, overlay: OverlayHandle, tint: ColorTint, ) -> Result<(), VROverlayError>

Source

pub fn set_image( &mut self, overlay: OverlayHandle, img_path: &CStr, ) -> Result<(), VROverlayError>

Source

pub fn set_raw_data( &mut self, overlay: OverlayHandle, data: &[u8], width: usize, height: usize, bytes_per_pixel: usize, ) -> Result<(), VROverlayError>

Source

pub fn texel_aspect( &mut self, overlay: OverlayHandle, ) -> Result<f32, VROverlayError>

Get aspect ratio, with aspect expressed as width / height.

Source

pub fn set_texel_aspect( &mut self, overlay: OverlayHandle, aspect: f32, ) -> Result<(), VROverlayError>

Set aspect ratio, with aspect expressed as width / height.

Note that too extreme of an aspect ratio will cause an error to be returned.

Source

pub fn set_transform_absolute( &mut self, overlay: OverlayHandle, origin: TrackingUniverseOrigin, origin_to_overlay: &Matrix3x4, ) -> Result<(), VROverlayError>

Sets an absolute transform for this overlay.

Wraps c++ SetOverlayTransformAbsolute.

Source

pub fn get_transform_absolute( &mut self, overlay: OverlayHandle, origin_to_overlay: &mut Matrix3x4, ) -> Result<TrackingUniverseOrigin, VROverlayError>

Gets the absolute transform for this overlay.

Wraps c++ GetOverlayTransformAbsolute.

Source

pub fn set_transform_tracked_device_relative( &mut self, overlay: OverlayHandle, index: TrackedDeviceIndex, device_to_overlay: &Matrix3x4, ) -> Result<(), VROverlayError>

Sets the transform for this overlay, relative to a tracked device.

Wraps c++ SetOverlayTransformTrackedDeviceRelative.

Source

pub fn get_transform_tracked_device_relative( &mut self, overlay: OverlayHandle, device_to_overlay: &mut Matrix3x4, ) -> Result<TrackedDeviceIndex, VROverlayError>

Gets the transform for this overlay, relative to a tracked device.

Wraps c++ GetOverlayTransformTrackedDeviceRelative.

Source

pub fn set_texture_bounds( &mut self, overlay: OverlayHandle, bounds: &TextureBounds, ) -> Result<(), VROverlayError>

Source

pub fn is_dashboard_visible(&mut self) -> bool

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.