ZeroZero Game Engine  v0.0
A 3D game engine using Vulkan & Jolt
Public Member Functions | Public Attributes | List of all members
Rect Struct Reference

Detailed Description

Define a rectangular area with a bottom-left origin

Public Member Functions

bool contains (const float X, const float Y) const
 
bool contains (const Rect &R) const
 
void intersect (const Rect &A, const Rect &B)
 

Public Attributes

float x {0.0f}
 
float y {0.0f}
 
float width {0.0f}
 
float height {0.0f}
 

Member Function Documentation

bool contains ( const float  X,
const float  Y 
) const
nodiscardinline

Returns true if the given point is inside the rect

bool contains ( const Rect &  R) const
nodiscardinline

Returns true if the given rect is inside the rect

void intersect ( const Rect &  A,
const Rect &  B 
)
inline

The rect is the result of the intersection between two rects

Member Data Documentation

float height {0.0f}

Height

float width {0.0f}

Width

float x {0.0f}

Bottom-Left corner X position

float y {0.0f}

Bottom-Left corner Y position