Struct Vector3DInt
- Namespace
- Cobilas.GodotEngine.Utility.Numerics
- Assembly
- com.cobilas.godot.utility.dll
Representation of a three-dimensional vector using integers.
[Serializable]
public struct Vector3DInt : IIntVector, IFormattable
- Implements
- Inherited Members
Constructors
Vector3DInt(in Vector3DInt)
Starts a new instance of the object.
public Vector3DInt(in Vector3DInt vector)
Parameters
vectorVector3DInt
Vector3DInt(in int, in int)
Starts a new instance of the object.
public Vector3DInt(in int x, in int y)
Parameters
Vector3DInt(in int, in int, in int)
Starts a new instance of the object.
public Vector3DInt(in int x, in int y, in int z)
Parameters
Fields
x
X component of the vector.
[ShowProperty(true)]
public int x
Field Value
y
Y component of the vector.
[ShowProperty(true)]
public int y
Field Value
z
Z component of the vector.
[ShowProperty(true)]
public int z
Field Value
Properties
AxisCount
Number of axles.
public readonly int AxisCount { get; }
Property Value
- int
Returns the number of axes a vector has.
Back
Shorthand for writing Vector3(0,0,-1).
public static Vector3DInt Back { get; }
Property Value
Down
Shorthand for writing Vector3(0,1,0).
public static Vector3DInt Down { get; }
Property Value
Forward
Shorthand for writing Vector3(0,0,1).
public static Vector3DInt Forward { get; }
Property Value
this[int]
Allows you to access the axes of a vector through an index.
public int this[int index] { readonly get; set; }
Parameters
indexintThe axis index.
Property Value
- int
Sets the value of an axis by specifying its index.
Left
Shorthand for writing Vector3(-1,0,0).
public static Vector3DInt Left { get; }
Property Value
One
Shorthand for writing Vector3(1,1,1).
public static Vector3DInt One { get; }
Property Value
Right
Shorthand for writing Vector3(1,0,0).
public static Vector3DInt Right { get; }
Property Value
Up
Shorthand for writing Vector3(0,-1,0).
public static Vector3DInt Up { get; }
Property Value
Zero
Shorthand for writing Vector3(0,0,0).
public static Vector3DInt Zero { get; }
Property Value
aspect
public readonly float aspect { get; }
Property Value
ceilToInt
public readonly Vector3DInt ceilToInt { get; }
Property Value
floorToInt
public readonly Vector3DInt floorToInt { get; }
Property Value
magnitude
Returns the length (magnitude) of this vector.
public readonly 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.
public readonly int sqrMagnitude { get; }
Property Value
- int
The squared length of this vector.
Methods
Abs(in Vector3DInt)
Returns an absolute value of the vector.
public static Vector3DInt Abs(in Vector3DInt a)
Parameters
aVector3DIntThe vector to become absolute.
Returns
- Vector3DInt
Returns the vector with its absolute value axes.
Abs(bool, bool, bool)
Returns an absolute value of the vector.
public readonly Vector3DInt Abs(bool absX = true, bool absY = true, bool absZ = true)
Parameters
absXboolThe X axis becomes absolute.
absYboolThe Y axis becomes absolute.
absZboolThe Z axis becomes absolute.
Returns
- Vector3DInt
Returns the vector with its absolute value axes.
CeilToInt(in Vector3D)
Converts a floating-point vector to an integer vector and applies a Ceiling to each value.
public static Vector3DInt CeilToInt(in Vector3D a)
Parameters
aVector3DThe vector to be converted is ceiling
Returns
- Vector3DInt
Returns the converted vector and ceiling
Distance(in Vector3DInt, in Vector3DInt)
Returns the distance between a and b.
public static float Distance(in Vector3DInt a, in Vector3DInt b)
Parameters
aVector3DIntOne of the values.
bVector3DIntThe other value.
Returns
- float
The distance between two vectors.
Equals(Vector3DInt)
public readonly bool Equals(Vector3DInt other)
Parameters
otherVector3DInt
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
FloorToInt(in Vector3D)
Converts a floating-point vector to an integer vector and applies a Floor to each value.
public static Vector3DInt FloorToInt(in Vector3D a)
Parameters
aVector3DThe vector to be converted is floor
Returns
- Vector3DInt
Returns the converted vector and floor
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Magnitude(in Vector3DInt)
Returns the length of this vector
public static float Magnitude(in Vector3DInt a)
Parameters
aVector3DIntOne of the values.
Returns
- float
vector length.
Max(Vector3DInt, Vector3DInt)
Returns a vector that is made from the largest components of two vectors.
public static Vector3DInt Max(Vector3DInt lhs, Vector3DInt rhs)
Parameters
lhsVector3DIntOne of the values.
rhsVector3DIntThe other value.
Returns
- Vector3DInt
Whichever of the two values is higher.
Min(Vector3DInt, Vector3DInt)
Returns a vector that is made from the smallest components of two vectors.
public static Vector3DInt Min(Vector3DInt lhs, Vector3DInt rhs)
Parameters
lhsVector3DIntOne of the values.
rhsVector3DIntThe other value.
Returns
- Vector3DInt
Whichever of the two values is lower.
Neg(in Vector3DInt)
Inverts the values of a vector.
public static Vector3DInt Neg(in Vector3DInt a)
Parameters
aVector3DIntThe vector to be inverted.
Returns
- Vector3DInt
Returns the axes of an inverted vector.
Neg(bool, bool, bool)
Inverts the values of a vector.
public readonly Vector3DInt Neg(bool negX = true, bool negY = true, bool negZ = true)
Parameters
negXboolThe X axis becomes inverted.
negYboolThe Y axis becomes inverted.
negZboolThe Z axis becomes inverted.
Returns
- Vector3DInt
Returns the axes of an inverted vector.
RoundToInt(in Vector3D)
Converts a floating-point vector to an integer vector by performing a Round for each value.
public static Vector3DInt RoundToInt(in Vector3D a)
Parameters
aVector3DThe vector that will be converted and rounded
Returns
- Vector3DInt
Returns the converted and rounded vector
SqrMagnitude(in Vector3DInt)
Returns the squared length of this vector
public static int SqrMagnitude(in Vector3DInt a)
Parameters
aVector3DIntOne of the values.
Returns
- int
square length of the vector.
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
ToString(string)
Formats the value of the current instance using the specified format.
public readonly string ToString(string format)
Parameters
formatstringThe format to use.-or- A null reference (
Nothingin 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.
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
formatstringThe format to use.-or- A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.-or- A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
Operators
operator +(Vector3DInt, Vector3DInt)
Addition operation between two values.(Vector3DInt + Vector3DInt)
public static Vector3DInt operator +(Vector3DInt a, Vector3DInt b)
Parameters
aVector3DIntFirst module.
bVector3DIntSecond module.
Returns
- Vector3DInt
The result of the addition.
operator /(Vector3DInt, Vector3DInt)
Division operation between two values.(Vector3DInt / Vector3DInt)
public static Vector3DInt operator /(Vector3DInt a, Vector3DInt b)
Parameters
aVector3DIntFirst module.
bVector3DIntSecond module.
Returns
- Vector3DInt
The result of the division.
operator /(Vector3DInt, int)
Division operation between two values.(Vector3DInt / int)
public static Vector3DInt operator /(Vector3DInt a, int b)
Parameters
aVector3DIntFirst module.
bintSecond module.
Returns
- Vector3DInt
The result of the division.
operator ==(in Vector3DInt, in Vector3DInt)
Indicates whether this instance is equal to another instance of the same type.
public static bool operator ==(in Vector3DInt lhs, in Vector3DInt rhs)
Parameters
lhsVector3DIntObject to be compared.
rhsVector3DIntObject of comparison.
Returns
- bool
Returns the result of the comparison.
explicit operator Vector3DInt(Vector2D)
Explicit conversion operator.(Vector2D to Vector3DInt)
public static explicit operator Vector3DInt(Vector2D v)
Parameters
vVector2DObject to be converted.
Returns
explicit operator Vector3DInt(Vector3D)
Explicit conversion operator.(Vector3D to Vector3DInt)
public static explicit operator Vector3DInt(Vector3D v)
Parameters
vVector3DObject to be converted.
Returns
explicit operator Vector3DInt(Vector4D)
Explicit conversion operator.(Vector4D to Vector3DInt)
public static explicit operator Vector3DInt(Vector4D v)
Parameters
vVector4DObject to be converted.
Returns
explicit operator Vector3DInt(Vector2)
Explicit conversion operator.(Godot.Vector2 to Vector3DInt)
public static explicit operator Vector3DInt(Vector2 v)
Parameters
vVector2Object to be converted.
Returns
implicit operator Vector2D(Vector3DInt)
Implicit conversion operator.(Vector3DInt to Vector2D)
public static implicit operator Vector2D(Vector3DInt v)
Parameters
vVector3DIntObject to be converted.
Returns
implicit operator Vector2DInt(Vector3DInt)
Implicit conversion operator.(Vector3DInt to Vector2DInt)
public static implicit operator Vector2DInt(Vector3DInt v)
Parameters
vVector3DIntObject to be converted.
Returns
implicit operator Vector3D(Vector3DInt)
Implicit conversion operator.(Vector3DInt to Vector3D)
public static implicit operator Vector3D(Vector3DInt v)
Parameters
vVector3DIntObject to be converted.
Returns
implicit operator Vector4D(Vector3DInt)
Implicit conversion operator.(Vector3DInt to Vector4D)
public static implicit operator Vector4D(Vector3DInt v)
Parameters
vVector3DIntObject to be converted.
Returns
implicit operator Vector2(Vector3DInt)
Implicit conversion operator.(Vector3DInt to Godot.Vector2)
public static implicit operator Vector2(Vector3DInt v)
Parameters
vVector3DIntObject to be converted.
Returns
- Vector2
operator !=(in Vector3DInt, in Vector3DInt)
Indicates whether this instance is different from another instance of the same type.
public static bool operator !=(in Vector3DInt lhs, in Vector3DInt rhs)
Parameters
lhsVector3DIntObject to be compared.
rhsVector3DIntObject of comparison.
Returns
- bool
Returns the result of the comparison.
operator %(Vector3DInt, Vector3DInt)
Modulo operation between two values.(Vector3DInt + Vector3DInt)
public static Vector3DInt operator %(Vector3DInt a, Vector3DInt b)
Parameters
aVector3DIntFirst module.
bVector3DIntSecond module.
Returns
- Vector3DInt
The result of the module.
operator %(Vector3DInt, int)
Modulo operation between two values.(Vector3DInt + int)
public static Vector3DInt operator %(Vector3DInt a, int b)
Parameters
aVector3DIntFirst module.
bintSecond module.
Returns
- Vector3DInt
The result of the module.
operator *(Vector3DInt, Vector3DInt)
Multiplication operation between two values.(Vector3DInt * Vector3DInt)
public static Vector3DInt operator *(Vector3DInt a, Vector3DInt b)
Parameters
aVector3DIntFirst module.
bVector3DIntSecond module.
Returns
- Vector3DInt
The result of the multiplication.
operator *(Vector3DInt, int)
Multiplication operation between two values.(Vector3DInt * int)
public static Vector3DInt operator *(Vector3DInt a, int b)
Parameters
aVector3DIntFirst module.
bintSecond module.
Returns
- Vector3DInt
The result of the multiplication.
operator -(Vector3DInt, Vector3DInt)
Subtraction operation between two values.(Vector3DInt - Vector3DInt)
public static Vector3DInt operator -(Vector3DInt a, Vector3DInt b)
Parameters
aVector3DIntFirst module.
bVector3DIntSecond module.
Returns
- Vector3DInt
The result of the subtraction.
operator -(Vector3DInt)
The operator allows us to reverse the value.
public static Vector3DInt operator -(Vector3DInt a)
Parameters
aVector3DIntOr value that will be invested.
Returns
- Vector3DInt
Returns the result of the inversion.