示例#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);
     }
 }
示例#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)
         });
     }
 }
示例#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");
        }
示例#4
0
 public static extern Bool ovrp_SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer);
示例#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;
     }
 }
示例#6
0
 public static extern Bool ovrp_SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer);
示例#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);
 }