DualSenseExtension Class |
Namespace: Rewired.ControllerExtensions
public sealed class DualSenseExtension : ControllerExtension, IControllerVibrator, IDualShock4Extension, IDualSenseExtension, IHIDControllerExtension
The DualSenseExtension type exposes the following members.
Name | Description | |
---|---|---|
batteryCharging |
Is the battery charging?
| |
batteryLevel |
Battery level as a percentage. [0 - 100]
| |
controller |
The parent controller of this extension.
(Inherited from ControllerExtension.) | |
lightColorBlue |
Light color blue channel.
| |
lightColorGreen |
Light color green channel.
| |
lightColorRed |
Light color red channel.
| |
maxTouches |
Number of simultaneous touches supported by this device.
| |
microphoneLightMode |
Microphone light mode.
| |
otherLightBrightness |
Player and microphone light brightness level.
| |
playerLights |
Player lights.
| |
touchCount |
The current touch count.
| |
vibrationMotorCount |
The number of vibration motors in this controller.
|
Name | Description | |
---|---|---|
GetAccelerometerValue |
Gets the value from the accelerometer and processes it so that 1G = 1.0 and so that coordinates match Unity coordinate system.
The value returned could be thought of as a gravity vector and user acceleration combined.
If using this value to apply a force in the direction of the vector, invert each axis first.
This value represents the last value reported by the accelerometer.
| |
GetAccelerometerValueRaw |
Gets the raw value from the accelerometer as reported by the device.
Reported device coordinates do not match Unity's coordinate system.
Format: 1G = 8192f
This value represents the last value reported by the accelerometer.
| |
GetGyroscopeValue |
Gets the value from the gyroscope processed into Unity's coordinate system, adjusted for sensitivity, and accumulated over time since the last update.
This value is not fused with the accelerometer value and can drift.
| |
GetGyroscopeValueRaw |
Gets the raw value from the gyroscope as reported by the device accumulated over time since the last update.
Reported device coordinates do not match Unity's coordinate system.
This value is not fused with the accelerometer value and can drift.
| |
GetLastGyroscopeValue |
Gets the last value from the gyroscope processed into Unity's coordinate system and adjusted for sensitivity.
The sensor can return more than one value per frame.
This represents only the last measurement recorded, not an accumulated value.
This value is not fused with the accelerometer value and can drift.
| |
GetLastGyroscopeValueRaw |
Gets the last raw value from the gyroscope as reported by the device.
Reported device coordinates do not match Unity's coordinate system.
The sensor can return more than one value per frame.
This represents only the last measurement recorded, not an accumulated value.
This value is not fused with the accelerometer value and can drift.
| |
GetLightColor |
Gets the current light color.
| |
GetOrientation |
Gets the orientation of the controller in Unity coordinates.
This is only an estimate because accelerometer + gyroscope is not accurate enough to perfectly determine orientation at all angles.
Drift can occur on the world Y axis over time. The orientation can be reset by calling ResetOrientation().
Note: Orientation is not very reliable when connected via Bluetooth due to the possibility of dropped gyro data.
| |
GetTouchId |
Gets the touch id for the touch at the specified index.
| |
GetTouchPosition |
Gets the touch position for a particular index normalized to a 0 - 1 range. (Left = 0, Bottom = 0)
| |
GetTouchPositionAbsolute |
Gets the touch position for a particular index in absolute units as returned by the device. (Left = 0, Bottom = 0)
| |
GetTouchPositionAbsoluteByTouchId |
Gets the touch position for a particular touch id in absolute units as returned by the device. (Left = 0, Bottom = 0)
| |
GetTouchPositionByTouchId |
Gets the touch position for a particular touch id normalized to a 0 - 1 range. (Left = 0, Bottom = 0)
| |
GetTriggerEffectStates |
Gets the current trigger effect states.
| |
GetVibration(Int32) |
Gets vibration level for a motor at a specified index.
| |
GetVibration(DualShock4MotorType) |
Gets vibration level for a specific motor.
| |
GetVibrationMode |
Gets the vibration mode for the gamepad.
| |
IsTouching |
Determines if the current touch id is valid for any currently active touch.
| |
IsTouchingByTouchId |
Determines if the current touch id is valid for any currently active touch.
| |
ResetOrientation |
Resets the orientation to zero state. (Controller laying on back with buttons facing up and the top edge of the controller facing the screen.)
| |
SetLightColor(Color) |
Sets the light color. Alpha can be used to set intensity.
| |
SetLightColor(Single, Single, Single) |
Sets the light color.
| |
SetLightColor(Single, Single, Single, Single) |
Sets the light color.
| |
SetTriggerEffect |
Sets a trigger effect.
| |
SetVibration(Int32, Single) |
Sets vibration level for a motor at a specified index.
| |
SetVibration(Single, Single) |
Sets vibration level for left and right motors.
| |
SetVibration(DualShock4MotorType, Single) |
Sets vibration leves on an individual motor.
| |
SetVibration(Int32, Single, Boolean) |
Sets vibration level for a motor at a specified index.
| |
SetVibration(Int32, Single, Single) |
Sets vibration level for a motor at a specified index with a timeout.
| |
SetVibration(DualShock4MotorType, Single, Boolean) |
Sets vibration level on an individual motor.
| |
SetVibration(DualShock4MotorType, Single, Single) |
Sets vibration leves on an individual motor.
| |
SetVibration(Int32, Single, Single, Boolean) |
Sets vibration level for a motor at a specified index with a timeout.
| |
SetVibration(Single, Single, Single, Single) |
Sets vibration level for left and right motors.
| |
SetVibration(DualShock4MotorType, Single, Single, Boolean) |
Sets vibration level on an individual motor.
| |
SetVibrationMode |
Sets the vibration mode for the gamepad.
| |
StopVibration |
Stops vibration on all motors.
|