Skip to main content

QWR Core API Reference

This page provides a comprehensive API reference for the QWR Core package. It documents the key classes, interfaces, and methods available in the SDK.

Namespace: QWR.Core

The main namespace for QWR Core components.

QWRXROrigin

The central component that manages the XR camera rig and tracking.

Properties

NameTypeDescription
InstanceQWRXROriginStatic instance of the QWR XR Origin.
CameraTransformTransformThe transform of the main XR camera.
TrackingOriginModeTrackingOriginModeThe current tracking origin mode (Device or Floor).
PlayerHeightfloatThe height of the player in meters.
IsInitializedboolWhether the XR Origin is fully initialized.

Methods

NameReturn TypeParametersDescription
Initialize()voidNoneInitializes the XR Origin.
RecenterView()voidNoneRecenters the player's view.
SetPlayerHeight(float height)voidheight: The player height in metersSets the player's height.
SetTrackingOriginMode(TrackingOriginMode mode)voidmode: The tracking origin modeSets the tracking origin mode.
GetLocalPosition()Vector3NoneGets the local position of the XR Origin.
GetWorldPosition()Vector3NoneGets the world position of the XR Origin.
TeleportTo(Vector3 position, Quaternion rotation)voidposition: Target position, rotation: Target rotationTeleports the XR Origin to the specified position and rotation.

Events

NameEvent TypeDescription
OnInitializedActionTriggered when the XR Origin is initialized.
OnRecenterViewActionTriggered when the view is recentered.
OnTrackingOriginChangedAction<TrackingOriginMode>Triggered when the tracking origin mode changes.

QWRHandController

Manages hand tracking and interactions.

Properties

NameTypeDescription
LeftHandQWRHandControllerStatic reference to the left hand controller.
RightHandQWRHandControllerStatic reference to the right hand controller.
HandTypeHandTypeThe type of hand (Left or Right).
IsTrackedboolWhether the hand is currently tracked.
IsGrabbingboolWhether the hand is currently grabbing something.
CurrentPoseHandPoseThe current pose of the hand.
CurrentGestureHandGestureThe current gesture being performed.
TrackingConfidencefloatThe confidence level of hand tracking (0-1).

Methods

NameReturn TypeParametersDescription
GetFingerBend(FingerType finger)floatfinger: The finger to checkGets the bend amount of the specified finger (0-1).
GetFingerTipPosition(FingerType finger)Vector3finger: The finger to checkGets the world position of the specified finger tip.
IsGesture(HandGesture gesture)boolgesture: The gesture to checkChecks if the hand is performing the specified gesture.
TriggerHapticFeedback(float amplitude, float duration)voidamplitude: Strength (0-1), duration: Time in secondsTriggers haptic feedback on the hand controller.
SetVisibility(bool visible)voidvisible: Whether the hand should be visibleSets the visibility of the hand model.
RegisterCustomGesture(string name, QWRGestureDefinition definition)voidname: Gesture name, definition: Gesture definitionRegisters a custom gesture for recognition.
SetModelDetailLevel(int level)voidlevel: Detail level (0-2)Sets the detail level of the hand model.

Events

NameEvent TypeDescription
OnTrackingAcquiredAction<QWRHandController>Triggered when hand tracking is acquired.
OnTrackingLostAction<QWRHandController>Triggered when hand tracking is lost.
OnGrabBeginAction<QWRHandController, QWRInteractable>Triggered when the hand starts grabbing an object.
OnGrabEndAction<QWRHandController, QWRInteractable>Triggered when the hand stops grabbing an object.
OnPoseChangedAction<QWRHandController, HandPose>Triggered when the hand pose changes.
OnGestureBeginAction<QWRHandController, HandGesture>Triggered when a gesture begins.
OnGestureEndAction<QWRHandController, HandGesture>Triggered when a gesture ends.

QWRInputManager

Handles input from controllers and other devices.

Properties

NameTypeDescription
InstanceQWRInputManagerStatic instance of the input manager.
InputModeInputModeThe current input mode (Hands, Controllers, or Auto).
IsLeftControllerConnectedboolWhether the left controller is connected.
IsRightControllerConnectedboolWhether the right controller is connected.

Methods

NameReturn TypeParametersDescription
GetTriggerValue(HandType hand)floathand: The hand to checkGets the trigger value (0-1) for the specified hand.
GetGripValue(HandType hand)floathand: The hand to checkGets the grip value (0-1) for the specified hand.
GetThumbstickValue(HandType hand)Vector2hand: The hand to checkGets the thumbstick/touchpad position for the specified hand.
IsPrimaryButtonPressed(HandType hand)boolhand: The hand to checkChecks if the primary button is pressed on the specified hand.
IsSecondaryButtonPressed(HandType hand)boolhand: The hand to checkChecks if the secondary button is pressed on the specified hand.
IsMenuButtonPressed(HandType hand)boolhand: The hand to checkChecks if the menu button is pressed on the specified hand.
TriggerHapticFeedback(HandType hand, float amplitude, float duration)voidhand: Target hand, amplitude: Strength (0-1), duration: Time in secondsTriggers haptic feedback on the specified controller.
TriggerHapticPattern(HandType hand, string patternName)voidhand: Target hand, patternName: Pattern identifierTriggers a predefined haptic pattern on the specified controller.
SetInputMode(InputMode mode)voidmode: The input mode to setSets the input mode.

Events

NameEvent TypeDescription
OnTriggerPressedAction<HandType>Triggered when the trigger button is pressed.
OnTriggerReleasedAction<HandType>Triggered when the trigger button is released.
OnGripPressedAction<HandType>Triggered when the grip button is pressed.
OnGripReleasedAction<HandType>Triggered when the grip button is released.
OnPrimaryButtonPressedAction<HandType>Triggered when the primary button is pressed.
OnPrimaryButtonReleasedAction<HandType>Triggered when the primary button is released.
OnSecondaryButtonPressedAction<HandType>Triggered when the secondary button is pressed.
OnSecondaryButtonReleasedAction<HandType>Triggered when the secondary button is released.
OnMenuButtonPressedAction<HandType>Triggered when the menu button is pressed.
OnMenuButtonReleasedAction<HandType>Triggered when the menu button is released.
OnThumbstickMovedAction<HandType, Vector2>Triggered when the thumbstick/touchpad is moved.
OnThumbstickClickedAction<HandType>Triggered when the thumbstick/touchpad is clicked.
OnInputModeChangedAction<InputMode>Triggered when the input mode changes.

QWRInteractionManager

Manages interactions between hands/controllers and objects.

Properties

NameTypeDescription
InstanceQWRInteractionManagerStatic instance of the interaction manager.

Methods

NameReturn TypeParametersDescription
RegisterInteractable(QWRInteractable interactable)voidinteractable: The interactable to registerRegisters an interactable object with the interaction manager.
UnregisterInteractable(QWRInteractable interactable)voidinteractable: The interactable to unregisterUnregisters an interactable object from the interaction manager.
IsInteracting(HandType hand)boolhand: The hand to checkChecks if the specified hand is currently interacting with an object.
GetInteractedObject(HandType hand)QWRInteractablehand: The hand to checkGets the object currently being interacted with by the specified hand.
ForceGrab(HandType hand, QWRInteractable interactable)boolhand: The hand to use, interactable: Target objectForces the specified hand to grab the interactable object.
ForceRelease(HandType hand)voidhand: The hand to releaseForces the specified hand to release any grabbed object.

Events

NameEvent TypeDescription
OnObjectGrabbedAction<QWRInteractor, QWRInteractable>Triggered when an object is grabbed.
OnObjectReleasedAction<QWRInteractor, QWRInteractable>Triggered when an object is released.
OnObjectHoverBeginAction<QWRInteractor, QWRInteractable>Triggered when an object hover begins.
OnObjectHoverEndAction<QWRInteractor, QWRInteractable>Triggered when an object hover ends.

QWRNetworkManager

Handles multiplayer networking functionality.

Properties

NameTypeDescription
InstanceQWRNetworkManagerStatic instance of the network manager.
IsConnectedboolWhether the player is connected to a room.
IsHostboolWhether the player is the host of the current room.
CurrentRoomCodestringThe code of the current room.
LocalPlayerQWRNetworkPlayerThe local player object.
LocalPlayerAvatarQWRNetworkAvatarThe local player's avatar.
PlayerCountintThe number of players in the current room.
MaxPlayersintThe maximum number of players allowed in a room.
VoiceChatQWRVoiceChatThe voice chat system.

Methods

NameReturn TypeParametersDescription
StartHost(string roomName, int maxPlayers)voidroomName: Room name, maxPlayers: Maximum playersStarts hosting a new room.
JoinRoom(string roomCode)voidroomCode: Room code to joinJoins an existing room.
JoinOrCreateRoom(string roomName)voidroomName: Room nameJoins an existing room or creates a new one.
Disconnect()voidNoneDisconnects from the current room.
GetAllPlayers()QWRNetworkPlayer[]NoneGets all connected players.
SetPlayerName(string name)voidname: Player nameSets the local player's name.
SendCustomMessage(int messageType, string data)voidmessageType: Message identifier, data: Message contentSends a custom message to all players.
RegisterNetworkObject(QWRNetworkObject obj)voidobj: Object to registerRegisters a network object for synchronization.
AuthenticateAsync()Task<bool>NoneAuthenticates the player with the network service.
CreateRoomAsync(string roomName, int maxPlayers, bool isPrivate)Task<bool>roomName: Room name, maxPlayers: Maximum players, isPrivate: Privacy settingCreates a new room asynchronously.
JoinRoomAsync(string roomCode)Task<bool>roomCode: Room code to joinJoins an existing room asynchronously.

Events

NameEvent TypeDescription
OnConnectedActionTriggered when connected to a room.
OnDisconnectedActionTriggered when disconnected from a room.
OnRoomJoinedAction<string>Triggered when a room is joined.
OnRoomLeftActionTriggered when a room is left.
OnPlayerJoinedAction<QWRNetworkPlayer>Triggered when a player joins the room.
OnPlayerLeftAction<QWRNetworkPlayer>Triggered when a player leaves the room.
OnCustomMessageReceivedAction<QWRNetworkPlayer, int, string>Triggered when a custom message is received.

Namespace: QWR.Core.Interaction

Contains components related to the interaction system.

QWRInteractable

Makes an object interactable with hands and controllers.

Properties

NameTypeDescription
GrabTypeGrabTypeThe types of interactors that can grab this object.
PhysicsGrabModePhysicsGrabModeThe physics mode when grabbed.
IsGrabbedboolWhether the object is currently grabbed.
CurrentGrabberQWRInteractorThe interactor currently grabbing this object.
SnapToHandboolWhether the object should snap to the hand when grabbed.
TwoHandedGrabEnabledboolWhether two-handed grabbing is enabled.
ThrowVelocityMultiplierfloatMultiplier for throw velocity.
GrabPointsQWRGrabPoint[]Array of grab points on this object.

Methods

NameReturn TypeParametersDescription
Grab(QWRInteractor interactor)boolinteractor: The interactor grabbing the objectAttempts to grab the object with the specified interactor.
Release(QWRInteractor interactor)voidinteractor: The interactor releasing the objectReleases the object from the specified interactor.
AddGrabPoint(QWRGrabPoint grabPoint)voidgrabPoint: The grab point to addAdds a grab point to the object.
RemoveGrabPoint(QWRGrabPoint grabPoint)voidgrabPoint: The grab point to removeRemoves a grab point from the object.
GetNearestGrabPoint(Vector3 position, HandType handType)QWRGrabPointposition: Query position, handType: Hand typeGets the nearest grab point to the specified position for the specified hand.

Events

NameEvent TypeDescription
OnGrabbedAction<QWRInteractor>Triggered when the object is grabbed.
OnReleasedAction<QWRInteractor>Triggered when the object is released.
OnHoverEnterAction<QWRInteractor>Triggered when an interactor starts hovering over the object.
OnHoverExitAction<QWRInteractor>Triggered when an interactor stops hovering over the object.

QWRInteractor

Represents an entity that can interact with objects (like hands or controllers).

Properties

NameTypeDescription
InteractorTypeInteractorTypeThe type of interactor (Hand or Controller).
HandTypeHandTypeThe hand type (Left or Right).
IsGrabbingboolWhether the interactor is currently grabbing something.
CurrentInteractableQWRInteractableThe object currently being interacted with.
HoveredInteractableQWRInteractableThe object currently being hovered over.
GrabPointTransformThe transform representing the grab point.

Methods

NameReturn TypeParametersDescription
TryGrab()boolNoneAttempts to grab the currently hovered object.
ForceGrab(QWRInteractable interactable)boolinteractable: The object to grabForces a grab on the specified object.
Release()voidNoneReleases the currently grabbed object.
CanGrab(QWRInteractable interactable)boolinteractable: The object to checkChecks if the interactor can grab the specified object.

Events

NameEvent TypeDescription
OnGrabBeginAction<QWRInteractor, QWRInteractable>Triggered when a grab begins.
OnGrabEndAction<QWRInteractor, QWRInteractable>Triggered when a grab ends.
OnHoverEnterAction<QWRInteractor, QWRInteractable>Triggered when hovering over an object begins.
OnHoverExitAction<QWRInteractor, QWRInteractable>Triggered when hovering over an object ends.

QWRGrabPoint

Defines a specific point on an interactable object where it can be grabbed.

Properties

NameTypeDescription
HandTypeHandTypeThe hand type that can use this grab point.
HandPoseHandPoseThe hand pose to use when grabbing this point.
SnapPositionboolWhether the hand should snap to this position.
SnapRotationboolWhether the hand should snap to this rotation.
CustomPoseQWRHandPoseDefinitionCustom hand pose definition.

Methods

NameReturn TypeParametersDescription
GetPoseTransform()TransformNoneGets the transform for hand positioning.
CanBeGrabbedBy(HandType handType)boolhandType: Hand type to checkChecks if this grab point can be grabbed by the specified hand.

Namespace: QWR.Core.UI

Contains components related to UI interaction.

QWRUIManager

The central component that coordinates all UI interactions.

Properties

NameTypeDescription
InstanceQWRUIManagerStatic instance of the UI manager.
RayInteractionEnabledboolWhether ray interaction is enabled.
DirectTouchInteractionEnabledboolWhether direct touch interaction is enabled.
HapticFeedbackEnabledboolWhether haptic feedback is enabled for UI interactions.

Methods

NameReturn TypeParametersDescription
RegisterCanvas(QWRUICanvas canvas)voidcanvas: The canvas to registerRegisters a UI canvas with the manager.
UnregisterCanvas(QWRUICanvas canvas)voidcanvas: The canvas to unregisterUnregisters a UI canvas from the manager.
SetGlobalInteractionMode(UIInteractionMode mode)voidmode: The interaction mode to setSets the global UI interaction mode.

QWRUICanvas

Makes a Unity Canvas interactable in XR.

Properties

NameTypeDescription
InteractionModeUIInteractionModeThe interaction mode for this canvas.
FollowTypeUIFollowTypeHow the canvas follows the user.
FollowDistancefloatThe distance at which the canvas follows the user.
FollowSmoothTimefloatSmoothing time for canvas movement.

Methods

NameReturn TypeParametersDescription
SetInteractionMode(UIInteractionMode mode)voidmode: The interaction mode to setSets the interaction mode for this canvas.
SetFollowType(UIFollowType followType)voidfollowType: The follow type to setSets how the canvas follows the user.
SetFollowDistance(float distance)voiddistance: The follow distanceSets the distance at which the canvas follows the user.

QWRUIInteractor

Allows hands or controllers to interact with UI elements.

Properties

NameTypeDescription
InteractionTypeUIInteractionTypeThe type of UI interaction (Ray or DirectTouch).
RayColorColorThe color of the interaction ray.
RayThicknessfloatThe thickness of the interaction ray.
RayLengthfloatThe length of the interaction ray.
ShowRayOnHoverOnlyboolWhether to show the ray only when hovering over UI.

Methods

NameReturn TypeParametersDescription
SetInteractionType(UIInteractionType type)voidtype: The interaction type to setSets the UI interaction type.
SetRayVisualization(bool enabled)voidenabled: Whether ray visualization is enabledEnables or disables ray visualization.
TriggerHapticFeedback(float amplitude, float duration)voidamplitude: Strength (0-1), duration: Time in secondsTriggers haptic feedback for UI interaction.

Events

NameEvent TypeDescription
OnUIElementClickedAction<GameObject>Triggered when a UI element is clicked.
OnUIElementHoverEnterAction<GameObject>Triggered when hovering over a UI element begins.
OnUIElementHoverExitAction<GameObject>Triggered when hovering over a UI element ends.

Namespace: QWR.Core.Multiplayer

Contains components related to multiplayer functionality.

QWRNetworkPlayer

Represents a player in the network.

Properties

NameTypeDescription
PlayerIdstringThe unique identifier of the player.
PlayerNamestringThe display name of the player.
IsLocalboolWhether this player is the local player.
IsHostboolWhether this player is the host.
AvatarQWRNetworkAvatarThe player's avatar.

Methods

NameReturn TypeParametersDescription
GetPosition()Vector3NoneGets the player's position.
GetRotation()QuaternionNoneGets the player's rotation.
SetCustomProperty(string key, object value)voidkey: Property key, value: Property valueSets a custom player property.
GetCustomProperty(string key)objectkey: Property keyGets a custom player property.
SendDirectMessage(int messageType, string data)voidmessageType: Message identifier, data: Message contentSends a message directly to this player.

QWRNetworkObject

Makes an object synchronize over the network.

Properties

NameTypeDescription
IsOwnerboolWhether the local player owns this object.
OwnerQWRNetworkPlayerThe player who owns this object.
SyncPositionboolWhether to synchronize position.
SyncRotationboolWhether to synchronize rotation.
SyncScaleboolWhether to synchronize scale.
SyncPhysicsboolWhether to synchronize physics properties.
UpdateRateintThe update rate for synchronization.

Methods

NameReturn TypeParametersDescription
TransferOwnership(QWRNetworkPlayer player)voidplayer: The player to transfer ownership toTransfers ownership of the object to the specified player.
RequestOwnership()voidNoneRequests ownership of the object.
NetworkDestroy()voidNoneDestroys the object across the network.
SetCustomProperty(string key, object value)voidkey: Property key, value: Property valueSets a custom object property.
GetCustomProperty(string key)objectkey: Property keyGets a custom object property.

Events

NameEvent TypeDescription
OnOwnershipChangedAction<QWRNetworkObject, QWRNetworkPlayer>Triggered when ownership changes.
OnCustomPropertyChangedAction<QWRNetworkObject, string, object>Triggered when a custom property changes.

QWRNetworkAvatar

Represents a player's avatar in the network.

Properties

NameTypeDescription
PlayerQWRNetworkPlayerThe player this avatar represents.
SyncHandAnimationsboolWhether to synchronize hand animations.
SyncControllerInputsboolWhether to synchronize controller inputs.
UpdateRateintThe update rate for synchronization.

Methods

NameReturn TypeParametersDescription
SetCustomAvatarModel(GameObject prefab)voidprefab: The avatar model prefabSets a custom avatar model.
SetVisibility(bool visible)voidvisible: Whether the avatar should be visibleSets the visibility of the avatar.
SetNameTagVisibility(bool visible)voidvisible: Whether the name tag should be visibleSets the visibility of the name tag.

Enums

HandType

public enum HandType
{
Left,
Right
}

InputMode

public enum InputMode
{
Hands,
Controllers,
Auto
}

GrabType

public enum GrabType
{
Hand,
Controller,
Both,
None
}

PhysicsGrabMode

public enum PhysicsGrabMode
{
Kinematic,
Velocity,
Joint
}

UIInteractionMode

public enum UIInteractionMode
{
Ray,
DirectTouch,
Both,
None
}

UIFollowType

public enum UIFollowType
{
None,
BodyLocked,
GazeLocked,
HandAttached
}

Interfaces

IQWRInteractable

public interface IQWRInteractable
{
bool IsGrabbed { get; }
QWRInteractor CurrentGrabber { get; }
bool Grab(QWRInteractor interactor);
void Release(QWRInteractor interactor);
void OnHoverEnter(QWRInteractor interactor);
void OnHoverExit(QWRInteractor interactor);
}

IQWRUIHandler

public interface IQWRUIHandler
{
void OnQWRPointerEnter(QWRPointerEventData eventData);
void OnQWRPointerExit(QWRPointerEventData eventData);
void OnQWRPointerDown(QWRPointerEventData eventData);
void OnQWRPointerUp(QWRPointerEventData eventData);
void OnQWRPointerClick(QWRPointerEventData eventData);
}

Next Steps

For more detailed information about specific components, check out the following pages: