Esempio n. 1
0
 public static bool SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer)
 {
     if (version >= OVRP_1_6_0.version)
     {
         return(OVRP_1_6_0.ovrp_SetControllerHaptics(controllerMask, hapticsBuffer) == Bool.True);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
 static void Postfix(uint controllerMask, HapticsBuffer hapticsBuffer)
 {
     // TODO This won't work if SampleSize != 1. Check Sample Size somewhere.
     byte[] clipBuffer = new byte[hapticsBuffer.SamplesCount];
     Marshal.Copy(hapticsBuffer.Samples, clipBuffer, 0, hapticsBuffer.SamplesCount);
     // If the buffer is nothing but 0s, we don't care about it.
     if (clipBuffer.Max() != 0)
     {
         WriteToStream(new GHRProtocolMessageContainer {
             UnityXROculusClipHaptics = new UnityXROculusClipHaptics(HandSpec.LEFT, clipBuffer)
         });
     }
 }
Esempio n. 3
0
        public void Session_SubmitControllerVibration()
        {
            IntPtr sessionPtr = CreateSession();

            Assert.AreNotEqual(IntPtr.Zero, sessionPtr);

            byte[] samples  = { 0, 64, 128, 255 };
            var    gcHandle = GCHandle.Alloc(samples, GCHandleType.Pinned);

            var hapticsBuffer = new HapticsBuffer()
            {
                Samples      = gcHandle.AddrOfPinnedObject(),
                SamplesCount = samples.Length,
                SubmitMode   = HapticsBufferSubmitMode.Enqueue
            };

            Result result = OVR.SubmitControllerVibration(sessionPtr, ControllerType.LTouch, hapticsBuffer);

            gcHandle.Free();

            Assert.IsTrue(result >= Result.Success, "Failed to SubmitControllerVibration");
        }
Esempio n. 4
0
 public static extern Bool ovrp_SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer);
Esempio n. 5
0
 public static bool SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer)
 {
     if (version >= OVRP_1_6_0.version)
     {
         return OVRP_1_6_0.ovrp_SetControllerHaptics(controllerMask, hapticsBuffer) == Bool.True;
     }
     else
     {
         return false;
     }
 }
Esempio n. 6
0
 public static extern Bool ovrp_SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer);
Esempio n. 7
0
 public static extern Result ovr_SubmitControllerVibration(ovrSession session, ControllerType controllerType, ref HapticsBuffer buffer);
 public static bool SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer)
 {
     return(ovrp_SetControllerHaptics(controllerMask, hapticsBuffer) == Bool.True);
 }