/// <summary> /// Check whether or not the pose for a specified TrackerTarget is valid /// for the current frame. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <returns>True if the pose is valid, false otherwise.</returns> public bool IsTrackerTargetPoseValid(TrackerTargetType trackerTargetType) { return _isTrackerTargetPoseValid[(int)trackerTargetType]; }
/// <summary> /// Set whether or not pose buffering is enabled for a specified TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <param name="isPoseBufferingEnabled">Flag denoting whether or not to enable pose buffering.</param> public void SetTrackerTargetPoseBufferingEnabled(TrackerTargetType trackerTargetType, bool isPoseBufferingEnabled) { zsup_setTrackerTargetPoseBufferingEnabled((int)trackerTargetType, isPoseBufferingEnabled); }
/// <summary> /// Check whether or not a specified target button is pressed. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <param name="buttonId">The id of the button.</param> /// <returns>True if the button is pressed, false otherwise.</returns> public bool IsTrackerTargetButtonPressed(TrackerTargetType trackerTargetType, int buttonId) { return zsup_isTrackerTargetButtonPressed((int)trackerTargetType, buttonId); }
/// <summary> /// Check whether or not pose buffering is enabled for a specified TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <returns>True if pose buffering is enabled. False if not.</returns> public bool IsTrackerTargetPoseBufferingEnabled(TrackerTargetType trackerTargetType) { return zsup_isTrackerTargetPoseBufferingEnabled((int)trackerTargetType); }
/// <summary> /// Get the tracker space pose of a specified default TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <returns>The Matrix4x4 pose in tracker space.</returns> public Matrix4x4 GetTrackerTargetPose(TrackerTargetType trackerTargetType) { return _trackerTargetPoses[(int)trackerTargetType]; }
/// <summary> /// Get the world space pose of a specified default TrackerTarget. /// This forces a recalculation based on the current camera's local /// to world matrix. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <returns>The Matrix4x4 pose in world space.</returns> public Matrix4x4 GetTrackerTargetWorldPose(TrackerTargetType trackerTargetType) { Matrix4x4 trackerTargetWorldPose = _trackerTargetCameraPoses[(int)trackerTargetType]; // Scale the position based on world and field of view scales. trackerTargetWorldPose[0, 3] *= this.WorldScale * this.FieldOfViewScale; trackerTargetWorldPose[1, 3] *= this.WorldScale * this.FieldOfViewScale; trackerTargetWorldPose[2, 3] *= this.WorldScale; // Convert the camera space pose to world space. if (this.IsCurrentCameraValid()) trackerTargetWorldPose = this.CurrentCamera.transform.localToWorldMatrix * trackerTargetWorldPose; return trackerTargetWorldPose; }
/// <summary> /// Get the world space buffered pose of a specified default TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <param name="lookBackTime"></param> /// <returns></returns> public Matrix4x4 GetTrackerTargetBufferedWorldPose(TrackerTargetType trackerTargetType, float lookBackTime) { float[] matrixData = new float[16]; zsup_getTrackerTargetBufferedCameraPose((int)trackerTargetType, lookBackTime, matrixData); Matrix4x4 trackerTargetWorldPose = ZSCore.ConvertFromRightToLeft(this.ConvertToMatrix4x4(matrixData)); // Scale the position based on world and field of view scales. trackerTargetWorldPose[0, 3] *= this.WorldScale * this.FieldOfViewScale; trackerTargetWorldPose[1, 3] *= this.WorldScale * this.FieldOfViewScale; trackerTargetWorldPose[2, 3] *= this.WorldScale; // Convert the camera space pose to world space. if (this.IsCurrentCameraValid()) trackerTargetWorldPose = CurrentCamera.transform.localToWorldMatrix * trackerTargetWorldPose; return trackerTargetWorldPose; }
/// <summary> /// Get the tracker space buffered pose of a specified default TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <param name="lookBackTime"></param> /// <returns></returns> public Matrix4x4 GetTrackerTargetBufferedPose(TrackerTargetType trackerTargetType, float lookBackTime) { float[] matrixData = new float[16]; zsup_getTrackerTargetBufferedPose((int)trackerTargetType, lookBackTime, matrixData); return this.ConvertToMatrix4x4(matrixData); }
/// <summary> /// Get the camera space buffered pose of a specified default TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <param name="lookBackTime"></param> /// <returns></returns> public Matrix4x4 GetTrackerTargetBufferedCameraPose(TrackerTargetType trackerTargetType, float lookBackTime) { float[] matrixData = new float[16]; zsup_getTrackerTargetBufferedCameraPose((int)trackerTargetType, lookBackTime, matrixData); Matrix4x4 trackerTargetCameraPose = ZSCore.ConvertFromRightToLeft(this.ConvertToMatrix4x4(matrixData)); return trackerTargetCameraPose; }
/// <summary> /// Get the number of buttons associated with a specified TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of the TrackerTarget.</param> /// <returns>The number of buttons contained by a TrackerTarget.</returns> public int GetNumTrackerTargetButtons(TrackerTargetType trackerTargetType) { return zsup_getNumTrackerTargetButtons((int)trackerTargetType); }
/// <summary> /// Get the cached world space pose of a specified default TrackerTarget. /// </summary> /// <param name="trackerTargetType">The type of TrackerTarget.</param> /// <returns>The Matrix4x4 pose in world space.</returns> public Matrix4x4 GetCachedTrackerTargetWorldPose(TrackerTargetType trackerTargetType) { return _trackerTargetWorldPoses[(int)trackerTargetType]; }