⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

struct Interactor

Interactors are essentially capsules that allow interaction with StereoKit’s interaction primitives used by the UI system. While StereoKit does provide a number of interactors by default, you can replace StereoKit’s defaults, add additional interactors, or generally just customize your interactions!

Instance Fields and Properties

   
IdHash Active The id of the interaction element that is currently active, this will be IdHash.None if this interactor has nothing active. This will always be the same id as Focused when not None.
Vec3 End The world space end of the interactor capsule. Some interactions can be directional, especially for Line type interactors, so if you think of the interactor as an “oriented” capsule, this would be the end which the Start/origin points towards.
IdHash Focused The id of the interaction element that is currently focused, this will be IdHash.None if this interactor has nothing focused.
float MinDistance The distance at which a ray starts being interactive. For pointing rays, you may not want them to interact right at their start, or you may want the start to move depending on how outstretched the hand is! This allows you to change that start location without affecting the movement caused by the ray, and still capturing occlusion from blocking elements too close to the start. By default, this is a large negative value.
Pose Motion This pose is the source of translation and rotation motion caused by the interactor. In most cases it will be the same as your Start with the orientation of your interactor, but in some instance may be something else!
float Radius The world space radius of the interactor capsule, in meters.
Vec3 Start The world space start of the interactor capsule. Some interactions can be directional, especially for Line type interactors, so if you think of the interactor as an “oriented” capsule, this would be the origin which points towards the capsule End.
BtnState Tracked The tracking state of this interactor.

Instance Methods

   
Destroy Interactors, unlike Assets, don’t destroy themselves! You must explicitly Destroy an Interactor if you’re finished with it, otherwise it will continue to interact with StereoKit’s interactors. This function immediately removes the interactor from the interactor list.
TryGetFocusBounds If this interactor has an element focused, this will output information about the location of that element, as well as the interactor’s intersection point with that element.
Update Update the interactor with data for the current frame! This should be called as soon as possible at the start of the frame before any UI is done, otherwise the UI will not properly react.

Static Fields and Properties

   
int Count The number of interactors currently in the system. Can be used with Get.

Static Methods

   
Create Create a new custom Interactor.
Get Returns the Interactor at the given index. Should be used with Count.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!