コード例 #1
0
     internal static unsafe void Invoke(IntPtr obj, EControllerHand NewSource) {
         long* p = stackalloc long[] {0L,0L};
         byte* b = (byte*) p;
         *(b+0) = (byte)NewSource;
         Main.GetProcessEvent(obj, SetTrackingSource_ptr, new IntPtr(p)); ;
     }
 }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: jcoder58/Plugins
            internal static unsafe void Invoke(IntPtr obj, EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                Main.GetProcessEvent(obj, StopHapticEffect_ptr, new IntPtr(p));;
            }
        }
コード例 #3
0
            internal static unsafe void Invoke(int PlayerIndex, EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((int *)(b + 0)) = PlayerIndex;
                *(b + 4)          = (byte)Hand;
                Main.GetProcessEvent(MotionTrackedDeviceFunctionLibrary.DefaultObject, DisableMotionTrackingOfDevice_ptr, new IntPtr(p));;
            }
        }
コード例 #4
0
            internal static unsafe (Vector, bool) Invoke(EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                Main.GetProcessEvent(MagicLeapHandTrackingFunctionLibrary.DefaultObject, GetHandCenterNormalized_ptr, new IntPtr(p));;
                return(*((Vector *)(b + 4)), *((bool *)(b + 16)));
            }
        }
コード例 #5
0
            internal static unsafe (float, bool) Invoke(EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                Main.GetProcessEvent(MagicLeapHandTrackingFunctionLibrary.DefaultObject, GetCurrentGestureConfidence_ptr, new IntPtr(p));;
                return(*((float *)(b + 4)), *((bool *)(b + 8)));
            }
        }
コード例 #6
0
            internal static unsafe EMLControllerType Invoke(EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                Main.GetProcessEvent(MagicLeapControllerFunctionLibrary.DefaultObject, GetMLControllerType_ptr, new IntPtr(p));;
                return(*((EMLControllerType *)(b + 1)));
            }
        }
コード例 #7
0
            internal static unsafe (IReadOnlyCollection <Transform>, bool) Invoke(EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                Main.GetProcessEvent(MagicLeapHandTrackingFunctionLibrary.DefaultObject, GetGestureKeypoints_ptr, new IntPtr(p));;
                //TODO: array TArray Keypoints
                return(UObject.ToUnmangedCollection <Transform>(b + 8), *((bool *)(b + 24)));
            }
        }
コード例 #8
0
            internal static unsafe (Transform, bool) Invoke(EControllerHand Hand, EGestureTransformSpace TransformSpace)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                *(b + 1) = (byte)TransformSpace;
                Main.GetProcessEvent(MagicLeapHandTrackingFunctionLibrary.DefaultObject, GetHandThumbTip_ptr, new IntPtr(p));;
                return(*((Transform *)(b + 16)), *((bool *)(b + 64)));
            }
        }
コード例 #9
0
            internal static unsafe bool Invoke(int PlayerIndex, EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((int *)(b + 0)) = PlayerIndex;
                *(b + 4)          = (byte)Hand;
                Main.GetProcessEvent(MotionTrackedDeviceFunctionLibrary.DefaultObject, IsMotionTrackingEnabledForDevice_ptr, new IntPtr(p));;
                return(*((bool *)(b + 5)));
            }
        }
コード例 #10
0
            internal static unsafe bool Invoke(EControllerHand Hand, EMLControllerHapticPattern HapticPattern, EMLControllerHapticIntensity Intensity)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)Hand;
                *(b + 1) = (byte)HapticPattern;
                *(b + 2) = (byte)Intensity;
                Main.GetProcessEvent(MagicLeapControllerFunctionLibrary.DefaultObject, PlayControllerHapticFeedback_ptr, new IntPtr(p));;
                return(*((bool *)(b + 3)));
            }
        }
コード例 #11
0
            internal static unsafe bool Invoke(EControllerHand Hand, EMLControllerLEDPattern LEDPattern, EMLControllerLEDColor LEDColor, float DurationInSec)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0)            = (byte)Hand;
                *(b + 1)            = (byte)LEDPattern;
                *(b + 2)            = (byte)LEDColor;
                *((float *)(b + 4)) = DurationInSec;
                Main.GetProcessEvent(MagicLeapControllerFunctionLibrary.DefaultObject, PlayControllerLED_ptr, new IntPtr(p));;
                return(*((bool *)(b + 8)));
            }
        }
コード例 #12
0
            internal static unsafe (Vector, Rotator, bool) Invoke(int ControllerIndex, EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((int *)(b + 0)) = ControllerIndex;
                *(b + 4)          = (byte)Hand;
                Main.GetProcessEvent(SteamVRFunctionLibrary.DefaultObject, GetHandPositionAndOrientation_ptr, new IntPtr(p));;
                return(*((Vector *)(b + 8)), *((Rotator *)(b + 20)), *((bool *)(b + 32)));
            }
        }
コード例 #13
0
 ///<summary>List of keypoints detected on the given hand.</summary>
 ///<remarks>
 ///Note that this returns a transform in the Tracking space. To get the transform in Unreal's
 ///world space, use the MotioController component as a child of the XRPawn with hand set to the following.
 ///Special_3 - Left Index Finger Tip
 ///Special_5 - Left Thumb Tip
 ///Special_4 - Right Index Finger Tip
 ///Special_6 - Right Thumb Tip
 ///
 ///@param Hand Hand to query the keypoints for. Only Left and Right hand are supported.
 ///@param Keypoints Output parameter containing transforms of the keypoints detected on the given hand.
 ///@return true if the output param was populated with a valid value, false otherwise.
 ///</remarks>
 public static (IReadOnlyCollection <Transform>, bool) GetGestureKeypoints(EControllerHand Hand) =>
 MagicLeapHandTrackingFunctionLibrary_methods.GetGestureKeypoints_method.Invoke(Hand);
コード例 #14
0
 ///<summary>Enable tracking of the specified controller, by player index and tracked device type.</summary>
 ///<remarks>
 ///@param PlayerIndex                                   (in) The index of the player.
 ///@param Hand                                                  (in) The device type.
 ///
 ///@return (Boolean) true if the specified device is now set to be tracked.  This could fail due to tracking limits, or on invalid input.
 ///</remarks>
 public static bool EnableMotionTrackingOfDevice(int PlayerIndex, EControllerHand Hand) =>
 MotionTrackedDeviceFunctionLibrary_methods.EnableMotionTrackingOfDevice_method.Invoke(PlayerIndex, Hand);
コード例 #15
0
 ///<summary>Get Transform for a point on the hand.</summary>
 ///<remarks>
 ///@param Hand
 ///@param Keypoint the specific joint or wrist point to fetch.
 ///@param Transform Output parameter to write the data to.
 ///@param TransformSpace Get the transform relative to the world, hand center, or tracking space.
 ///@return true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.
 ///</remarks>
 public static (Transform, bool) GetGestureKeypointTransform(EControllerHand Hand, EHandTrackingKeypoint Keypoint, EGestureTransformSpace TransformSpace) =>
 MagicLeapHandTrackingFunctionLibrary_methods.GetGestureKeypointTransform_method.Invoke(Hand, Keypoint, TransformSpace);
コード例 #16
0
ファイル: PlayerController.cs プロジェクト: jcoder58/Plugins
            internal static unsafe void Invoke(IntPtr obj, float Frequency, float Amplitude, EControllerHand Hand)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((float *)(b + 0)) = Frequency;
                *((float *)(b + 4)) = Amplitude;
                *(b + 8)            = (byte)Hand;
                Main.GetProcessEvent(obj, SetHapticsByValue_ptr, new IntPtr(p));;
            }
        }
コード例 #17
0
ファイル: PlayerController.cs プロジェクト: jcoder58/Plugins
            internal static unsafe void Invoke(IntPtr obj, HapticFeedbackEffect_Base HapticEffect, EControllerHand Hand, float Scale, bool bLoop)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = HapticEffect;
                *(b + 8)             = (byte)Hand;
                *((float *)(b + 12)) = Scale;
                *((bool *)(b + 16))  = bLoop;
                Main.GetProcessEvent(obj, PlayHapticEffect_ptr, new IntPtr(p));;
            }
        }
コード例 #18
0
 ///<summary>Transform of the center of the hand.</summary>
 ///<remarks>
 ///Approximately the center of the palm.
 ///
 ///Note that this returns a transform in world space.
 ///
 ///@param Hand Hand to query the hand center transform for. Only Left and Right hand are supported.
 ///@param HandCenter Output parameter containing the position and orientation of the given hand.
 ///@return true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.
 ///</remarks>
 public static (Transform, bool) GetHandCenter(EControllerHand Hand) =>
 MagicLeapHandTrackingFunctionLibrary_methods.GetHandCenter_method.Invoke(Hand);
コード例 #19
0
 ///<summary>Play haptic feedback on the controller.</summary>
 ///<remarks>
 ///@param Hand Controller to play the haptic feedback on.
 ///@param HapticPattern Pattern to play on the controller.
 ///@param Intensity Intensity to play on the controller.
 ///@return True if the command to play the haptic feedback was successfully sent to the controller, false otherwise.
 ///</remarks>
 public static bool PlayControllerHapticFeedback(EControllerHand Hand, EMLControllerHapticPattern HapticPattern, EMLControllerHapticIntensity Intensity) =>
 MagicLeapControllerFunctionLibrary_methods.PlayControllerHapticFeedback_method.Invoke(Hand, HapticPattern, Intensity);
コード例 #20
0
 ///<summary>The confidence level of the current gesture being performed by the given hand.</summary>
 ///<remarks>
 ///Value is between [0, 1], 0 is low, 1 is high degree of confidence. For a NoHand, the confidence is always set to 1.
 ///
 ///@param Hand Hand to query the gesture confidence value for. Only Left and Right hand are supported.
 ///@param Confidence Output parameter containing the confidence value for the given hand's gesture.
 ///@return true if the output param was populated with a valid value, false otherwise.
 ///</remarks>
 public static (float, bool) GetCurrentGestureConfidence(EControllerHand Hand) =>
 MagicLeapHandTrackingFunctionLibrary_methods.GetCurrentGestureConfidence_method.Invoke(Hand);
コード例 #21
0
 ///<summary>Normalized position of the center of the given hand.</summary>
 ///<remarks>
 ///This can be used to detect and warn the users that the hand is out of the gesture detection frame.
 ///
 ///@param Hand Hand to query the normalized hand center position for. Only Left and Right hand are supported.
 ///@param HandCenterNormalized Output paramter containing the normalized position of the given hand.
 ///@return true if the output param was populated with a valid value, false otherwise.
 ///</remarks>
 public static (Vector, bool) GetHandCenterNormalized(EControllerHand Hand) =>
 MagicLeapHandTrackingFunctionLibrary_methods.GetHandCenterNormalized_method.Invoke(Hand);
コード例 #22
0
 ///<summary>Transform of Thumb Tip.</summary>
 ///<remarks>
 ///Note that this returns a transform in the Tracking space. To get the transform in Unreal's
 ///world space, use the MotioController component as a child of the XRPawn with hand set to EControllerHand::Special_5
 ///for the left hand secondary and EControllerHand::Special_6 for the right hand secondary.
 ///
 ///@param Hand Hand to query the hand center transform for. Only Left and Right hand are supported.
 ///@param TransformSpace Get the transform relative to the world, hand center, or tracking space.
 ///@param Secondary Output parameter containing the position and orientation.
 ///@return true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.
 ///</remarks>
 public static (Transform, bool) GetHandThumbTip(EControllerHand Hand, EGestureTransformSpace TransformSpace) =>
 MagicLeapHandTrackingFunctionLibrary_methods.GetHandThumbTip_method.Invoke(Hand, TransformSpace);
コード例 #23
0
 ///<summary>
 ///Given a controller index and a hand, returns the position and orientation of the controller
 ///@
 ///</summary>
 ///<remarks>
 ///param       ControllerIndex Index of the controller to get the tracked device ID for
 ///@param       Hand                    Which hand's controller to get the position and orientation for
 ///@param       OutPosition             (out) Current position of the device
 ///@param       OutRotation             (out) Current rotation of the device
 ///@return      True if the specified controller index has a valid tracked device ID
 ///</remarks>
 public static (Vector, Rotator, bool) GetHandPositionAndOrientation(int ControllerIndex, EControllerHand Hand) =>
 SteamVRFunctionLibrary_methods.GetHandPositionAndOrientation_method.Invoke(ControllerIndex, Hand);
コード例 #24
0
 ///<summary>Starts a LED feedback effect using the specified pattern on the specified controller.</summary>
 ///<remarks>
 ///@param Hand Controller to play the LED pattern on.
 ///@param LEDEffect Effect to play on the controller.
 ///@param LEDSpeed Effect speed.
 ///@param LEDPattern Pattern to play on the controller.
 ///@param LEDColor Color of the LED.
 ///@param DurationInSec Duration (in seconds) to play the LED pattern.
 ///@return True if the command to play the LED effect was successfully sent to the controller, false otherwise.
 ///</remarks>
 public static bool PlayControllerLEDEffect(EControllerHand Hand, EMLControllerLEDEffect LEDEffect, EMLControllerLEDSpeed LEDSpeed, EMLControllerLEDPattern LEDPattern, EMLControllerLEDColor LEDColor, float DurationInSec) =>
 MagicLeapControllerFunctionLibrary_methods.PlayControllerLEDEffect_method.Invoke(Hand, LEDEffect, LEDSpeed, LEDPattern, LEDColor, DurationInSec);
コード例 #25
0
 ///<summary>Set Tracking Source</summary>
 public void SetTrackingSource(EControllerHand NewSource) =>
 MotionControllerComponent_methods.SetTrackingSource_method.Invoke(ObjPointer, NewSource);
コード例 #26
0
 ///<summary>Type of ML device being tracking the given hand.</summary>
 ///<remarks>
 ///@param Hand Controller hand to query.
 ///@return Type of ML device which maps to given Unreal controller hand.
 ///</remarks>
 public static EMLControllerType GetMLControllerType(EControllerHand Hand) =>
 MagicLeapControllerFunctionLibrary_methods.GetMLControllerType_method.Invoke(Hand);