static private GetTangoEmulation ( Vector3 &posePosition, |
||
posePosition | Vector3 | The new Tango emulation position. |
poseRotation | The new Tango emulation rotation. | |
Результат | void |
/// <summary> /// Fill out <c>poseData</c> with emulated values from Tango. /// </summary> /// <param name="poseData">The poseData to fill out.</param> /// <param name="baseFrame">Base frame to set.</param> /// <param name="targetFrame">Target frame to set.</param> private void FillEmulatedPoseData(ref TangoPoseData poseData, TangoEnums.TangoCoordinateFrameType baseFrame, TangoEnums.TangoCoordinateFrameType targetFrame) { if (poseData == null) { TangoPoseData currentPose = m_poseDataPool.Pop(); if (currentPose != null) { Vector3 position; Quaternion rotation; PoseProvider.GetTangoEmulation(out position, out rotation); currentPose.framePair.baseFrame = baseFrame; currentPose.framePair.targetFrame = targetFrame; currentPose.timestamp = Time.time * 1000; // timestamp is in ms, time is in sec. currentPose.version = 0; // Not actually used currentPose.status_code = TangoEnums.TangoPoseStatusType.TANGO_POSE_VALID; currentPose.translation[0] = position.x; currentPose.translation[1] = position.y; currentPose.translation[2] = position.z; currentPose.orientation[0] = rotation.x; currentPose.orientation[1] = rotation.y; currentPose.orientation[2] = rotation.z; currentPose.orientation[3] = rotation.w; poseData = currentPose; } } }
/// <summary> /// Fill out <c>poseData</c> with emulated values from Tango. /// </summary> /// <param name="poseData">The poseData to fill out.</param> /// <param name="baseFrame">Base frame to set.</param> /// <param name="targetFrame">Target frame to set.</param> private void FillEmulatedPoseData(ref TangoPoseData poseData, TangoEnums.TangoCoordinateFrameType baseFrame, TangoEnums.TangoCoordinateFrameType targetFrame) { Vector3 position; Quaternion rotation; PoseProvider.GetTangoEmulation(out position, out rotation); poseData.framePair.baseFrame = baseFrame; poseData.framePair.targetFrame = targetFrame; poseData.timestamp = Time.time * 1000; // timestamp is in ms, time is in sec. poseData.version = 0; // Not actually used poseData.status_code = TangoEnums.TangoPoseStatusType.TANGO_POSE_VALID; poseData.translation[0] = position.x; poseData.translation[1] = position.y; poseData.translation[2] = position.z; poseData.orientation[0] = rotation.x; poseData.orientation[1] = rotation.y; poseData.orientation[2] = rotation.z; poseData.orientation[3] = rotation.w; }