Module system

Source
Expand description

Sprite specific structs, enums and functions.

§Examples

which are also unit tests:

Assets Assets block for priority Hierarchy Hierarchy ray Hand Controller Lines Microphone Renderer Screenshots capture TextStyle Text

Re-exports§

pub use crate::interactor::DefaultInteractors;
pub use crate::interactor::Interaction;
pub use crate::interactor::Interactor;
pub use crate::interactor::InteractorActivation;
pub use crate::interactor::InteractorEvent;
pub use crate::interactor::InteractorType;

Structs§

Align
A bit-flag enum for describing alignment or positioning. Items can be combined using the ‘|’ operator, like so: let alignment = Align::YTop | Align::XLeft;. Avoid combining multiple items of the same axis. There are also a complete list of valid bit flag combinations! These are the values without an axis listed in their names, ‘TopLeft’, ‘BottomCenter’, etc. https://stereokit.net/Pages/StereoKit/Align.html
AssetIter
Iterator on Assets producing some Asset
Assets
If you want to manage loading assets, this is the class for you! https://stereokit.net/Pages/StereoKit/Assets.html
Backend
This class exposes some of StereoKit’s backend functionality. This allows for tighter integration with certain platforms, but also means your code becomes less portable. Everything in this class should be guarded by availability checks.
BackendAndroid
This class contains variables that may be useful for interop with the Android operating system, or other Android libraries.
BackendD3D11
When using Direct3D11 for rendering, this contains a number of variables that may be useful for doing advanced rendering tasks. This is the default rendering backend on Windows. https://stereokit.net/Pages/StereoKit/Backend.D3D11.html
BackendOpenGLESEGL
When using OpenGL ES with the EGL loader for rendering, this contains a number of variables that may be useful for doing advanced rendering tasks. This is the default rendering backend for Android, and Linux builds can be configured to use this with the SK_LINUX_EGL cmake option when building the core StereoKitC library. https://stereokit.net/Pages/StereoKit/Backend.OpenGLES_EGL.html
BackendOpenGLWGL
When using OpenGL with the WGL loader for rendering, this contains a number of variables that may be useful for doing advanced rendering tasks. This is Windows only, and requires gloabally defining SKG_FORCE_OPENGL when building the core StereoKitC library. https://stereokit.net/Pages/StereoKit/Backend.OpenGL_WGL.html
BackendOpenXR
This class is NOT of general interest, unless you are trying to add support for some unusual OpenXR extension! StereoKit should do all the OpenXR work that most people will need. If you find yourself here anyhow for something you feel StereoKit should support already, please add a feature request on GitHub!
BtnState
A bit-flag for the current state of a button input. https://stereokit.net/Pages/StereoKit/BtnState.html
Controller
This represents a physical controller input device! Tracking information, buttons, analog sticks and triggers! There’s also a Menu button that’s tracked separately at Input.ContollerMenu. https://stereokit.net/Pages/StereoKit/Controller.html
Hand
Information about a hand! https://stereokit.net/Pages/StereoKit/Hand.html
HandJoint
Contains information to represents a joint on the hand. https://stereokit.net/Pages/StereoKit/HandJoint.html
Hierarchy
This class represents a stack of transform matrices that build up a transform hierarchy! This can be used like an object-less parent-child system, where you push a parent’s transform onto the stack, render child objects relative to that parent transform and then pop it off the stack.
Input
Input from the system come from this class! Hands, eyes, heads, mice and pointers! https://stereokit.net/Pages/StereoKit/Input.html
InputSource
What type of device is the source of the pointer? This is a bit-flag that can contain some input source family information. https://stereokit.net/Pages/StereoKit/InputSource.html
LinePoint
Used to represent lines for the line drawing functions! This is just a snapshot of information about each individual point on a line. https://stereokit.net/Pages/StereoKit/LinePoint.html
Lines
A line drawing class! This is an easy way to visualize lines or relationships between objects. The current implementation uses a quad strip that always faces the user, via vertex shader manipulation. https://stereokit.net/Pages/StereoKit/Lines.html
Log
A class for logging errors, warnings and information! Different levels of information can be filtered out, and supports coloration via <~colorCode> and <~clr> tags.
LogItem
Non canonical structure used for subscribed callback
Microphone
This class provides access to the hardware’s microphone, and stores it in a Sound stream. Start and Stop recording, and check the Sound property for the results! Remember to ensure your application has microphone permissions enabled! https://stereokit.net/Pages/StereoKit/Microphone.html
Mouse
This stores information about the mouse! What’s its state, where’s it pointed, do we even have one? https://stereokit.net/Pages/StereoKit/Mouse.html
Pivot
A bit-flag enum for describing alignment or positioning. Items can be combined using the ‘|’ operator, like so: let alignment = Pivot::YTop | Pivot::XLeft;. Avoid combining multiple items of the same axis. There are also a complete list of valid bit flag combinations! These are the values without an axis listed in their names, ‘TopLeft’, ‘BottomCenter’, etc. https://stereokit.net/Pages/StereoKit/Pivot.html
Pointer
Pointer is an abstraction of a number of different input sources, and a way to surface input events! https://stereokit.net/Pages/StereoKit/Pointer.html
RenderLayer
When rendering content, you can filter what you’re rendering by the RenderLayer that they’re on. This allows you to draw items that are visible in one render, but not another. For example, you may wish to draw a player’s avatar in a ‘mirror’ rendertarget, but not in the primary display. See Renderer.LayerFilter for configuring what the primary display renders. https://stereokit.net/Pages/StereoKit/RenderLayer.html
Renderer
Do you need to draw something? Well, you’re probably in the right place! This static class includes a variety of different drawing methods, from rendering Models and Meshes, to setting rendering options and drawing to offscreen surfaces! Even better, it’s entirely a static class, so you can call it from anywhere :) https://stereokit.net/Pages/StereoKit/Renderer.html
Text
A collection of functions for rendering and working with text. These are a lower level access to text rendering than the UI text functions, and are completely unaware of the UI code. https://stereokit.net/Pages/StereoKit/Text.html
TextFit
This enum describes how text layout behaves within the space it is given. https://stereokit.net/Pages/StereoKit/TextFit.html
TextStyle
A text style is a font plus size/color/material parameters, and are used to keep text looking more consistent through the application by encouraging devs to re-use styles throughout the project. See Text.MakeStyle for making a TextStyle object. https://stereokit.net/Pages/StereoKit/TextStyle.html
World
World contains information about the real world around the user. This includes things like play boundaries, scene understanding, and other various things. https://stereokit.net/Pages/StereoKit/World.html

Enums§

Asset
Non-canonical structure to store an asset and avoid reducer Box<dyn Asset>
AssetState
StereoKit uses an asynchronous loading system to prevent assets from blocking execution! This means that asset loading systems will return an asset to you right away, even though it is still being processed in the background. https://stereokit.net/Pages/StereoKit/AssetState.html
AssetType
A flag for what ‘type’ an Asset may store.
BackendGraphics
This describes the graphics API thatStereoKit is using for rendering. https://stereokit.net/Pages/StereoKit/BackendGraphics.html
BackendPlatform
This describes the platform that StereoKit is running on. https://stereokit.net/Pages/StereoKit/BackendPlatform.html
BackendXRType
This describes what technology is being used to power StereoKit’s XR backend. https://stereokit.net/Pages/StereoKit/BackendXRType.html
ControllerKey
Represents an input from an XR headset’s controller! https://stereokit.net/Pages/StereoKit/ControllerKey.html
FingerId
Index values for each finger! From 0-4, from thumb to little finger. https://stereokit.net/Pages/StereoKit/FingerId.html
HandSource
This enum provides information about StereoKit’s hand tracking data source. It allows you to distinguish between true hand data such as that provided by a Leap Motion Controller, and simulated data that StereoKit provides when true hand data is not present. https://stereokit.net/Pages/StereoKit/HandSource.html
Handed
An enum for indicating which hand to use! https://stereokit.net/Pages/StereoKit/Handed.html
HierarchyParent
When used with a hierarchy modifying function that will push/pop items onto a stack, this can be used to change the behavior of how parent hierarchy items will affect the item being added to the top of the stack. https://stereokit.net/Pages/StereoKit/HierarchyParent.html
JointId
Here’s where hands get crazy! Technical terms, and watch out for the thumbs! https://stereokit.net/Pages/StereoKit/JointId.html
Key
A collection of system key codes, representing keyboard characters and mouse buttons. Based on VK codes. https://stereokit.net/Pages/StereoKit/Key.html
LogColors
The log tool will write to the console with annotations for console colors, which helps with readability, but isn’t always supported. These are the options available for configuring those colors. https://stereokit.net/Pages/StereoKit/LogColors.html
LogLevel
Severity of a log item. https://stereokit.net/Pages/StereoKit/LogLevel.html
Projection
The projection mode used by StereoKit for the main camera! You can use this with Renderer.Projection. These options are only available in flatscreen mode, as MR headsets provide very specific projection matrices. https://stereokit.net/Pages/StereoKit/Projection.html
RenderClear
When rendering to a rendertarget, this tells if and what of the rendertarget gets cleared before rendering. For example, if you are assembling a sheet of images, you may want to clear everything on the first image draw, but not clear on subsequent draws. https://stereokit.net/Pages/StereoKit/RenderClear.html
SpatialNodeType
For use with World::from_spatial_node, this indicates the type of node that’s being bridged with OpenXR. https://stereokit.net/Pages/StereoKit/SpatialNodeType.html
TextContext
Soft keyboard layouts are often specific to the type of text that they’re editing! This enum is a collection of common text contexts that SK can pass along to the OS’s soft keyboard for a more optimal layout. https://stereokit.net/Pages/StereoKit/TextContext.html
TrackState
This is the tracking state of a sensory input in the world, like a controller’s position sensor, or a QR code identified by a tracking system. https://stereokit.net/Pages/StereoKit/TrackState.html
WorldRefresh
A settings flag that lets you describe the behavior of how StereoKit will refresh data about the world mesh, if applicable. This is used with World.RefreshType. https://stereokit.net/Pages/StereoKit/WorldRefresh.html

Traits§

IAsset
All StereoKit assets implement this interface! This is mostly to help group and hold Asset objects, and is particularly useful when working with Assets at a high level with the Assets class. https://stereokit.net/Pages/StereoKit/IAsset.html

Functions§

asset_addref
asset_get_id
asset_get_type
asset_release
asset_set_id
assets_block_for_priority
assets_count
assets_current_task
assets_current_task_priority
assets_get_index
assets_get_type
assets_releaseref_threadsafe
assets_total_tasks
backend_android_get_activity
backend_android_get_java_vm
backend_android_get_jni_env
backend_d3d11_get_d3d_context
backend_d3d11_get_d3d_device
backend_d3d11_get_deferred_d3d_context
backend_d3d11_get_deferred_mtx
backend_d3d11_get_main_thread_id
backend_graphics_get
backend_opengl_egl_get_config
backend_opengl_egl_get_context
backend_opengl_egl_get_display
backend_opengl_glx_get_context
backend_opengl_glx_get_display
backend_opengl_glx_get_drawable
backend_opengl_wgl_get_hdc
backend_opengl_wgl_get_hglrc
backend_openxr_add_callback_poll_event
backend_openxr_add_callback_pre_session_create
backend_openxr_composition_layer
backend_openxr_end_frame_chain
backend_openxr_ext_enabled
backend_openxr_ext_exclude
backend_openxr_ext_request
backend_openxr_get_eyes_sample_time
backend_openxr_get_function
backend_openxr_get_instance
backend_openxr_get_session
backend_openxr_get_space
backend_openxr_get_system_id
backend_openxr_get_time
backend_openxr_remove_callback_poll_event
backend_openxr_set_hand_joint_scale
backend_openxr_use_minimum_exts
backend_platform_get
backend_xr_get_type
hierarchy_is_enabled
hierarchy_pop
hierarchy_push
hierarchy_push_pose
hierarchy_set_enabled
hierarchy_to_local
hierarchy_to_local_direction
hierarchy_to_local_point
hierarchy_to_local_pose
hierarchy_to_local_ray
hierarchy_to_local_rotation
hierarchy_to_world
hierarchy_to_world_direction
hierarchy_to_world_point
hierarchy_to_world_pose
hierarchy_to_world_ray
hierarchy_to_world_rotation
input_controller
input_controller_menu
input_controller_model_get
input_controller_model_set
input_eyes
input_eyes_tracked
input_fire_eventDeprecated
input_get_finger_glow
input_hand
input_hand_material
input_hand_override
input_hand_sim_pose_add
input_hand_sim_pose_clear
input_hand_sim_pose_remove
input_hand_source
input_hand_visible
input_head
input_key
input_key_inject_press
input_key_inject_release
input_mouse
input_pointer
input_pointer_count
input_set_finger_glow
input_subscribeDeprecated
input_text_consume
input_text_inject_char
input_text_reset
input_unsubscribeDeprecated
line_add
line_add_axis
line_add_list
line_add_listv
line_addv
log_diag
log_err
log_info
log_set_colors
log_set_filter
log_subscribe
log_unsubscribe
log_warn
log_write
mic_device_count
mic_device_name
mic_get_stream
mic_is_recording
mic_start
mic_stop
render_MaterialTo
render_add_mesh
render_add_model
render_add_model_mat
render_blit
render_enable_skytex
render_enabled_skytex
render_get_cam_root
render_get_capture_filter
render_get_clear_color
render_get_device
render_get_filter
render_get_multisample
render_get_projection
render_get_scaling
render_get_skylight
render_get_skymaterial
render_get_skytex
render_get_viewport_scaling
render_global_texture
render_has_capture_filter
render_override_capture_filter
render_screenshot
render_screenshot_capture
render_screenshot_viewpoint
render_set_cam_root
render_set_clear_color
render_set_clip
render_set_filter
render_set_fov
render_set_multisample
render_set_ortho_clip
render_set_ortho_size
render_set_projection
render_set_scaling
render_set_skylight
render_set_skymaterial
render_set_skytex
render_set_viewport_scaling
render_to
text_add_at
text_add_at_16
text_add_in
text_add_in_16
text_char_at
text_char_at_16
text_make_style
text_make_style_mat
text_make_style_shader
text_size_layout
text_size_layout_16
text_size_layout_constrained
text_size_layout_constrained_16
text_size_render
text_style_get_ascender
text_style_get_baseline
text_style_get_cap_height
text_style_get_descender
text_style_get_layout_height
text_style_get_line_height_pct
text_style_get_material
text_style_get_total_height
text_style_set_layout_height
text_style_set_line_height_pct
text_style_set_total_height
world_from_perception_anchor
world_from_spatial_graph
world_get_bounds_pose
world_get_bounds_size
world_get_occlusion_enabled
world_get_occlusion_material
world_get_origin_mode
world_get_origin_offset
world_get_raycast_enabled
world_get_refresh_interval
world_get_refresh_radius
world_get_refresh_type
world_get_tracked
world_has_bounds
world_raycast
world_set_occlusion_enabled
world_set_occlusion_material
world_set_origin_offset
world_set_raycast_enabled
world_set_refresh_interval
world_set_refresh_radius
world_set_refresh_type
world_try_from_perception_anchor
world_try_from_spatial_graph

Type Aliases§

AssetT
HandSimId
Id of a simulated hand pose, for use with Input.HandSimPoseRemove https://stereokit.net/Pages/StereoKit/HandSimId.html
OpenXRHandleT
XrInstance type
VoidFunction