public bool StartHapticImpulse(float intensity, float durationInSeconds = Single.MaxValue) { #if PLATFORM_LUMIN MLInput.Controller.FeedbackIntensity mlIntensity = (MLInput.Controller.FeedbackIntensity)((int)(intensity * 2.0f)); var result = mlController.StartFeedbackPatternVibe(MLInput.Controller.FeedbackPatternVibe.Buzz, mlIntensity); return(result == MLResult.Code.Ok); #else return(false); #endif }
/// <summary> /// Handles the event for trigger down. /// </summary> /// <param name="controller_id">The id of the controller.</param> /// <param name="value">The value of the trigger button.</param> private void HandleOnTriggerDown(byte controllerId, float value) { MLInput.Controller controller = _controllerConnectionHandler.ConnectedController; #if PLATFORM_LUMIN if (controller != null && controller.Id == controllerId) { MLInput.Controller.FeedbackIntensity intensity = (MLInput.Controller.FeedbackIntensity)((int)(value * 2.0f)); controller.StartFeedbackPatternVibe(MLInput.Controller.FeedbackPatternVibe.Buzz, intensity); } #endif }
public static extern bool MLInputStartControllerFeedbackPatternVibe(byte controllerId, MLInput.Controller.FeedbackPatternVibe pattern, MLInput.Controller.FeedbackIntensity intensity);
//Public Methods: public void StartHaptic(MLInput.Controller.FeedbackPatternVibe vibe, MLInput.Controller.FeedbackIntensity intensity) { controlInput.Control.StartFeedbackPatternVibe(vibe, intensity); }
//Constructors: public HapticSetting(bool enabled, MLInput.Controller.FeedbackPatternVibe pattern, MLInput.Controller.FeedbackIntensity intensity) { this.enabled = enabled; this.pattern = pattern; this.intensity = intensity; }