protected void Awake()
        {
            _skeleton = HandSkeletonOVR.CreateSkeletonData(_handedness);
            TrackingToWorldTransformer = _trackingToWorldTransformer as ITrackingToWorldTransformer;
            HmdData      = _hmdData as IDataSource <HmdDataAsset>;
            CameraRigRef = _cameraRigRef as IOVRCameraRigRef;

            UpdateConfig();
        }
Exemplo n.º 2
0
            public HandSkeletonReflection(HandSkeleton handSkeleton)
            {
                HandSkeleton = handSkeleton;

                var attachBonesToMeshMethod = typeof(HandSkeleton)
                                              .GetMethod("AttacheBonesToMesh", BindingFlags.Instance | BindingFlags.NonPublic);

                AttacheBonesToMeshFunc = (Func <bool>)
                                         Delegate.CreateDelegate(typeof(Func <bool>), handSkeleton, attachBonesToMeshMethod);

                SetIsInitializedFunc = typeof(HandSkeleton).CreateSetFieldDelegate <HandSkeleton, bool>("_isInitialized");
            }
Exemplo n.º 3
0
        public static HandSkeleton CreateSkeletonData(Handedness handedness)
        {
            HandSkeleton handSkeleton = new HandSkeleton();

            // When running in the editor, the call to load the skeleton from OVRPlugin may fail. Use baked skeleton
            // data.
            if (handedness == Handedness.Left)
            {
                ApplyToSkeleton(OVRSkeletonData.LeftSkeleton, handSkeleton);
            }
            else
            {
                ApplyToSkeleton(OVRSkeletonData.RightSkeleton, handSkeleton);
            }

            return(handSkeleton);
        }