Struct Vector3
Represents a 3D Vector (type/units aren't specified)
Implements
Namespace: Anki.Vector.Types
Assembly: Anki.Vector.dll
Syntax
public struct Vector3 : IEquatable<Vector3>
Constructors
| Improve this Doc View SourceVector3(Single, Single, Single)
Initializes a new instance of the Vector3 struct.
public Vector3(float x, float y, float z)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The x. |
Single | y | The y. |
Single | z | The z. |
Properties
| Improve this Doc View SourceMagnitude
Gets the magnitude.
public float Magnitude { get; }
Property Type
Single |
Normalized
Gets the normalized version of this instance with the same direction and unit magnitude.
public Vector3 Normalized { get; }
Property Type
Vector3 |
X
Gets the x component
public float X { get; }
Property Type
Single |
Y
Gets the y component
public float Y { get; }
Property Type
Single |
Z
Gets the z component
public float Z { get; }
Property Type
Single |
Methods
| Improve this Doc View SourceCross(Vector3)
Return the cross product of this instance with another Vector3
public Vector3 Cross(Vector3 other)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | other | The other. |
Returns
Type | Description |
---|---|
Vector3 | The cross product |
Dot(Vector3)
Return the dots product of this instance with another Vector3
public float Dot(Vector3 other)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | other | The other. |
Returns
Type | Description |
---|---|
Single | The dot product |
Equals(Vector3)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Vector3 other)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified Object, is equal to this instance.
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The Object to compare with this instance. |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
| Improve this Doc View SourceGetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Improve this Doc View SourceToString()
Converts to string.
public override string ToString()
Returns
Type | Description |
---|---|
String | A String that represents this instance. |
Overrides
Operators
| Improve this Doc View SourceAddition(Vector3, Vector3)
Implements the addition operator.
public static Vector3 operator +(Vector3 lhs, Vector3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lhs | The left value. |
Vector3 | rhs | The right value. |
Returns
Type | Description |
---|---|
Vector3 | Sum of 2 instances |
Division(Vector3, Int32)
Implements the division operator.
public static Vector3 operator /(Vector3 vector, int value)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The Vector. |
Int32 | value | The value to divide by |
Returns
Type | Description |
---|---|
Vector3 | The Vector divided by the value |
Division(Vector3, Single)
Implements the division operator.
public static Vector3 operator /(Vector3 vector, float value)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The Vector. |
Single | value | The value to divide by |
Returns
Type | Description |
---|---|
Vector3 | The Vector divided by the value |
Equality(Vector3, Vector3)
Implements the operator ==.
public static bool operator ==(Vector3 lhs, Vector3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lhs | The LHS. |
Vector3 | rhs | The RHS. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
Inequality(Vector3, Vector3)
Implements the operator !=.
public static bool operator !=(Vector3 lhs, Vector3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lhs | The LHS. |
Vector3 | rhs | The RHS. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
Multiply(Vector3, Int32)
Implements the multiplication operator.
public static Vector3 operator *(Vector3 vector, int value)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The Vector. |
Int32 | value | The value to multiply by |
Returns
Type | Description |
---|---|
Vector3 | The Vector multiplied by the value |
Multiply(Vector3, Single)
Implements the multiplication operator.
public static Vector3 operator *(Vector3 vector, float value)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The Vector. |
Single | value | The value to multiply by |
Returns
Type | Description |
---|---|
Vector3 | The Vector multiplied by the value |
Subtraction(Vector3, Vector3)
Implements the subtraction operator.
public static Vector3 operator -(Vector3 lhs, Vector3 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lhs | The left value. |
Vector3 | rhs | The right value. |
Returns
Type | Description |
---|---|
Vector3 | Difference of 2 instances |