How to use the buttplug.VorzeA10CycloneCmd function in buttplug

To help you get started, we’ve selected a few buttplug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github metafetish / syncydink / src / utils / HapticsToButtplug.ts View on Github external
timeDelta = currentTime - lastTime;
      // If more than a certain amount of time exists between 2 commands, add a command to stop after the last
      if (timeDelta > 10000) {
        commands.set(lastTime + timeDelta + 1, [new VorzeA10CycloneCmd(0, true)]);
      }

      // We still need to calulate the Launch speed from the commands to set vorze speed.
      positionDelta = Math.abs(currentPosition - lastPosition);
      speed = Math.floor(25000 * Math.pow(((timeDelta * 90) / positionDelta), -1.05));

      commands.set(currentTime, [new VorzeA10CycloneCmd(speed, lastPosition > currentPosition)]);
      lastTime = currentTime;
      lastPosition = currentPosition;
    }
    // Make sure we stop the Vorze at the end
    commands.set(lastTime + 100, [new VorzeA10CycloneCmd(0, true)]);
    return commands;
  }
github metafetish / syncydink / src / utils / HapticsToButtplug.ts View on Github external
for (const aCommand of aCommands) {
      currentTime = aCommand.Time;
      currentPosition = aCommand.Position;

      timeDelta = currentTime - lastTime;
      // If more than a certain amount of time exists between 2 commands, add a command to stop after the last
      if (timeDelta > 10000) {
        commands.set(lastTime + timeDelta + 1, [new VorzeA10CycloneCmd(0, true)]);
      }

      // We still need to calulate the Launch speed from the commands to set vorze speed.
      positionDelta = Math.abs(currentPosition - lastPosition);
      speed = Math.floor(25000 * Math.pow(((timeDelta * 90) / positionDelta), -1.05));

      commands.set(currentTime, [new VorzeA10CycloneCmd(speed, lastPosition > currentPosition)]);
      lastTime = currentTime;
      lastPosition = currentPosition;
    }
    // Make sure we stop the Vorze at the end
    commands.set(lastTime + 100, [new VorzeA10CycloneCmd(0, true)]);
    return commands;
  }