Unravel Engine C++ Reference
Loading...
Searching...
No Matches
gfx::RectanglePacker Class Reference

Public Member Functions

 RectanglePacker ()
 
 RectanglePacker (uint32_t _width, uint32_t _height)
 
void init (uint32_t _width, uint32_t _height)
 non constructor initialization
 
bool addRectangle (uint16_t _width, uint16_t _height, uint16_t &_outX, uint16_t &_outY)
 
uint32_t getUsedSurface ()
 return the used surface in squared unit
 
uint32_t getTotalSurface ()
 return the total available surface in squared unit
 
float getUsageRatio ()
 return the usage ratio of the available surface [0:1]
 
void clear ()
 reset to initial state
 

Detailed Description

Definition at line 16 of file cube_atlas.cpp.

Constructor & Destructor Documentation

◆ RectanglePacker() [1/2]

gfx::RectanglePacker::RectanglePacker ( )

Definition at line 70 of file cube_atlas.cpp.

◆ RectanglePacker() [2/2]

gfx::RectanglePacker::RectanglePacker ( uint32_t _width,
uint32_t _height )

Definition at line 74 of file cube_atlas.cpp.

Member Function Documentation

◆ addRectangle()

bool gfx::RectanglePacker::addRectangle ( uint16_t _width,
uint16_t _height,
uint16_t & _outX,
uint16_t & _outY )

find a suitable position for the given rectangle

Returns
true if the rectangle can be added, false otherwise

Definition at line 95 of file cube_atlas.cpp.

◆ clear()

void gfx::RectanglePacker::clear ( )

reset to initial state

Definition at line 174 of file cube_atlas.cpp.

◆ getTotalSurface()

uint32_t gfx::RectanglePacker::getTotalSurface ( )
inline

return the total available surface in squared unit

Definition at line 36 of file cube_atlas.cpp.

◆ getUsageRatio()

float gfx::RectanglePacker::getUsageRatio ( )

return the usage ratio of the available surface [0:1]

Definition at line 163 of file cube_atlas.cpp.

◆ getUsedSurface()

uint32_t gfx::RectanglePacker::getUsedSurface ( )
inline

return the used surface in squared unit

Definition at line 30 of file cube_atlas.cpp.

◆ init()

void gfx::RectanglePacker::init ( uint32_t _width,
uint32_t _height )

non constructor initialization

Definition at line 81 of file cube_atlas.cpp.


The documentation for this class was generated from the following file: