Struct Float3
3D vector with float data values
Implements
Constructors
Float3(float, float)
3D vector with float data values. z = 0
Declaration
public Float3(float x, float y)
Float3(float, float, float)
3D vector with float data values
Declaration
public Float3(float x, float y, float z)
Fields
Back
Declaration
public static readonly Float3 Back
Down
Declaration
public static readonly Float3 Down
Forward
Declaration
public static readonly Float3 Forward
Left
Declaration
public static readonly Float3 Left
One
Declaration
public static readonly Float3 One
Right
Declaration
public static readonly Float3 Right
Up
Declaration
public static readonly Float3 Up
Zero
Declaration
public static readonly Float3 Zero
x
Declaration
public float x
y
Declaration
public float y
z
Declaration
public float z
Properties
this[int]
Get float data inside with given index. (0 means x, 1 means y, 2 means z)
Declaration
public float this[int index] { readonly get; set; }
Magnitude
Length of this vector
Declaration
public readonly float Magnitude { get; }
Normalized
Get a vector that has a length of 1, while maintaining the same direction as the original vector.
Declaration
public readonly Float3 Normalized { get; }
SqrMagnitude
Square of the length of this vector
Declaration
public readonly float SqrMagnitude { get; }
Methods
Angle(Float3, Float3)
Angle in degrees between from and to
Declaration
public static float Angle(Float3 from, Float3 to)
Deconstruct(out float, out float, out float)
Declaration
public readonly void Deconstruct(out float x, out float y, out float z)
Distance(Float3, Float3)
Distance between to points
Declaration
public static float Distance(Float3 a, Float3 b)
Dot(Float3, Float3)
The dot product of two vectors returns a float value representing the cosine of the angle between them
Declaration
public static float Dot(Float3 lhs, Float3 rhs)
Equals(Float3)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(Float3 other)
Parameters
Type | Name | Description |
---|---|---|
Float3 | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object other)
Returns
Type | Description |
---|---|
bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Lerp(Float3, Float3, float)
Find a value transform between two given float smoothly
Declaration
public static Float3 Lerp(Float3 a, Float3 b, float t)
Representation of the position. 0 means value A, 1 means value B.
LerpUnclamped(Float3, Float3, float)
Find a value transform between two given float smoothly without limit the t value
Declaration
public static Float3 LerpUnclamped(Float3 a, Float3 b, float t)
Representation of the position. 0 means value A, 1 means value B.
MoveTowards(Float3, Float3, float)
Moves a point towards the target with distance limitation
Declaration
public static Float3 MoveTowards(Float3 current, Float3 target, float maxDistanceDelta)
Parameters
Type | Name | Description |
---|---|---|
Float3 | current | Starting position |
Float3 | target | Target end position |
float | maxDistanceDelta | Distance limit |
Returns
Type | Description |
---|---|
Float3 | The new position |
Normalize()
Make the vector have length of 1 while maintaining the same direction as original.
Declaration
public void Normalize()
Normalize(Float3)
Declaration
public static Float3 Normalize(Float3 value)
Set(float, float, float)
Set all values of this vector
Declaration
public void Set(float newX, float newY, float newZ)
SignedAngle(Float3, Float3, Float3)
Signed angle in degrees between from and to in axis
Declaration
public static float SignedAngle(Float3 from, Float3 to, Float3 axis)
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
Operators
operator +(Float3, Float3)
Declaration
public static Float3 operator +(Float3 a, Float3 b)
operator /(Float3, float)
Declaration
public static Float3 operator /(Float3 a, float d)
operator ==(Float3, Float3)
Declaration
public static bool operator ==(Float3 lhs, Float3 rhs)
operator !=(Float3, Float3)
Declaration
public static bool operator !=(Float3 lhs, Float3 rhs)
operator *(Float3, float)
Declaration
public static Float3 operator *(Float3 a, float d)
operator *(float, Float3)
Declaration
public static Float3 operator *(float d, Float3 a)
operator -(Float3, Float3)
Declaration
public static Float3 operator -(Float3 a, Float3 b)
operator -(Float3)
Declaration
public static Float3 operator -(Float3 a)