struct in Clatter.Core
A partial implementation of a non-Unity Vector3 that uses doubles. Source: Vector3d.cs
Name | Type | Description | Get/Set |
---|---|---|---|
X | double | The x coordinate. | get set |
Y | double | The y coordinate. | get set |
Z | double | The z coordinate. | get set |
Magnitude | double | The magnitude of the vector. | get |
SqrMagnitude | double | The square root magnitude. | get |
Zero | Vector3d |
Vector (0, 0, 0). | get |
public static double Distance(Vector3d a, Vector3d b)
Returns the distance between two vectors.
Name | Type | Description |
---|---|---|
a | Vector3d |
The first vector. |
b | Vector3d |
The second vector. |
public static void operator+(Vector3d a, Vector3d b)
Vector addition.
Name | Type | Description |
---|---|---|
a | Vector3d |
The first vector. |
b | Vector3d |
The second vector. |
public static void operator-(Vector3d a, Vector3d b)
Vector subtraction.
Name | Type | Description |
---|---|---|
a | Vector3d |
The first vector. |
b | Vector3d |
The second vector. |
public static void operator-(Vector3d v)
Vector negation.
Name | Type | Description |
---|---|---|
v | Vector3d |
The vector. |
public static void operator*(Vector3d v, double d)
Vector multiplication.
Name | Type | Description |
---|---|---|
v | Vector3d |
The vector. |
d | double | The scalar. |
public static void operator*(double d, Vector3d v)
Vector multiplication.
Name | Type | Description |
---|---|---|
d | double | The scalar. |
v | Vector3d |
The vector. |
public static void operator/(Vector3d v, double d)
Vector division.
Name | Type | Description |
---|---|---|
v | Vector3d |
The vector. |
d | double | The scalar. |
public static bool operator==(Vector3d a, Vector3d b)
Vector equality.
Name | Type | Description |
---|---|---|
a | Vector3d |
The first vector. |
b | Vector3d |
The second vector. |
public static bool operator!=(Vector3d a, Vector3d b)
Vector inequality.
Name | Type | Description |
---|---|---|
a | Vector3d |
The first vector. |
b | Vector3d |
The second vector. |
public Vector3d(double x, double y, double z)
Name | Type | Description |
---|---|---|
x | double | The x coordinate. |
y | double | The y coordinate. |
z | double | The z coordinate. |
public Vector3d(double[] vector)
Name | Type | Description |
---|---|---|
vector | double[] | The vector. We assume this has exactly 3 elements. |
public override string ToString()
Stringifies this vector.
public void Normalize()
Normalize this vector.
public void CopyTo(Vector3d v)
Copy another Vector3d into this one. This is faster than using the = operator to set a new value.
Name | Type | Description |
---|---|---|
v | Vector3d |
The other Vector3d. |
public override bool Equals(object other)
Equality comparison.
Name | Type | Description |
---|---|---|
other | object | The other object. |
public override int GetHashCode()
Returns the hashcode.