Size3 Struct
Namespace: Stride.Core.MathematicsAssembly: Stride.Core.Mathematics.dll
Structure providing Width, Height and Depth.
[DataContract("!Size3")]
[DataStyle(DataStyle.Compact)]
public struct Size3 : IEquatable<Size3>, IComparable<Size3>
Name | Description | |
---|---|---|
Constructors | ||
Size3(Int32, Int32, Int32) | Initializes a new instance of the Size3 struct. |
|
Fields | ||
Depth | Height. |
|
Empty | A zero size with (width, height, depth) = (0,0,0) |
|
Height | Height. |
|
One | A one size with (width, height, depth) = (1,1,1) |
|
Width | Width. |
|
Zero | A zero size with (width, height, depth) = (0,0,0) |
|
Methods | ||
CompareTo(Size3) | ||
Down2(Int32) | Calculates the next down mip-level (/2) of this size. |
|
Equals(Size3) | ||
Equals(Object) | ||
GetHashCode() | ||
Mip(Int32) | Calculates the mip size based on a direction. |
|
ToString() | ||
Up2(Int32) | Calculates the next up mip-level (*2) of this size. |
|
Operators | ||
Equality(Size3, Size3) | Implements the ==. |
|
GreaterThan(Size3, Size3) | Implements the < or ==. |
|
GreaterThanOrEqual(Size3, Size3) | Implements the > or ==. |
|
Inequality(Size3, Size3) | Implements the !=. |
|
LessThan(Size3, Size3) | Implements the <. |
|
LessThanOrEqual(Size3, Size3) | Implements the <. |
Constructors
Size3(Int32, Int32, Int32)
Initializes a new instance of the Size3 struct.
public Size3(int width, int height, int depth)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The x. |
System.Int32 | height | The y. |
System.Int32 | depth | The depth. |
Fields
Depth
Height.
[DataMember(2)]
public int Depth
Field Value
Type | Description |
---|---|
System.Int32 |
Empty
A zero size with (width, height, depth) = (0,0,0)
public static readonly Size3 Empty
Field Value
Type | Description |
---|---|
Size3 |
Height
Height.
[DataMember(1)]
public int Height
Field Value
Type | Description |
---|---|
System.Int32 |
One
A one size with (width, height, depth) = (1,1,1)
public static readonly Size3 One
Field Value
Type | Description |
---|---|
Size3 |
Width
Width.
[DataMember(0)]
public int Width
Field Value
Type | Description |
---|---|
System.Int32 |
Zero
A zero size with (width, height, depth) = (0,0,0)
public static readonly Size3 Zero
Field Value
Type | Description |
---|---|
Size3 |
Methods
CompareTo(Size3)
public int CompareTo(Size3 other)
Parameters
Type | Name | Description |
---|---|---|
Size3 | other |
Returns
Type | Description |
---|---|
System.Int32 |
Down2(Int32)
Calculates the next down mip-level (/2) of this size.
public Size3 Down2(int count = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | The count. |
Returns
Type | Description |
---|---|
Size3 | A next down mip-level Size3. |
Equals(Size3)
public bool Equals(Size3 other)
Parameters
Type | Name | Description |
---|---|---|
Size3 | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Mip(Int32)
Calculates the mip size based on a direction.
public Size3 Mip(int direction)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | direction | The direction < 0 then Down2(Int32), > 0 then Up2(Int32), else this unchanged. |
Returns
Type | Description |
---|---|
Size3 | Size3. |
ToString()
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Up2(Int32)
Calculates the next up mip-level (*2) of this size.
public Size3 Up2(int count = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count |
Returns
Type | Description |
---|---|
Size3 | A next up mip-level Size3. |
Operators
Equality(Size3, Size3)
Implements the ==.
public static bool operator ==(Size3 left, Size3 right)
Parameters
Type | Name | Description |
---|---|---|
Size3 | left | The left. |
Size3 | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
GreaterThan(Size3, Size3)
Implements the < or ==.
public static bool operator>(Size3 left, Size3 right)
Parameters
Type | Name | Description |
---|---|---|
Size3 | left | The left. |
Size3 | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
GreaterThanOrEqual(Size3, Size3)
Implements the > or ==.
public static bool operator >=(Size3 left, Size3 right)
Parameters
Type | Name | Description |
---|---|---|
Size3 | left | The left. |
Size3 | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Inequality(Size3, Size3)
Implements the !=.
public static bool operator !=(Size3 left, Size3 right)
Parameters
Type | Name | Description |
---|---|---|
Size3 | left | The left. |
Size3 | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
LessThan(Size3, Size3)
Implements the <.
public static bool operator <(Size3 left, Size3 right)
Parameters
Type | Name | Description |
---|---|---|
Size3 | left | The left. |
Size3 | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
LessThanOrEqual(Size3, Size3)
Implements the <.
public static bool operator <=(Size3 left, Size3 right)
Parameters
Type | Name | Description |
---|---|---|
Size3 | left | The left. |
Size3 | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |