C# Class OVRInput

显示文件 Open project: FIU-SCIS-Senior-Projects/SmartBuilding4 Class Usage Examples

Public Methods

Method Description
Get ( Axis2D virtualMask, Controller, controllerMask = Controller.Active ) : Vector2

Gets the current state of the given virtual 2-dimensional axis mask on the given controller mask. Returns the vector of the largest masked axis across all masked controllers. Values range from -1 to 1.

Get ( RawAxis2D rawMask, Controller, controllerMask = Controller.Active ) : Vector2

Gets the current state of the given raw 2-dimensional axis mask on the given controller mask. Returns the vector of the largest masked axis across all masked controllers. Values range from -1 to 1.

Get ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current state of the given virtual button mask with the given controller mask. Returns true if any masked button is down on any masked controller.

Get ( NearTouch virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current state of the given virtual near touch mask with the given controller mask. Returns true if any masked near touch is down on any masked controller.

Get ( RawButton, rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current state of the given raw button mask with the given controller mask. Returns true if any masked button is down on any masked controllers.

Get ( RawNearTouch rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current state of the given raw near touch mask with the given controller mask. Returns true if any masked near touch is down on any masked controllers.

Get ( RawTouch rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current state of the given raw touch mask with the given controller mask. Returns true if any masked touch is down on any masked controllers.

Get ( Touch virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current state of the given virtual touch mask with the given controller mask. Returns true if any masked touch is down on any masked controller.

Get ( Axis1D virtualMask, Controller, controllerMask = Controller.Active ) : float

Gets the current state of the given virtual 1-dimensional axis mask on the given controller mask. Returns the value of the largest masked axis across all masked controllers. Values range from 0 to 1.

Get ( RawAxis1D rawMask, Controller, controllerMask = Controller.Active ) : float

Gets the current state of the given raw 1-dimensional axis mask on the given controller mask. Returns the value of the largest masked axis across all masked controllers. Values range from 0 to 1.

GetActiveController ( ) : Controller,

Returns the current active controller type.

GetConnectedControllers ( ) : Controller,

Returns a mask of all currently connected controller types.

GetControllerOrientationTracked ( OVRInput, controllerType ) : bool

Returns true if the given Controller's orientation is currently tracked. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return false.

GetControllerPositionTracked ( OVRInput, controllerType ) : bool

Returns true if the given Controller's position is currently tracked. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return false.

GetDown ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current down state of the given virtual button mask with the given controller mask. Returns true if any masked button was pressed this frame on any masked controller and no masked button was previously down last frame.

GetDown ( NearTouch virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current down state of the given virtual near touch mask with the given controller mask. Returns true if any masked near touch was pressed this frame on any masked controller and no masked near touch was previously down last frame.

GetDown ( RawButton, rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current down state of the given raw button mask with the given controller mask. Returns true if any masked button was pressed this frame on any masked controller and no masked button was previously down last frame.

GetDown ( RawNearTouch rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current down state of the given raw near touch mask with the given controller mask. Returns true if any masked near touch was pressed this frame on any masked controller and no masked near touch was previously down last frame.

GetDown ( RawTouch rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current down state of the given raw touch mask with the given controller mask. Returns true if any masked touch was pressed this frame on any masked controller and no masked touch was previously down last frame.

GetDown ( Touch virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current down state of the given virtual touch mask with the given controller mask. Returns true if any masked touch was pressed this frame on any masked controller and no masked touch was previously down last frame.

GetLocalControllerAcceleration ( OVRInput, controllerType ) : Vector3

Gets the linear acceleration of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Vector3.zero.

GetLocalControllerAngularAcceleration ( OVRInput, controllerType ) : Quaternion

Gets the angular acceleration of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Quaternion.identity.

GetLocalControllerAngularVelocity ( OVRInput, controllerType ) : Quaternion

Gets the angular velocity of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Quaternion.identity.

GetLocalControllerPosition ( OVRInput, controllerType ) : Vector3

Gets the position of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Vector3.zero.

GetLocalControllerRotation ( OVRInput, controllerType ) : Quaternion

Gets the rotation of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Quaternion.identity.

GetLocalControllerVelocity ( OVRInput, controllerType ) : Vector3

Gets the linear velocity of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Vector3.zero.

GetUp ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current up state of the given virtual button mask with the given controller mask. Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.

GetUp ( NearTouch virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current up state of the given virtual near touch mask with the given controller mask. Returns true if any masked near touch was released this frame on any masked controller and no other masked near touch is still down this frame.

GetUp ( RawButton, rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current up state of the given raw button mask with the given controller mask. Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.

GetUp ( RawNearTouch rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current up state of the given raw near touch mask with the given controller mask. Returns true if any masked near touch was released this frame on any masked controller and no other masked near touch is still down this frame.

GetUp ( RawTouch rawMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current up state of the given raw touch mask with the given controller mask. Returns true if any masked touch was released this frame on any masked controller and no other masked touch is still down this frame.

GetUp ( Touch virtualMask, Controller, controllerMask = Controller.Active ) : bool

Gets the current up state of the given virtual touch mask with the given controller mask. Returns true if any masked touch was released this frame on any masked controller and no other masked touch is still down this frame.

OVRInput ( ) : System

Creates an instance of OVRInput. Called by OVRManager.

SetControllerVibration ( float frequency, float amplitude, Controller, controllerMask = Controller.Active ) : void

Activates vibration with the given frequency and amplitude with the given controller mask. Ignored on controllers that do not support vibration. Expected values range from 0 to 1.

Update ( ) : void

Updates the internal state of the OVRInput. Called by OVRManager.

Private Methods

Method Description
CalculateAbsMax ( Vector2 a, Vector2 b ) : Vector2
CalculateAbsMax ( float a, float b ) : float
CalculateDeadzone ( Vector2 a, float deadzone ) : Vector2
CalculateDeadzone ( float a, float deadzone ) : float
GetResolvedAxis1D ( Axis1D virtualMask, RawAxis1D rawMask, Controller, controllerMask ) : float
GetResolvedAxis2D ( Axis2D virtualMask, RawAxis2D rawMask, Controller, controllerMask ) : Vector2
GetResolvedButton ( Button, virtualMask, RawButton, rawMask, Controller, controllerMask ) : bool
GetResolvedButtonDown ( Button, virtualMask, RawButton, rawMask, Controller, controllerMask ) : bool
GetResolvedButtonUp ( Button, virtualMask, RawButton, rawMask, Controller, controllerMask ) : bool
GetResolvedNearTouch ( NearTouch virtualMask, RawNearTouch rawMask, Controller, controllerMask ) : bool
GetResolvedNearTouchDown ( NearTouch virtualMask, RawNearTouch rawMask, Controller, controllerMask ) : bool
GetResolvedNearTouchUp ( NearTouch virtualMask, RawNearTouch rawMask, Controller, controllerMask ) : bool
GetResolvedTouch ( Touch virtualMask, RawTouch rawMask, Controller, controllerMask ) : bool
GetResolvedTouchDown ( Touch virtualMask, RawTouch rawMask, Controller, controllerMask ) : bool
GetResolvedTouchUp ( Touch virtualMask, RawTouch rawMask, Controller, controllerMask ) : bool
SetControllerVibrationInternal ( float frequency, float amplitude, Controller, controllerMask ) : void
ShouldResolveController ( Controller, controllerType, Controller, controllerMask ) : bool

Method Details

Get() public static method

Gets the current state of the given virtual 2-dimensional axis mask on the given controller mask. Returns the vector of the largest masked axis across all masked controllers. Values range from -1 to 1.
public static Get ( Axis2D virtualMask, Controller, controllerMask = Controller.Active ) : Vector2
virtualMask Axis2D
controllerMask Controller,
return Vector2

Get() public static method

Gets the current state of the given raw 2-dimensional axis mask on the given controller mask. Returns the vector of the largest masked axis across all masked controllers. Values range from -1 to 1.
public static Get ( RawAxis2D rawMask, Controller, controllerMask = Controller.Active ) : Vector2
rawMask RawAxis2D
controllerMask Controller,
return Vector2

Get() public static method

Gets the current state of the given virtual button mask with the given controller mask. Returns true if any masked button is down on any masked controller.
public static Get ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Button,
controllerMask Controller,
return bool

Get() public static method

Gets the current state of the given virtual near touch mask with the given controller mask. Returns true if any masked near touch is down on any masked controller.
public static Get ( NearTouch virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask NearTouch
controllerMask Controller,
return bool

Get() public static method

Gets the current state of the given raw button mask with the given controller mask. Returns true if any masked button is down on any masked controllers.
public static Get ( RawButton, rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawButton,
controllerMask Controller,
return bool

Get() public static method

Gets the current state of the given raw near touch mask with the given controller mask. Returns true if any masked near touch is down on any masked controllers.
public static Get ( RawNearTouch rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawNearTouch
controllerMask Controller,
return bool

Get() public static method

Gets the current state of the given raw touch mask with the given controller mask. Returns true if any masked touch is down on any masked controllers.
public static Get ( RawTouch rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawTouch
controllerMask Controller,
return bool

Get() public static method

Gets the current state of the given virtual touch mask with the given controller mask. Returns true if any masked touch is down on any masked controller.
public static Get ( Touch virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Touch
controllerMask Controller,
return bool

Get() public static method

Gets the current state of the given virtual 1-dimensional axis mask on the given controller mask. Returns the value of the largest masked axis across all masked controllers. Values range from 0 to 1.
public static Get ( Axis1D virtualMask, Controller, controllerMask = Controller.Active ) : float
virtualMask Axis1D
controllerMask Controller,
return float

Get() public static method

Gets the current state of the given raw 1-dimensional axis mask on the given controller mask. Returns the value of the largest masked axis across all masked controllers. Values range from 0 to 1.
public static Get ( RawAxis1D rawMask, Controller, controllerMask = Controller.Active ) : float
rawMask RawAxis1D
controllerMask Controller,
return float

GetActiveController() public static method

Returns the current active controller type.
public static GetActiveController ( ) : Controller,
return Controller,

GetConnectedControllers() public static method

Returns a mask of all currently connected controller types.
public static GetConnectedControllers ( ) : Controller,
return Controller,

GetControllerOrientationTracked() public static method

Returns true if the given Controller's orientation is currently tracked. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return false.
public static GetControllerOrientationTracked ( OVRInput, controllerType ) : bool
controllerType OVRInput,
return bool

GetControllerPositionTracked() public static method

Returns true if the given Controller's position is currently tracked. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return false.
public static GetControllerPositionTracked ( OVRInput, controllerType ) : bool
controllerType OVRInput,
return bool

GetDown() public static method

Gets the current down state of the given virtual button mask with the given controller mask. Returns true if any masked button was pressed this frame on any masked controller and no masked button was previously down last frame.
public static GetDown ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Button,
controllerMask Controller,
return bool

GetDown() public static method

Gets the current down state of the given virtual near touch mask with the given controller mask. Returns true if any masked near touch was pressed this frame on any masked controller and no masked near touch was previously down last frame.
public static GetDown ( NearTouch virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask NearTouch
controllerMask Controller,
return bool

GetDown() public static method

Gets the current down state of the given raw button mask with the given controller mask. Returns true if any masked button was pressed this frame on any masked controller and no masked button was previously down last frame.
public static GetDown ( RawButton, rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawButton,
controllerMask Controller,
return bool

GetDown() public static method

Gets the current down state of the given raw near touch mask with the given controller mask. Returns true if any masked near touch was pressed this frame on any masked controller and no masked near touch was previously down last frame.
public static GetDown ( RawNearTouch rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawNearTouch
controllerMask Controller,
return bool

GetDown() public static method

Gets the current down state of the given raw touch mask with the given controller mask. Returns true if any masked touch was pressed this frame on any masked controller and no masked touch was previously down last frame.
public static GetDown ( RawTouch rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawTouch
controllerMask Controller,
return bool

GetDown() public static method

Gets the current down state of the given virtual touch mask with the given controller mask. Returns true if any masked touch was pressed this frame on any masked controller and no masked touch was previously down last frame.
public static GetDown ( Touch virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Touch
controllerMask Controller,
return bool

GetLocalControllerAcceleration() public static method

Gets the linear acceleration of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Vector3.zero.
public static GetLocalControllerAcceleration ( OVRInput, controllerType ) : Vector3
controllerType OVRInput,
return Vector3

GetLocalControllerAngularAcceleration() public static method

Gets the angular acceleration of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Quaternion.identity.
public static GetLocalControllerAngularAcceleration ( OVRInput, controllerType ) : Quaternion
controllerType OVRInput,
return Quaternion

GetLocalControllerAngularVelocity() public static method

Gets the angular velocity of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Quaternion.identity.
public static GetLocalControllerAngularVelocity ( OVRInput, controllerType ) : Quaternion
controllerType OVRInput,
return Quaternion

GetLocalControllerPosition() public static method

Gets the position of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Vector3.zero.
public static GetLocalControllerPosition ( OVRInput, controllerType ) : Vector3
controllerType OVRInput,
return Vector3

GetLocalControllerRotation() public static method

Gets the rotation of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Quaternion.identity.
public static GetLocalControllerRotation ( OVRInput, controllerType ) : Quaternion
controllerType OVRInput,
return Quaternion

GetLocalControllerVelocity() public static method

Gets the linear velocity of the given Controller local to its tracking space. Only supported for Oculus LTouch and RTouch controllers. Non-tracked controllers will return Vector3.zero.
public static GetLocalControllerVelocity ( OVRInput, controllerType ) : Vector3
controllerType OVRInput,
return Vector3

GetUp() public static method

Gets the current up state of the given virtual button mask with the given controller mask. Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.
public static GetUp ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Button,
controllerMask Controller,
return bool

GetUp() public static method

Gets the current up state of the given virtual near touch mask with the given controller mask. Returns true if any masked near touch was released this frame on any masked controller and no other masked near touch is still down this frame.
public static GetUp ( NearTouch virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask NearTouch
controllerMask Controller,
return bool

GetUp() public static method

Gets the current up state of the given raw button mask with the given controller mask. Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.
public static GetUp ( RawButton, rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawButton,
controllerMask Controller,
return bool

GetUp() public static method

Gets the current up state of the given raw near touch mask with the given controller mask. Returns true if any masked near touch was released this frame on any masked controller and no other masked near touch is still down this frame.
public static GetUp ( RawNearTouch rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawNearTouch
controllerMask Controller,
return bool

GetUp() public static method

Gets the current up state of the given raw touch mask with the given controller mask. Returns true if any masked touch was released this frame on any masked controller and no other masked touch is still down this frame.
public static GetUp ( RawTouch rawMask, Controller, controllerMask = Controller.Active ) : bool
rawMask RawTouch
controllerMask Controller,
return bool

GetUp() public static method

Gets the current up state of the given virtual touch mask with the given controller mask. Returns true if any masked touch was released this frame on any masked controller and no other masked touch is still down this frame.
public static GetUp ( Touch virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Touch
controllerMask Controller,
return bool

OVRInput() public method

Creates an instance of OVRInput. Called by OVRManager.
public OVRInput ( ) : System
return System

SetControllerVibration() public static method

Activates vibration with the given frequency and amplitude with the given controller mask. Ignored on controllers that do not support vibration. Expected values range from 0 to 1.
public static SetControllerVibration ( float frequency, float amplitude, Controller, controllerMask = Controller.Active ) : void
frequency float
amplitude float
controllerMask Controller,
return void

Update() public method

Updates the internal state of the OVRInput. Called by OVRManager.
public Update ( ) : void
return void