- About XR
- XR Unity SDK
- XR SDK Release Notes
- Version:1.0.3
- Version:1.0.2
- Version:1.0.1
- Version:1.0.0
- Version:0.9.59
- Version:0.9.58
- Version:0.9.57
- Version:0.9.56
- Version:0.9.55
- Version:0.9.54
- Version:0.9.53
- Version:0.9.52
- Version:0.9.51
- Version:0.9.38
- Version:0.9.37
- Version:0.9.34
- Version:0.9.33
- Version:0.9.32
- Version:0.9.31
- Version:0.9.30
- Version:0.9.24
- Version:0.9.23 Beta
API - XRInputManager¶
Contents
Static propertie¶
public static XRInputManager Instance { get; }
Description
XRInputManager is design in singleton pattern. Use this property to get all member.
Field¶
public bool EditorSimulation
Description
If true, enable editor simulation in XRReceiver and XRCTLReceiver when press run in Unity editor.
public const string VERSION
Description
Represent the sdk version. This field is constant.
Propertie¶
public float FillRate { get; }
Description
When XRRaycaster is placed in the scene with device Headset. If user gaze on interactable object. This property present the time user gazing in percent.
public XRBasicGestureFilter GestureFilter { get; set; }
Description
Users can get the filter from this property or set a personalized filter to this property by inheriting XRBasicGestureFilter.
public Vector2 HandClippingPlane { get; }
Description
This property present the recommended camera’s near and far plane distance. Hand will be detected in this area.
public Vector2 HandFieldOfView { get; }
Description
This property present the recommended camera’s vertical and horizontal field of view. Hand will be detected in this area.
public bool IsGaze { get; }
Description
When XRRaycaster is placed in the scene with device Headset. If user gaze on interactable object. This property set to true, otherwise false.
Event¶
public event Action OnInputDataUpdate
Description
It will trigger when the Inputdata been changed.
Method¶
public Vector3 Accelerometer (XRDeviceType deviceType)
Description
Return accelerometer information.
public int BatteryLevel (XRDeviceType deviceType)
Description
Return device remaining bettery.
public XRBodyPosture Body (int index = 0)
Description
Return the motion in Bodys array.
public XRBodyPosture[] Bodys
Description
Return the top three posible motion and their accuracy.
public bool Button (XRDeviceType deviceType, XRControllerButton button)
Description
Return the button is pressed on device or not.
public bool ButtonDown (XRDeviceType deviceType, XRControllerButton button)
Description
Return the button is pressed down at the time on device or not.
public bool ButtonUp (XRDeviceType deviceType, XRControllerButton button)
Description
Return the button is released at the time on device or not.
public XRHandlerGesture Gesture (XRDeviceType deviceType)
Description
Return hand’s gesture represent by Handler.
public T GetInputData<T> (XRDeviceType type)
Description
Get current devicetype’s all effective data. For more information, refer XRHeadsetData, XRHandlerData and XRTrackerData.
public Vector3 Gyroscope (XRDeviceType deviceType)
Description
Return gyroscope information.
public float HandlerPositionConfidence(XRDeviceType type)
Description
Return the confidence of handler position.
public XRHandlerType HandlerType (XRDeviceType deviceType)
Description
Return the Handler’s current type.
public bool IsConnect (XRDeviceType deviceType)
Description
Return device connection state.
public Vector3 Position (XRDeviceType deviceType, bool isLocal = true)
Description
Return device position.
If isLocal is
true
, return local position in XRManager coordinate when deviceType is Handler.If isLocal is
false
, return position in unity world coordinate when deviceType is Handler.
public XRBodyPosture PredictPose
Description
Return the most posible motion detected by system.
public void Recenter (XRDeviceType deviceType)
Description
Make device reset Yaw angle and position(Headset only).
public void RecenterIK (bool isPelvisInitial = false)
Description
It will reset IK bone to the pose of stand at attention.
When isPelvisInitial is true, pelvis position and rotation will reset to vector3.zero and identity.
Wehn isPelvisInitial is false, pelvis position will reset to vector3.zero but rotation will face the head forward.
public Quaternion Rotation (XRDeviceType deviceType)
Description
Return device rotation.
public void SetHandPositionScale (Vector3 depthScaleFactor)
Description
Set hand position conversion scale in meter.
public Vector2 TouchPosition (XRDeviceType deviceType)
Description
Return the touch position on trackpad.
public void Vibrate (XRDeviceType type, int duration = 1000)
Description
Make device vibrate in duration time in ms.
public void VibrateStart (XRDeviceType type)
Description
Make device start vibration. This will support in next ROM version.
public void VibrateStop (XRDeviceType type)
Description
Make device stop vibration. This will support in next ROM version.