-
Notifications
You must be signed in to change notification settings - Fork 0
Device Commands
The ButtplugManager actor component provides a set of core functions for triggering generic commands for any compatible device. You can read more about devices and their commands here in the Buttplug docs.
In order to send any command, you'll need a DeviceIndex. You can get a device index from a device within the Devices array.
Triggers a basic vibration on a toy for a given speed in a range of 0.0 to 1.0.
BasicVibrate(int32 DeviceIndex, float Speed);
The following command types are available:
-
LinearCmd- Triggers linear motion on a connected device, such as a thrusting motion -
ScalarCmd- Triggers a scalar value on a connected device, such as vibration intensity -
RotateCmd- Triggers a clockwise or counterclockwise rotation on a device at a specified speed
First, construct one or more ButtplugScalar values. A scalar value contains 3 fields:
-
int32 Index- Index of the actuator -
float Scalar- The level of the actuator within a range of 0.0 - 1.0 -
FString ActuatorType- Type of actuator that the user expects to control with this command. This is to make sure that context is correct between the client and server. (e.g."Vibrate","Inflate")
Next, send the command using the ScalarCmd(int32 DeviceIndex, TArray<FButtplugScalar> Scalars) function.
First, construct one or more ButtplugLinear values. A scalar value contains 3 fields:
-
int32 Index- Index of the actuator -
int32 Duration- Movement time in miliseconds -
float Position- Target position in the range of 0.0 to 1.0.
Next, send the command using the LinearCmd(int32 DeviceIndex, TArray<FButtplugLinear> Linears) function.
First, construct one or more ButtplugRotation values. A scalar value contains 3 fields:
-
int32 Index- Index of the rotation motor -
float Speed- Rotation speed in a range of 0.0 to 1.0 -
bool Clockwise- Direction of rotation (clockwise may be subjective)
Next, send the command using the RotateCmd(int32 DeviceIndex, TArray<FButtplugRotation> Rotations) function.