[−][src]Struct openvr::RenderModels
Methods
impl RenderModels
[src]
pub fn load_render_model(&self, name: &CStr) -> Result<Option<Model>>
[src]
Loads and returns a render model for use in the application. name
should be a render model name from the
RenderModelName_String
property or an absolute path name to a render model on disk.
The method returns Ok(None)
while the render model is still being loaded. Call it at regular intervals until
it returns Ok(Some(model))
.
pub fn component_count(&self, model: &CStr) -> u32
[src]
Returns the number of components of the specified render model.
Components are useful when client application wish to draw, label, or otherwise interact with components of tracked objects. Examples controller components: renderable things such as triggers, buttons non-renderable things which include coordinate systems such as 'tip', 'base', a neutral controller agnostic hand-pose If all controller components are enumerated and rendered, it will be equivalent to drawing the traditional render model Returns 0 if components not supported, >0 otherwise
pub fn component_name(&self, model: &CStr, component: u32) -> Option<CString>
[src]
Get the names of available components.
component
does not correlate to a tracked device index, but is only used for iterating over all available
components. If it's out of range, this function will return None.
pub fn component_names(&self, model: &CStr) -> IntoIter<CString>
[src]
Gets all component names of a given model
pub fn component_render_model_name(
&self,
model: &CStr,
component: &CStr
) -> Option<CString>
[src]
&self,
model: &CStr,
component: &CStr
) -> Option<CString>
Use this to get the render model name for the specified rendermodel/component combination, to be passed to
load_render_model
.
If the component name is out of range, this function will return None. Otherwise, it will return the size of the buffer required for the name.
pub fn component_state(
&self,
model: &CStr,
component: &CStr,
state: &ControllerState,
mode: &ControllerMode
) -> Option<ComponentState>
[src]
&self,
model: &CStr,
component: &CStr,
state: &ControllerState,
mode: &ControllerMode
) -> Option<ComponentState>
Use this to query information about the component, as a function of the controller state.
Returns None if the component is invalid.
Check ComponentState::is_visible()
to determine whether the returned component should be rendered.
For dynamic controller components (ex: trigger) values will reflect component motions.
For static components this will return a consistent value independent of the ControllerState
.
pub fn load_texture(&self, id: TextureId) -> Result<Option<Texture>>
[src]
Loads and returns a texture for use in the application. Texture IDs can be obtained from
Model::diffuse_texture_id()
.
The method returns Ok(None)
while the texture is still being loaded. Call it at regular intervals until it
returns Ok(Some(texture))
.
Auto Trait Implementations
impl RefUnwindSafe for RenderModels
impl Send for RenderModels
impl Sync for RenderModels
impl Unpin for RenderModels
impl UnwindSafe for RenderModels
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,