////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class RayExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
///
/// Converts a Ray to a Pose based on its origin and direction
/// vectors.
///
///
///
/// Pose initialized based on the origin and direction of the Ray.
///
public static Pose ToPose(this Ray ray, Vector3 up)
{
return new Pose(
ray.origin, Quaternion.LookRotation(ray.direction, up));
}
}
}