Table of Contents

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

width int

The x.

height int

The y.

depth int

The depth.

Fields

Depth

Height.

[DataMember(2)]
public int Depth

Field Value

int

Empty

A zero size with (width, height, depth) = (0,0,0)

public static readonly Size3 Empty

Field Value

Size3

Height

Height.

[DataMember(1)]
public int Height

Field Value

int

One

A one size with (width, height, depth) = (1,1,1)

public static readonly Size3 One

Field Value

Size3

Width

Width.

[DataMember(0)]
public int Width

Field Value

int

Zero

A zero size with (width, height, depth) = (0,0,0)

public static readonly Size3 Zero

Field Value

Size3

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 Size3

An 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

width int

The Width component

height int

The Height component

depth int

The Depth component

Down2(int)

Calculates the next down mip-level (/2) of this size.

public Size3 Down2(int count = 1)

Parameters

count int

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

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override 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.

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 int

The 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

left Size3

The left.

right Size3

The right.

Returns

bool

The result of the operator.

operator >(Size3, Size3)

Implements the < or ==.

public static bool operator >(Size3 left, Size3 right)

Parameters

left Size3

The left.

right Size3

The right.

Returns

bool

The result of the operator.

operator >=(Size3, Size3)

Implements the > or ==.

public static bool operator >=(Size3 left, Size3 right)

Parameters

left Size3

The left.

right Size3

The right.

Returns

bool

The result of the operator.

operator !=(Size3, Size3)

Implements the !=.

public static bool operator !=(Size3 left, Size3 right)

Parameters

left Size3

The left.

right Size3

The right.

Returns

bool

The result of the operator.

operator <(Size3, Size3)

Implements the <.

public static bool operator <(Size3 left, Size3 right)

Parameters

left Size3

The left.

right Size3

The right.

Returns

bool

The result of the operator.

operator <=(Size3, Size3)

Implements the <.

public static bool operator <=(Size3 left, Size3 right)

Parameters

left Size3

The left.

right Size3

The right.

Returns

bool

The result of the operator.