using UnityEngine; namespace EZCameraShake { public class CameraUtilities { /// /// Smoothes a Vector3 that represents euler angles. /// /// The current Vector3 value. /// The target Vector3 value. /// A refernce Vector3 used internally. /// The time to smooth, in seconds. /// The smoothed Vector3 value. public static Vector3 SmoothDampEuler(Vector3 current, Vector3 target, ref Vector3 velocity, float smoothTime) { Vector3 v; v.x = Mathf.SmoothDampAngle(current.x, target.x, ref velocity.x, smoothTime); v.y = Mathf.SmoothDampAngle(current.y, target.y, ref velocity.y, smoothTime); v.z = Mathf.SmoothDampAngle(current.z, target.z, ref velocity.z, smoothTime); return v; } /// /// Multiplies each element in Vector3 v by the corresponding element of w. /// public static Vector3 MultiplyVectors(Vector3 v, Vector3 w) { v.x *= w.x; v.y *= w.y; v.z *= w.z; return v; } } }