Class vCast.Ctrl
Level 2 functions in IO system, to handle vCast controller.
輸入輸出系統中的第二級別的功能,用作處理 vCast 控制器。
Inheritance
Namespace: Votanic.vXR.vCast
Assembly: Votanic.vXR.dll
Syntax
public class Ctrl
Methods
AxisDown(Int32, AxisDirection, Int32, Boolean)
Return true if a controller axis was pressed down (Absolute axis value >= Press detect value).
當控制器的軸按下時傳回 true(軸絕對值 >= 按下偵測值)。
AxisDown(0)
Declaration
public static bool AxisDown(int index, AxisDirection direction = AxisDirection.Any, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
AxisHold(Int32, AxisDirection, Int32, Boolean)
Return true if a controller axis was held for a while (Absolute axis value >= Press detect value).
當控制器的軸長按一段時間時傳回 true(軸絕對值 >= 按下偵測值)。
AxisHold(0)
Declaration
public static bool AxisHold(int index, AxisDirection direction = AxisDirection.Any, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
AxisPress(Int32, AxisDirection, Int32, Boolean)
Return true if a controller axis is pressing (Absolute axis value >= Press detect value).
當控制器的軸正在按住時傳回 true(軸絕對值 >= 按下偵測值)。
AxisPress(0)
Declaration
public static bool AxisPress(int index, AxisDirection direction = AxisDirection.Any, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
AxisUp(Int32, AxisDirection, Int32, Boolean)
Return true if a controller axis was released (Absolute release value >= Press detect value).
當控制器的軸放開時傳回 true(釋放絕對值 >= 按下偵測值)。
AxisUp(0)
Declaration
public static bool AxisUp(int index, AxisDirection direction = AxisDirection.Any, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
AxisValue(Int32, Int32, Boolean)
Return the floating value of a controller axis.
傳回控制器的軸浮點值。
AxisValue(0)
Declaration
public static float AxisValue(int index, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Single |
ButtonDown(Int32, Int32, Boolean)
Return true if a controller button is pressed.
當控制器的按鈕按下時傳回 true。
ButtonDown(0)
Declaration
public static bool ButtonDown(int index, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonHold(Int32, Int32, Boolean)
Return true if a controller button is held for a while.
當控制器的按鈕長按一段時間時傳回 true。
ButtonHold(0)
Declaration
public static bool ButtonHold(int index, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonPress(Int32, Int32, Boolean)
Return true if a controller button is pressing.
當控制器的按鈕正在按住時傳回 true。
ButtonPress(0)
Declaration
public static bool ButtonPress(int index, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonTouch(Int32, Int32, Boolean)
Return true if a controller button is touched.
當控制器的按鈕被觸碰時傳回 true。
ButtonTouch(0)
Declaration
public static bool ButtonTouch(int index, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonUp(Int32, Int32, Boolean)
Return true if a controller button is released.
當控制器的按鈕放開時傳回 true。
ButtonUp(0)
Declaration
public static bool ButtonUp(int index, int controller = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | controller | Controller index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
GetAxes(Int32)
Get current axes device of the controller.
取得目前控制器的軸群。
GetAxes(0)
Declaration
public static Axes GetAxes(int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controller | Controller index |
Returns
Type | Description |
---|---|
Axes |
GetButtons(Int32)
Get current buttons device of the controller.
取得目前控制器的按鈕群。
GetButtons(0)
Declaration
public static Buttons GetButtons(int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controller | Controller index |
Returns
Type | Description |
---|---|
Buttons |
NumberOfAxis(Int32)
Get current number of axis of the controller.
取得目前控制器的軸數目。
NumberOfAxis(0)
Declaration
public static int NumberOfAxis(int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controller | Controller index |
Returns
Type | Description |
---|---|
System.Int32 |
NumberOfButton(Int32)
Get current number of button of the controller.
取得目前控制器的按鈕數目。
NumberOfButton(0)
Declaration
public static int NumberOfButton(int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controller | Controller index |
Returns
Type | Description |
---|---|
System.Int32 |
SetAxes(Int32, Int32)
Set axes device to the controller.
為控制器設置軸群裝置。
SetButtons(0, 0)
Declaration
public static void SetAxes(int deviceIndex, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | deviceIndex | Axes index in controller axes list |
System.Int32 | controller | Controller index |
SetAxes(String, Int32)
Set axes device to the controller.
為控制器設置軸群裝置。
SetButtons("Controller (XBOX 360 For Windows).Axes", 0)
Declaration
public static void SetAxes(string deviceName, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | deviceName | Axes name in controller axes list |
System.Int32 | controller | Controller index |
SetButtons(Int32, Int32)
Set buttons device to the controller.
為控制器設置按鈕群裝置。
SetButtons(0, 0)
Declaration
public static void SetButtons(int deviceIndex, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | deviceIndex | Buttons index in controller buttons list |
System.Int32 | controller | Controller index |
SetButtons(String, Int32)
Set buttons device to the controller.
SetButtons("Controller (XBOX 360 For Windows).Buttons", 0)
Declaration
public static void SetButtons(string deviceName, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | deviceName | Buttons name in controller buttons list |
System.Int32 | controller | Controller index |
Swap()
Swap the first two hands binding buttons, axes and tracker.
將頭兩隻手綁定的按鈕群、軸群及定位器交換。
Declaration
public static void Swap()
Swap(String, String, Int32, Int32)
Swap two hands binding tracker and two controllers binding buttons and axes.
將兩隻手綁定的定位器及控制器綁定的按鈕群及軸群交換。
Swap("Hand", "Hand2", 0, 1)
Declaration
public static void Swap(string hand1, string hand2, int controller1, int controller2)
Parameters
Type | Name | Description |
---|---|---|
System.String | hand1 | Name of hand 1 |
System.String | hand2 | Name of hand 2 |
System.Int32 | controller1 | Controller 1 index |
System.Int32 | controller2 | Controller 2 index |
Vibrate(Single, Int32)
Vibrate the controller.
使控制器震動。
Vibrate(0.1f)
Declaration
public static void Vibrate(float duration = 0.1F, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Vibrate seconds |
System.Int32 | controller | Controller index |
Vibrate(Single, Single, Single, Int32)
Vibrate the controller that has 2 vibration motors.
使擁有兩個震動摩打的控制器震動。
Vibrate(0.1f, 1, 1)
Declaration
public static void Vibrate(float duration, float left, float right, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Vibrate seconds |
System.Single | left | Left side strength (0 to 1) |
System.Single | right | Right side strength (0 to 1) |
System.Int32 | controller | Controller index |
VibrateAxes(Single, Int32)
Vibrate the controller axes.
使控制器軸群震動。
VibrateAxes(0.1f)
Declaration
public static void VibrateAxes(float duration = 0.1F, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Vibrate seconds |
System.Int32 | controller | Controller index |
VibrateAxes(Single, Single, Single, Int32)
Vibrate the controller axes that has 2 vibration motors.
使擁有兩個震動摩打的控制器軸群震動。
VibrateAxes(0.1f, 1, 1)
Declaration
public static void VibrateAxes(float duration, float left, float right, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Vibrate seconds |
System.Single | left | Left side strength (0 to 1) |
System.Single | right | Right side strength (0 to 1) |
System.Int32 | controller | Controller index |
VibrateButtons(Single, Int32)
Vibrate the controller buttons.
使控制器按鈕群震動。
VibrateButtons(0.1f)
Declaration
public static void VibrateButtons(float duration = 0.1F, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Vibrate seconds |
System.Int32 | controller | Controller index |
VibrateButtons(Single, Single, Single, Int32)
Vibrate the controller buttons that has 2 vibration motors.
使擁有兩個震動摩打的控制器按鈕群震動。
VibrateButtons(0.1f, 1, 1)
Declaration
public static void VibrateButtons(float duration, float left, float right, int controller = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Vibrate seconds |
System.Single | left | Left side strength (0 to 1) |
System.Single | right | Right side strength (0 to 1) |
System.Int32 | controller | Controller index |