Class Int4
Represents a four dimensional mathematical vector with 32-bit precision (per-component).
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class Int4 : ValueType, IEquatable<Int4>, IFormattable
Constructors
Int4(Int2, Int32, Int32)
Initializes a new instance of the Int4 struct.
Declaration
public Int4(Int2 value, int z, int w)
Parameters
Int2
value
A vector containing the values with which to initialize the X and Y components. |
System. Initial value for the Z component of the vector. |
System. Initial value for the W component of the vector. |
Int4(Int3, Int32)
Initializes a new instance of the Int4 struct.
Declaration
public Int4(Int3 value, int w)
Parameters
Int3
value
A vector containing the values with which to initialize the X, Y, and Z components. |
System. Initial value for the W component of the vector. |
Int4(Int32)
Initializes a new instance of the Int4 struct.
Declaration
public Int4(int value)
Parameters
System. The value that will be assigned to all components. |
Int4(Int32, Int32, Int32, Int32)
Initializes a new instance of the Int4 struct.
Declaration
public Int4(int x, int y, int z, int w)
Parameters
System. Initial value for the X component of the vector. |
System. Initial value for the Y component of the vector. |
System. Initial value for the Z component of the vector. |
System. Initial value for the W component of the vector. |
Int4(Int32[])
Initializes a new instance of the Int4 struct.
Declaration
public Int4(int[] values)
Parameters
System. The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements. |
Exceptions
System. Thrown when |
System. Thrown when |
Fields
Maximum
A Int4 with all components equal to System.
Declaration
public static readonly Int4 Maximum
Field Value
Minimum
A Int4 with all components equal to System.
Declaration
public static readonly Int4 Minimum
Field Value
One
A Int4 with all of its components set to one.
Declaration
public static readonly Int4 One
Field Value
SizeInBytes
The size of the Int4 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.
|
UnitW
UnitX
UnitY
UnitZ
W
The W component.
Declaration
public int W
Field Value
System.
|
X
The X component.
Declaration
public int X
Field Value
System.
|
Y
The Y component.
Declaration
public int Y
Field Value
System.
|
Z
The Z component.
Declaration
public int Z
Field Value
System.
|
Zero
A Int4 with all of its components set to zero.
Declaration
public static readonly Int4 Zero
Field Value
Properties
Default
IsOne
Gets a value indicting whether this vector is one
Declaration
public bool IsOne { get; }
Property Value
System.
|
IsZero
Gets a value indicting whether this vector is zero
Declaration
public bool IsZero { get; }
Property Value
System.
|
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public int this[int index] { get; set; }
Parameters
System. The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. |
Property Value
System. The value of the X, Y, Z, or W component, depending on the index. |
Exceptions
System. Thrown when the |
MaxValue
Gets a maximum component value
Declaration
public int MaxValue { get; }
Property Value
System.
|
MinValue
Gets a minimum component value
Declaration
public int MinValue { get; }
Property Value
System.
|
ValuesSum
Gets a sum of the component values.
Declaration
public int ValuesSum { get; }
Property Value
System.
|
Methods
Abs(Int4)
Returns the absolute value of a vector.
Declaration
public static Int4 Abs(Int4 v)
Parameters
Int4
v
The value. |
Returns
Int4
A vector which components are less or equal to 0. |
Add(Int4, Int4)
Adds two vectors.
Declaration
public static Int4 Add(Int4 left, Int4 right)
Parameters
Returns
Int4
The sum of the two vectors. |
Add(Int4, Int32)
Perform a component-wise addition
Declaration
public static Int4 Add(Int4 left, int right)
Parameters
Int4
left
The input vector |
System. The scalar value to be added to elements |
Returns
Int4
The vector with added scalar for each element. |
Add(ref Int4, ref Int4, out Int4)
Adds two vectors.
Declaration
public static void Add(ref Int4 left, ref Int4 right, out Int4 result)
Parameters
Add(ref Int4, ref Int32, out Int4)
Perform a component-wise addition
Declaration
public static void Add(ref Int4 left, ref int right, out Int4 result)
Parameters
Clamp(Int4, Int4, Int4)
Restricts a value to be within a specified range.
Declaration
public static Int4 Clamp(Int4 value, Int4 min, Int4 max)
Parameters
Returns
Int4
The clamped value. |
Clamp(ref Int4, ref Int4, ref Int4, out Int4)
Restricts a value to be within a specified range.
Declaration
public static void Clamp(ref Int4 value, ref Int4 min, ref Int4 max, out Int4 result)
Parameters
Divide(Int4, Int32)
Scales a vector by the given value.
Declaration
public static Int4 Divide(Int4 value, int scale)
Parameters
Int4
value
The vector to scale. |
System. The amount by which to scale the vector. |
Returns
Int4
The scaled vector. |
Divide(ref Int4, Int32, out Int4)
Scales a vector by the given value.
Declaration
public static void Divide(ref Int4 value, int scale, out Int4 result)
Parameters
Divide(Int32, Int4)
Scales a vector by the given value.
Declaration
public static Int4 Divide(int scale, Int4 value)
Parameters
System. The amount by which to scale the vector. |
Int4
value
The vector to scale. |
Returns
Int4
The scaled vector. |
Divide(Int32, ref Int4, out Int4)
Scales a vector by the given value.
Declaration
public static void Divide(int scale, ref Int4 value, out Int4 result)
Parameters
Equals(Int4)
Determines whether the specified Int4 is equal to this instance.
Declaration
public bool Equals(Int4 other)
Parameters
Returns
System.
|
Equals(ref Int4)
Determines whether the specified Int4 is equal to this instance.
Declaration
public bool Equals(ref Int4 other)
Parameters
Returns
System.
|
Equals(Object)
Determines whether the specified System.
Declaration
public override bool Equals(object value)
Parameters
System. The System. |
Returns
System.
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Max(Int4, Int4)
Returns a vector containing the largest components of the specified vectors.
Declaration
public static Int4 Max(Int4 left, Int4 right)
Parameters
Returns
Int4
A vector containing the largest components of the source vectors. |
Max(ref Int4, ref Int4, out Int4)
Returns a vector containing the largest components of the specified vectors.
Declaration
public static void Max(ref Int4 left, ref Int4 right, out Int4 result)
Parameters
Min(Int4, Int4)
Returns a vector containing the smallest components of the specified vectors.
Declaration
public static Int4 Min(Int4 left, Int4 right)
Parameters
Returns
Int4
A vector containing the smallest components of the source vectors. |
Min(ref Int4, ref Int4, out Int4)
Returns a vector containing the smallest components of the specified vectors.
Declaration
public static void Min(ref Int4 left, ref Int4 right, out Int4 result)
Parameters
Multiply(Int4, Int4)
Multiplies a vector with another by performing component-wise multiplication.
Declaration
public static Int4 Multiply(Int4 left, Int4 right)
Parameters
Returns
Int4
The multiplied vector. |
Multiply(Int4, Int32)
Scales a vector by the given value.
Declaration
public static Int4 Multiply(Int4 value, int scale)
Parameters
Int4
value
The vector to scale. |
System. The amount by which to scale the vector. |
Returns
Int4
The scaled vector. |
Multiply(ref Int4, ref Int4, out Int4)
Multiplies a vector with another by performing component-wise multiplication.
Declaration
public static void Multiply(ref Int4 left, ref Int4 right, out Int4 result)
Parameters
Multiply(ref Int4, Int32, out Int4)
Scales a vector by the given value.
Declaration
public static void Multiply(ref Int4 value, int scale, out Int4 result)
Parameters
Negate(Int4)
Reverses the direction of a given vector.
Declaration
public static Int4 Negate(Int4 value)
Parameters
Int4
value
The vector to negate. |
Returns
Int4
A vector facing in the opposite direction. |
Negate(ref Int4, out Int4)
Reverses the direction of a given vector.
Declaration
public static void Negate(ref Int4 value, out Int4 result)
Parameters
Subtract(Int4, Int4)
Subtracts two vectors.
Declaration
public static Int4 Subtract(Int4 left, Int4 right)
Parameters
Returns
Int4
The difference of the two vectors. |
Subtract(Int4, Int32)
Perform a component-wise subtraction
Declaration
public static Int4 Subtract(Int4 left, int right)
Parameters
Int4
left
The input vector |
System. The scalar value to be subtracted from elements |
Returns
Int4
The vector with subtracted scalar for each element. |
Subtract(ref Int4, ref Int4, out Int4)
Subtracts two vectors.
Declaration
public static void Subtract(ref Int4 left, ref Int4 right, out Int4 result)
Parameters
Subtract(ref Int4, ref Int32, out Int4)
Perform a component-wise subtraction
Declaration
public static void Subtract(ref Int4 left, ref int right, out Int4 result)
Parameters
Subtract(Int32, Int4)
Perform a component-wise subtraction
Declaration
public static Int4 Subtract(int left, Int4 right)
Parameters
System. The scalar value to be subtracted from elements |
Int4
right
The input vector. |
Returns
Int4
The vector with subtracted scalar for each element. |
Subtract(ref Int32, ref Int4, out Int4)
Perform a component-wise subtraction
Declaration
public static void Subtract(ref int left, ref Int4 right, out Int4 result)
Parameters
ToArray()
Creates an array containing the elements of the vector.
Declaration
public int[] ToArray()
Returns
System. A four-element array containing the components of the vector. |
ToString()
Returns a System.
Declaration
public override string ToString()
Returns
System. A System. |
ToString(IFormatProvider)
Returns a System.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
System. The format provider. |
Returns
System. A System. |
ToString(String)
Returns a System.
Declaration
public string ToString(string format)
Parameters
System. The format. |
Returns
System. A System. |
ToString(String, IFormatProvider)
Returns a System.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
System. The format. |
System. The format provider. |
Returns
System. A System. |
Operators
Addition(Int4, Int4)
Adds two vectors.
Declaration
public static Int4 operator +(Int4 left, Int4 right)
Parameters
Returns
Int4
The sum of the two vectors. |
Addition(Int4, Int32)
Perform a component-wise addition
Declaration
public static Int4 operator +(Int4 value, int scalar)
Parameters
Int4
value
The input vector. |
System. The scalar value to be added on elements |
Returns
Int4
The vector with added scalar for each element. |
Addition(Int32, Int4)
Perform a component-wise addition
Declaration
public static Int4 operator +(int scalar, Int4 value)
Parameters
System. The scalar value to be added on elements |
Int4
value
The input vector. |
Returns
Int4
The vector with added scalar for each element. |
Division(Int4, Int4)
Scales a vector by the given value.
Declaration
public static Int4 operator /(Int4 value, Int4 scale)
Parameters
Returns
Int4
The scaled vector. |
Division(Int4, Int32)
Scales a vector by the given value.
Declaration
public static Int4 operator /(Int4 value, int scale)
Parameters
Int4
value
The vector to scale. |
System. The amount by which to scale the vector. |
Returns
Int4
The scaled vector. |
Division(Int32, Int4)
Scales a vector by the given value.
Declaration
public static Int4 operator /(int scale, Int4 value)
Parameters
System. The amount by which to scale the vector. |
Int4
value
The vector to scale. |
Returns
Int4
The scaled vector. |
Equality(Int4, Int4)
Tests for equality between two objects.
Declaration
public static bool operator ==(Int4 left, Int4 right)
Parameters
Returns
System.
|
Explicit(Int4 to Float2)
Declaration
public static explicit operator Float2(Int4 value)
Parameters
Int4
value
The value. |
Returns
Float2
The result of the conversion. |
Explicit(Int4 to Float3)
Declaration
public static explicit operator Float3(Int4 value)
Parameters
Int4
value
The value. |
Returns
Float3
The result of the conversion. |
Explicit(Int4 to Float4)
Declaration
public static explicit operator Float4(Int4 value)
Parameters
Int4
value
The value. |
Returns
Float4
The result of the conversion. |
Explicit(Int4 to Int2)
Declaration
public static explicit operator Int2(Int4 value)
Parameters
Int4
value
The value. |
Returns
Int2
The result of the conversion. |
Explicit(Int4 to Int3)
Declaration
public static explicit operator Int3(Int4 value)
Parameters
Int4
value
The value. |
Returns
Int3
The result of the conversion. |
Explicit(Int4 to Vector2)
Declaration
public static explicit operator Vector2(Int4 value)
Parameters
Int4
value
The value. |
Returns
Vector2
The result of the conversion. |
Explicit(Int4 to Vector3)
Declaration
public static explicit operator Vector3(Int4 value)
Parameters
Int4
value
The value. |
Returns
Vector3
The result of the conversion. |
Explicit(Int4 to Vector4)
Declaration
public static explicit operator Vector4(Int4 value)
Parameters
Int4
value
The value. |
Returns
Vector4
The result of the conversion. |
Inequality(Int4, Int4)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Int4 left, Int4 right)
Parameters
Returns
System.
|
Modulus(Int4, Int4)
Remainder of value divided by scale.
Declaration
public static Int4 operator %(Int4 value, Int4 scale)
Parameters
Returns
Int4
The remained vector. |
Modulus(Int4, Single)
Remainder of value divided by scale.
Declaration
public static Int4 operator %(Int4 value, float scale)
Parameters
Int4
value
The vector to scale. |
System. The amount by which to scale the vector. |
Returns
Int4
The remained vector. |
Modulus(Single, Int4)
Remainder of value divided by scale.
Declaration
public static Int4 operator %(float value, Int4 scale)
Parameters
System. The amount by which to scale the vector. |
Int4
scale
The vector to scale. |
Returns
Int4
The remained vector. |
Multiply(Int4, Int4)
Multiplies a vector with another by performing component-wise multiplication equivalent to Multiply(ref Int4, ref Int4, out Int4).
Declaration
public static Int4 operator *(Int4 left, Int4 right)
Parameters
Returns
Int4
The multiplication of the two vectors. |
Multiply(Int4, Int32)
Scales a vector by the given value.
Declaration
public static Int4 operator *(Int4 value, int scale)
Parameters
Int4
value
The vector to scale. |
System. The amount by which to scale the vector. |
Returns
Int4
The scaled vector. |
Multiply(Int32, Int4)
Scales a vector by the given value.
Declaration
public static Int4 operator *(int scale, Int4 value)
Parameters
System. The amount by which to scale the vector. |
Int4
value
The vector to scale. |
Returns
Int4
The scaled vector. |
Subtraction(Int4, Int4)
Subtracts two vectors.
Declaration
public static Int4 operator -(Int4 left, Int4 right)
Parameters
Returns
Int4
The difference of the two vectors. |
Subtraction(Int4, Int32)
Perform a component-wise subtraction
Declaration
public static Int4 operator -(Int4 value, int scalar)
Parameters
Int4
value
The input vector. |
System. The scalar value to be subtracted from elements |
Returns
Int4
The vector with subtracted scalar from each element. |
Subtraction(Int32, Int4)
Perform a component-wise subtraction
Declaration
public static Int4 operator -(int scalar, Int4 value)
Parameters
System. The scalar value to be subtracted from elements |
Int4
value
The input vector. |
Returns
Int4
The vector with subtracted scalar from each element. |
UnaryNegation(Int4)
Reverses the direction of a given vector.
Declaration
public static Int4 operator -(Int4 value)
Parameters
Int4
value
The vector to negate. |
Returns
Int4
A vector facing in the opposite direction. |
UnaryPlus(Int4)
Assert a vector (return it unchanged).
Declaration
public static Int4 operator +(Int4 value)
Parameters
Int4
value
The vector to assert (unchanged). |
Returns
Int4
The asserted (unchanged) vector. |