Struct Vector3
- Namespace
- Lime
- Assembly
- Lime.dll
Representation of 3D vectors and points.
public struct Vector3 : IEquatable<Vector3>
- Implements
- Inherited Members
Constructors
Vector3(Vector2, float)
public Vector3(Vector2 xy, float z)
Parameters
Vector3(float)
public Vector3(float xyz)
Parameters
xyz
float
Vector3(float, float, float)
public Vector3(float x, float y, float z)
Parameters
Fields
Half
Returns a vector with components 0.5, 0.5, 0.5.
public static readonly Vector3 Half
Field Value
NaN
Returns a vector with components NaN, NaN, NaN.
public static readonly Vector3 NaN
Field Value
One
Returns a vector with components 1, 1, 1.
public static readonly Vector3 One
Field Value
UnitX
public static readonly Vector3 UnitX
Field Value
UnitY
public static readonly Vector3 UnitY
Field Value
UnitZ
public static readonly Vector3 UnitZ
Field Value
X
[YuzuMember("0")]
public float X
Field Value
Y
[YuzuMember("1")]
public float Y
Field Value
Z
[YuzuMember("2")]
public float Z
Field Value
Zero
Returns a vector with components 0, 0, 0.
public static readonly Vector3 Zero
Field Value
Properties
this[int]
Gets or sets the vector component by its index.
public float this[int component] { get; set; }
Parameters
component
int
Property Value
Length
public float Length { get; }
Property Value
Normalized
Returns this Vector3 as a unit vector with the same direction.
public Vector3 Normalized { get; }
Property Value
SqrLength
public float SqrLength { get; }
Property Value
Methods
CrossProduct(Vector3, Vector3)
public static Vector3 CrossProduct(Vector3 value1, Vector3 value2)
Parameters
Returns
DotProduct(Vector3, Vector3)
public static float DotProduct(Vector3 value1, Vector3 value2)
Parameters
Returns
Equals(Vector3)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Vector3 other)
Parameters
other
Vector3An object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Lerp(float, Vector3, Vector3)
Creates a new Vector3 that contains linear interpolation of the specified vectors.
public static Vector3 Lerp(float amount, Vector3 value1, Vector3 value2)
Parameters
amount
floatWeighting value(between 0.0 and 1.0).
value1
Vector3The first vector.
value2
Vector3The second vector.
Returns
- Vector3
The result of linear interpolation of the specified vectors.
Max(Vector3, Vector3)
public static Vector3 Max(Vector3 value1, Vector3 value2)
Parameters
Returns
Min(Vector3, Vector3)
public static Vector3 Min(Vector3 value1, Vector3 value2)
Parameters
Returns
Parse(string)
Converts the string representation of the number to its Vector3 equivalent.
public static Vector3 Parse(string s)
Parameters
s
stringThe string containing the vector to convert.
Returns
Examples
"12, 34, 56".
ToString()
public override string ToString()
Returns
ToString(IFormatProvider)
public string ToString(IFormatProvider format)
Parameters
format
IFormatProvider
Returns
TryParse(string, out Vector3)
Converts the string representation of the vector to its Vector3 equivalent. The return value indicates whether the conversion succeeded.
public static bool TryParse(string s, out Vector3 vector)
Parameters
s
stringThe string containing the vector to convert.
vector
Vector3The result of conversion if it succeeds, Zero otherwise.
Returns
Examples
"12, 34, 56".
Operators
operator +(Vector3, Vector3)
public static Vector3 operator +(Vector3 lhs, Vector3 rhs)
Parameters
Returns
operator /(Vector3, Vector3)
public static Vector3 operator /(Vector3 lhs, Vector3 rhs)
Parameters
Returns
operator /(Vector3, float)
public static Vector3 operator /(Vector3 lhs, float rhs)
Parameters
Returns
operator ==(Vector3, Vector3)
public static bool operator ==(Vector3 lhs, Vector3 rhs)
Parameters
Returns
explicit operator Vector2(Vector3)
public static explicit operator Vector2(Vector3 value)
Parameters
value
Vector3
Returns
operator !=(Vector3, Vector3)
public static bool operator !=(Vector3 lhs, Vector3 rhs)
Parameters
Returns
operator *(Vector3, Vector3)
public static Vector3 operator *(Vector3 lhs, Vector3 rhs)
Parameters
Returns
operator *(Vector3, float)
public static Vector3 operator *(Vector3 lhs, float rhs)
Parameters
Returns
operator *(float, Vector3)
public static Vector3 operator *(float lhs, Vector3 rhs)
Parameters
Returns
operator -(Vector3, Vector3)
public static Vector3 operator -(Vector3 lhs, Vector3 rhs)
Parameters
Returns
operator -(Vector3)
public static Vector3 operator -(Vector3 value)
Parameters
value
Vector3