GigaPasjans
Loading...
Searching...
No Matches
Box Struct Reference

Represents a rectangular area defined by a position and size, using signed 32-bit integers. More...

#include <Box.h>

Collaboration diagram for Box:

Public Member Functions

Int2 GetCenter () const
 Calculates and returns the center point of the box.
 
Int2 GetPosition () const
 Gets the position (top-left corner) of the box.
 
Int2 GetSize () const
 Gets the size (width and height) of the box.
 
bool operator== (const Box &box) const
 Compares this box with another for equality.
 
constexpr Box (int32 x, int32 y, int32 width, int32 height)
 
constexpr Box (Int2 position, Int2 size)
 
bool Intersects (const Int2 &ray) const
 

Public Attributes

union { 
 
   struct { 
 
      int32   X 
 
      int32   Y 
 
      int32   Width 
 
      int32   Height 
 
   }  
 
   int32   Raw [4] 
 
};  
 

Static Public Attributes

static const Box Zero = Box(0, 0, 0, 0)
 

Detailed Description

Represents a rectangular area defined by a position and size, using signed 32-bit integers.

Member Function Documentation

◆ GetCenter()

Int2 Box::GetCenter ( ) const
inline

Calculates and returns the center point of the box.

Returns
Int2 A vector representing the center of the box.

The documentation for this struct was generated from the following files: