Struct GorgonBox
A structure with a width, height and depth.
Inherited Members
Namespace: Gorgon.Graphics
Assembly: Gorgon.Core.dll
Syntax
public struct GorgonBox : IGorgonEquatableByRef<GorgonBox>, IEquatable<GorgonBox>
Remarks
This value type merely represents the dimensions of a box, it does not draw a box.
Fields
| Edit this page View SourceDepth
Depth of the box.
Declaration
public int Depth
Field Value
Type | Description |
---|---|
int |
Empty
An empty box.
Declaration
public static readonly GorgonBox Empty
Field Value
Type | Description |
---|---|
GorgonBox |
Height
Height of the box.
Declaration
public int Height
Field Value
Type | Description |
---|---|
int |
Width
Width of the box.
Declaration
public int Width
Field Value
Type | Description |
---|---|
int |
X
Horizontal position.
Declaration
public int X
Field Value
Type | Description |
---|---|
int |
Y
Vertical position
Declaration
public int Y
Field Value
Type | Description |
---|---|
int |
Z
Depth position.
Declaration
public int Z
Field Value
Type | Description |
---|---|
int |
Properties
| Edit this page View SourceBack
Property to return the back value of the box.
Declaration
public readonly int Back { get; }
Property Value
Type | Description |
---|---|
int |
Bottom
Property to return the bottom value of the box.
Declaration
public readonly int Bottom { get; }
Property Value
Type | Description |
---|---|
int |
Front
Property to set or return the front value for the box.
Declaration
public int Front { readonly get; set; }
Property Value
Type | Description |
---|---|
int |
IsEmpty
Property to determine if the box is empty.
Declaration
public readonly bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Left
Property to set or return the left value for the box.
Declaration
public int Left { readonly get; set; }
Property Value
Type | Description |
---|---|
int |
Right
Property to return the right value of the box.
Declaration
public readonly int Right { get; }
Property Value
Type | Description |
---|---|
int |
Top
Property to set or return the top value for the box.
Declaration
public int Top { readonly get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceEquals(GorgonBox)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(GorgonBox other)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the other parameter; otherwise, false. |
Equals(in GorgonBox)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(in GorgonBox other)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the other parameter; otherwise, false. |
Equals(in GorgonBox, in GorgonBox)
Function to return whether two instances are equal or not.
Declaration
public static bool Equals(in GorgonBox left, in GorgonBox right)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | left | The left instance to compare. |
GorgonBox | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to this instance; otherwise, false. |
Overrides
| Edit this page View SourceFromTLFRBB(int, int, int, int, int, int)
Function to return a box from top, left, front, right, bottom and back coordinates.
Declaration
public static GorgonBox FromTLFRBB(int top, int left, int front, int right, int bottom, int back)
Parameters
Type | Name | Description |
---|---|---|
int | top | Top coordinate. |
int | left | Left coordinate |
int | front | Front coordinate. |
int | right | Right coordinate. |
int | bottom | Bottom coordinate. |
int | back | Back coordinate. |
Returns
Type | Description |
---|---|
GorgonBox | A new box with the specified coordinates. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Edit this page View SourceIntersect(GorgonBox)
Funciton to determine the intersection between this and another box.
Declaration
public readonly GorgonBox Intersect(GorgonBox box)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | box | Box to intersect. |
Returns
Type | Description |
---|---|
GorgonBox | The intersection between this box and the other box. |
Intersect(GorgonBox, GorgonBox)
Function to determine the intersection between 2 boxes.
Declaration
public static GorgonBox Intersect(GorgonBox box1, GorgonBox box2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | box1 | First box to intersect. |
GorgonBox | box2 | Second box to intersect. |
Returns
Type | Description |
---|---|
GorgonBox | The intersected box. |
Intersect(in GorgonBox, in GorgonBox, out GorgonBox)
Function to determine the intersection between 2 boxes.
Declaration
public static void Intersect(in GorgonBox box1, in GorgonBox box2, out GorgonBox result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | box1 | First box to intersect. |
GorgonBox | box2 | Second box to intersect. |
GorgonBox | result | The resulting intersected box. |
ToString()
Returns a string that represents this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(GorgonBox, GorgonBox)
Operator to determine if 2 instances are equal.
Declaration
public static bool operator ==(GorgonBox left, GorgonBox right)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | left | The left instance to compare. |
GorgonBox | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
operator !=(GorgonBox, GorgonBox)
Operator to determine if 2 instances are not equal.
Declaration
public static bool operator !=(GorgonBox left, GorgonBox right)
Parameters
Type | Name | Description |
---|---|---|
GorgonBox | left | The left instance to compare. |
GorgonBox | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if not equal, false if equal. |