|
@@ -222,6 +222,16 @@ public:
|
|
|
/// Linear interpolation with another vector.
|
|
/// Linear interpolation with another vector.
|
|
|
Vector3 Lerp(const Vector3& rhs, float t) const { return *this * (1.0f - t) + rhs * t; }
|
|
Vector3 Lerp(const Vector3& rhs, float t) const { return *this * (1.0f - t) + rhs * t; }
|
|
|
|
|
|
|
|
|
|
+ Vector3 ClampedLerp(const Vector3& rhs, float t) const
|
|
|
|
|
+ {
|
|
|
|
|
+ if (t > 1)
|
|
|
|
|
+ t = 1;
|
|
|
|
|
+ else if (t < 0)
|
|
|
|
|
+ t = 0;
|
|
|
|
|
+
|
|
|
|
|
+ return *this * (1.0f - t) + rhs * t;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// Test for equality with another vector with epsilon.
|
|
/// Test for equality with another vector with epsilon.
|
|
|
bool Equals(const Vector3& rhs) const
|
|
bool Equals(const Vector3& rhs) const
|
|
|
{
|
|
{
|