Skip to main content
QAROS Rust API Dev (main) · versions: Dev (main) · Developer Guide

QarGuiPanelSize

Struct QarGuiPanelSize 

Source
#[repr(C)]
pub struct QarGuiPanelSize { pub width_meters: f32, pub height_meters: f32, pub content_scale: f32, }
Expand description

@brief The three frames every GUI panel API is expressed in.

Room space is the session’s shared tracking space: right-handed, metres, +Y up. Every QarPose in the GUI panel API - QarGuiPanelInit::pose, qar_gui_panels_update_pose(), qar_gui_panel_get_pose() - is given in it.

Panel space is the frame that pose defines. Its origin is the midpoint of the panel’s top edge - the top centre, not a corner - and its axes are right-handed, described here as a viewer facing the panel front sees them:

  • +X runs along the top edge to the viewer’s left,
  • +Y runs up,
  • -Z is the front-face normal and points at the viewer. The front normal is -Z, not +Z: left x up points away from the viewer, so a +Z viewer-facing normal would not be right-handed. The renderer agrees - the panel surface sits at its bounds’ minimum Z and the interaction volume grows along StereoKit’s vec3_forward, (0, 0, -1). The panel surface therefore covers x in [-width_meters/2, +width_meters/2] and y in [-height_meters, 0], hanging below its own pose.

Panel content space is the 2D pixel raster drawn onto that surface: the browser bitmap of a QAR_GUI_PANEL_CONTENT_TYPE_WEBSITE_URI panel, or the decoded video image of a QAR_GUI_PANEL_CONTENT_TYPE_STREAM_ID one. Its origin is the panel’s top-left corner as the viewer sees it, +X runs right and +Y runs down, and it is the frame QarGuiPanelPoint reports positions in. Panel content space runs backwards along both panel axes: content x = 0 sits at panel-space +width_meters/2 and content y = 0 at panel-space 0, the top edge, so content x advances along panel-space -X and content y along panel-space -Y. Panel content space is mapped onto panel space by QarGuiPanelSize::content_scale.

Fields§

§width_meters: f32

Extent of the panel surface along panel-space X, in metres.

§height_meters: f32

Extent of the panel surface along panel-space -Y, in metres. The surface hangs below the pose, which sits on its top edge.

§content_scale: f32

Panel-content-space-per-panel-space zoom of the rendered raster. 1.0 fits the content across the full panel surface, 2.0 shows it at twice the size so only half of it fits, and 0.5 shows it at half size. It changes how the content is drawn and how a contact maps back to content pixels; it does not change width_meters or height_meters.

A QAR_GUI_PANEL_CONTENT_TYPE_WEBSITE_URI panel takes it as the page’s zoom, as a desktop browser’s Ctrl+ and Ctrl- do: the page is drawn that much larger and reflowed to the panel’s width, so nothing is cut off at the sides. Only the application sets it; the panel’s + and - buttons resize the panel instead.

A QAR_GUI_PANEL_CONTENT_TYPE_STREAM_ID panel ignores it: its video is always drawn at the full panel width and scrolled vertically by the renderer when it is taller than the panel.

Trait Implementations§

Source§

impl Clone for QarGuiPanelSize

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for QarGuiPanelSize

Source§

impl Debug for QarGuiPanelSize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for QarGuiPanelSize

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for QarGuiPanelSize

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.