Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Size3 Struct

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

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    System.ValueType.Equals(System.Object)

    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    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
    System.ValueType.ToString()

    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.

    | Improve this Doc View Source

    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.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation