Interface IVector
- Namespace
- Cobilas.GodotEngine.Utility.Numerics
- Assembly
- com.cobilas.godot.utility.dll
Standardization interface for vectors.
public interface IVector : IFormattable
- Inherited Members
Properties
AxisCount
Number of axles.
int AxisCount { get; }
Property Value
- int
Returns the number of axes a vector has.
this[int]
Allows you to access the axes of a vector through an index.
float this[int index] { get; set; }
Parameters
index
intThe axis index.
Property Value
- float
Sets the value of an axis by specifying its index.
Normalized
Returns the vector scaled to unit length. Equivalent to v / v.Length()
.
IVector Normalized { get; }
Property Value
- IVector
A normalized version of the vector.
aspect
float aspect { get; }
Property Value
ceil
Returns a new vector with all components rounded up (towards positive infinity).
IVector ceil { get; }
Property Value
- IVector
A vector with Ceil(float) called on each component.
floor
Returns a new vector with all components rounded down (towards negative infinity).
IVector floor { get; }
Property Value
- IVector
A vector with Floor(float) called on each component.
magnitude
Returns the length (magnitude) of this vector.
float magnitude { get; }
Property Value
- float
The length of this vector.
- See Also
-
LengthSquared()
sqrMagnitude
Returns the squared length (squared magnitude) of this vector. This method runs faster than magnitude, so prefer it if you need to compare vectors or need the squared length for some formula.
float sqrMagnitude { get; }
Property Value
- float
The squared length of this vector.
Methods
Round()
Returns this vector with all components rounded to the nearest integer, with halfway cases rounded towards the nearest multiple of two.
IVector Round()
Returns
- IVector
The rounded vector.
ToString(string)
Formats the value of the current instance using the specified format.
string ToString(string format)
Parameters
format
stringThe format to use.-or- A null reference (
Nothing
in Visual Basic) to use the default format defined for the type of the IFormattable implementation.
Returns
- string
The value of the current instance in the specified format.