Struct Size3
- Namespace
- Stride.Core.Mathematics
- Assembly
- Stride.Core.Mathematics.dll
Structure providing Width, Height and Depth.
[DataContract("!Size3")]
[DataStyle(DataStyle.Compact)]
public struct Size3 : IEquatable<Size3>, IComparable<Size3>
- Implements
Constructors
Size3(int, int, int)
Initializes a new instance of the Size3 struct.
public Size3(int width, int height, int depth)
Parameters
Fields
Depth
Height.
[DataMember(2)]
public int Depth
Field Value
Empty
A zero size with (width, height, depth) = (0,0,0)
public static readonly Size3 Empty
Field Value
Height
Height.
[DataMember(1)]
public int Height
Field Value
One
A one size with (width, height, depth) = (1,1,1)
public static readonly Size3 One
Field Value
Width
Width.
[DataMember(0)]
public int Width
Field Value
Zero
A zero size with (width, height, depth) = (0,0,0)
public static readonly Size3 Zero
Field Value
Methods
CompareTo(Size3)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(Size3 other)
Parameters
other
Size3An object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Deconstruct(out int, out int, out int)
Deconstructs the vector's components into named variables.
public void Deconstruct(out int width, out int height, out int depth)
Parameters
Down2(int)
Calculates the next down mip-level (/2) of this size.
public Size3 Down2(int count = 1)
Parameters
count
intThe count.
Returns
- Size3
A next down mip-level Size3.
Equals(Size3)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Size3 other)
Parameters
other
Size3An object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe 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.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Mip(int)
Calculates the mip size based on a direction.
public Size3 Mip(int direction)
Parameters
direction
intThe direction < 0 then Down2(int), > 0 then Up2(int), else this unchanged.
Returns
- Size3
Size3.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Up2(int)
Calculates the next up mip-level (*2) of this size.
public Size3 Up2(int count = 1)
Parameters
count
int
Returns
- Size3
A next up mip-level Size3.
Operators
operator ==(Size3, Size3)
Implements the ==.
public static bool operator ==(Size3 left, Size3 right)
Parameters
Returns
- bool
The result of the operator.
operator >(Size3, Size3)
Implements the < or ==.
public static bool operator >(Size3 left, Size3 right)
Parameters
Returns
- bool
The result of the operator.
operator >=(Size3, Size3)
Implements the > or ==.
public static bool operator >=(Size3 left, Size3 right)
Parameters
Returns
- bool
The result of the operator.
operator !=(Size3, Size3)
Implements the !=.
public static bool operator !=(Size3 left, Size3 right)
Parameters
Returns
- bool
The result of the operator.
operator <(Size3, Size3)
Implements the <.
public static bool operator <(Size3 left, Size3 right)
Parameters
Returns
- bool
The result of the operator.
operator <=(Size3, Size3)
Implements the <.
public static bool operator <=(Size3 left, Size3 right)
Parameters
Returns
- bool
The result of the operator.