Table of Contents

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

vector Vector3DInt

Vector3DInt(in int, in int)

Starts a new instance of the object.

public Vector3DInt(in int x, in int y)

Parameters

x int
y int

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

x int
y int
z int

Fields

x

X component of the vector.

public int x

Field Value

int

y

Y component of the vector.

public int y

Field Value

int

z

Z component of the vector.

public int z

Field Value

int

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

Vector3DInt

Down

Shorthand for writing Vector3(0,1,0).

public static Vector3DInt Down { get; }

Property Value

Vector3DInt

Forward

Shorthand for writing Vector3(0,0,1).

public static Vector3DInt Forward { get; }

Property Value

Vector3DInt

this[int]

Allows you to access the axes of a vector through an index.

public int this[int index] { readonly get; set; }

Parameters

index int

The 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

Vector3DInt

One

Shorthand for writing Vector3(1,1,1).

public static Vector3DInt One { get; }

Property Value

Vector3DInt

Right

Shorthand for writing Vector3(1,0,0).

public static Vector3DInt Right { get; }

Property Value

Vector3DInt

Up

Shorthand for writing Vector3(0,-1,0).

public static Vector3DInt Up { get; }

Property Value

Vector3DInt

Zero

Shorthand for writing Vector3(0,0,0).

public static Vector3DInt Zero { get; }

Property Value

Vector3DInt

aspect

Returns the aspect ratio of this vector, the ratio of IVector.x to IVector.y.

public readonly float aspect { get; }

Property Value

float

The IVector.x component divided by the IVector.y component.

ceilToInt

public readonly Vector3DInt ceilToInt { get; }

Property Value

Vector3DInt

floorToInt

public readonly Vector3DInt floorToInt { get; }

Property Value

Vector3DInt

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

a Vector3DInt

The 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

absX bool

The X axis becomes absolute.

absY bool

The Y axis becomes absolute.

absZ bool

The 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

a Vector3D

The 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

a Vector3DInt

One of the values.

b Vector3DInt

The other value.

Returns

float

The distance between two vectors.

Equals(Vector3DInt)

public readonly bool Equals(Vector3DInt other)

Parameters

other Vector3DInt

Returns

bool

Equals(object)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

a Vector3D

The 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

a Vector3DInt

One 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

lhs Vector3DInt

One of the values.

rhs Vector3DInt

The 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

lhs Vector3DInt

One of the values.

rhs Vector3DInt

The 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

a Vector3DInt

The 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

negX bool

The X axis becomes inverted.

negY bool

The Y axis becomes inverted.

negZ bool

The 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

a Vector3D

The 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

a Vector3DInt

One 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

format string

The 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.

ToString(string, IFormatProvider)

Formats the value of the current instance using the specified format.

public readonly string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.-or- A null reference (Nothing in 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

a Vector3DInt

First module.

b Vector3DInt

Second 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

a Vector3DInt

First module.

b Vector3DInt

Second 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

a Vector3DInt

First module.

b int

Second 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

lhs Vector3DInt

Object to be compared.

rhs Vector3DInt

Object 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

v Vector2D

Object to be converted.

Returns

Vector3DInt

explicit operator Vector3DInt(Vector3D)

Explicit conversion operator.(Vector3D to Vector3DInt)

public static explicit operator Vector3DInt(Vector3D v)

Parameters

v Vector3D

Object to be converted.

Returns

Vector3DInt

explicit operator Vector3DInt(Vector4D)

Explicit conversion operator.(Vector4D to Vector3DInt)

public static explicit operator Vector3DInt(Vector4D v)

Parameters

v Vector4D

Object to be converted.

Returns

Vector3DInt

explicit operator Vector3DInt(Vector2)

Explicit conversion operator.(Godot.Vector2 to Vector3DInt)

public static explicit operator Vector3DInt(Vector2 v)

Parameters

v Vector2

Object to be converted.

Returns

Vector3DInt

implicit operator Vector2D(Vector3DInt)

Implicit conversion operator.(Vector3DInt to Vector2D)

public static implicit operator Vector2D(Vector3DInt v)

Parameters

v Vector3DInt

Object to be converted.

Returns

Vector2D

implicit operator Vector2DInt(Vector3DInt)

Implicit conversion operator.(Vector3DInt to Vector2DInt)

public static implicit operator Vector2DInt(Vector3DInt v)

Parameters

v Vector3DInt

Object to be converted.

Returns

Vector2DInt

implicit operator Vector3D(Vector3DInt)

Implicit conversion operator.(Vector3DInt to Vector3D)

public static implicit operator Vector3D(Vector3DInt v)

Parameters

v Vector3DInt

Object to be converted.

Returns

Vector3D

implicit operator Vector4D(Vector3DInt)

Implicit conversion operator.(Vector3DInt to Vector4D)

public static implicit operator Vector4D(Vector3DInt v)

Parameters

v Vector3DInt

Object to be converted.

Returns

Vector4D

implicit operator Vector2(Vector3DInt)

Implicit conversion operator.(Vector3DInt to Godot.Vector2)

public static implicit operator Vector2(Vector3DInt v)

Parameters

v Vector3DInt

Object 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

lhs Vector3DInt

Object to be compared.

rhs Vector3DInt

Object of comparison.

Returns

bool

Returns the result of the comparison.

operator *(Vector3DInt, Vector3DInt)

Multiplication operation between two values.(Vector3DInt * Vector3DInt)

public static Vector3DInt operator *(Vector3DInt a, Vector3DInt b)

Parameters

a Vector3DInt

First module.

b Vector3DInt

Second 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

a Vector3DInt

First module.

b int

Second 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

a Vector3DInt

First module.

b Vector3DInt

Second 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

a Vector3DInt

Or value that will be invested.

Returns

Vector3DInt

Returns the result of the inversion.