protected void Awake() { _skeleton = HandSkeletonOVR.CreateSkeletonData(_handedness); TrackingToWorldTransformer = _trackingToWorldTransformer as ITrackingToWorldTransformer; HmdData = _hmdData as IDataSource <HmdDataAsset>; CameraRigRef = _cameraRigRef as IOVRCameraRigRef; UpdateConfig(); }
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"); }
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); }