3using System.Globalization;
36 return new Vector3(0f - a.
x, 0f - a.
y, 0f - a.
z);
135 return new Vector3(a.
x + (b.
x - a.
x) * t, a.
y + (b.
y - a.
y) * t, a.
z + (b.
z - a.
z) * t);
146 return new Vector3(a.
x + (b.
x - a.
x) * t, a.
y + (b.
y - a.
y) * t, a.
z + (b.
z - a.
z) * t);
162 return x.GetHashCode() ^ (
y.GetHashCode() << 2) ^ (
z.GetHashCode() >> 2);
169 public override bool Equals(
object other)
180 return x.Equals(other.
x) &&
y.Equals(other.
y) &&
z.Equals(other.
z);
190 return new Vector3(lhs.
y * rhs.
z - lhs.
z * rhs.
y, lhs.
z * rhs.
x - lhs.
x * rhs.
z, lhs.
x * rhs.
y - lhs.
y * rhs.
x);
200 return -2f *
Dot(inNormal, inDirection) * inNormal + inDirection;
237 return lhs.
x * rhs.
x + lhs.
y * rhs.
y + lhs.
z * rhs.
z;
247 float num =
Dot(onNormal, onNormal);
252 return onNormal *
Dot(vector, onNormal) / num;
262 return vector -
Project(vector, planeNormal);
292 float num =
Angle(from, to);
305 return Mathf.
Sqrt(vector.
x * vector.
x + vector.
y * vector.
y + vector.
z * vector.
z);
324 return Mathf.
Sqrt(vector.
x * vector.
x + vector.
y * vector.
y + vector.
z * vector.
z);
329 return vector.
x * vector.
x + vector.
y * vector.
y + vector.
z * vector.
z;
358 return String.Format(
"({0:F4}, {1:F4}, {2:F4})",
x,
y,
z);
367 return String.Format(
"({0}, {1}, {2})",
x.ToString(format, CultureInfo.InvariantCulture.NumberFormat),
y.ToString(format, CultureInfo.InvariantCulture.NumberFormat),
z.ToString(format, CultureInfo.InvariantCulture.NumberFormat));
static float Acos(float f)
static float Min(float a, float b)
static float Clamp(float value, float min, float max)
static float Max(float a, float b)
static float Sqrt(float f)
static float Clamp01(float value)
static float Sign(float f)
static Vector3 Normalize(Vector3 value)
override bool Equals(object other)
static float Magnitude(Vector3 vector)
static float SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
static Vector3 LerpUnclamped(Vector3 a, Vector3 b, float t)
bool Equals(Vector3 other)
static Vector3 Lerp(Vector3 a, Vector3 b, float t)
const float kEpsilonNormalSqrt
static float SqrMagnitude(Vector3 vector)
static Vector3 ClampMagnitude(Vector3 vector, float maxLength)
void Scale(Vector3 scale)
static Vector3 Min(Vector3 lhs, Vector3 rhs)
static float Distance(Vector3 a, Vector3 b)
static Vector3 Max(Vector3 lhs, Vector3 rhs)
static bool operator!=(Vector3 lhs, Vector3 rhs)
static Vector3 operator+(Vector3 a, Vector3 b)
static float Dot(Vector3 lhs, Vector3 rhs)
static float Angle(Vector3 from, Vector3 to)
static Vector3 operator*(Vector3 a, float b)
static Vector3 operator-(Vector3 a, Vector3 b)
override int GetHashCode()
override string ToString()
static Vector3 ProjectOnPlane(Vector3 vector, Vector3 planeNormal)
static Vector3 positiveInfinity
static Vector3 Reflect(Vector3 inDirection, Vector3 inNormal)
Vector3(float x, float y, float z)
static bool operator==(Vector3 lhs, Vector3 rhs)
string ToString(string format)
static Vector3 negativeInfinity
static Vector3 Project(Vector3 vector, Vector3 onNormal)
static Vector3 Cross(Vector3 lhs, Vector3 rhs)
static Vector3 operator/(Vector3 a, float d)