engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FTextureLayout3d类 参考

An incremental texture space allocator. 更多...

#include <TextureLayout3d.h>

Public 成员函数

bool AddElement (uint32 &OutBaseX, uint32 &OutBaseY, uint32 &OutBaseZ, uint32 ElementSizeX, uint32 ElementSizeY, uint32 ElementSizeZ)
 Finds a free area in the texture large enough to contain a surface with the given size. 更多...
 
 FTextureLayout3d (uint32 MinSizeX, uint32 MinSizeY, uint32 MinSizeZ, uint32 MaxSizeX, uint32 MaxSizeY, uint32 MaxSizeZ, bool bInPowerOfTwoSize=false, bool bInAlignByFour=true)
 Minimal initialization constructor. 更多...
 
uint32 GetSizeX () const
 Returns the minimum texture width which will contain the allocated surfaces.
 
uint32 GetSizeY () const
 Returns the minimum texture height which will contain the allocated surfaces.
 
bool RemoveElement (uint32 ElementBaseX, uint32 ElementBaseY, uint32 ElementBaseZ, uint32 ElementSizeX, uint32 ElementSizeY, uint32 ElementSizeZ)
 Removes a previously allocated element from the layout and collapses the tree as much as possible, In order to create the largest free block possible and return the tree to its state before the element was added. 更多...
 

详细描述

An incremental texture space allocator.

For best results, add the elements ordered descending in size.

构造及析构函数说明

◆ FTextureLayout3d()

FTextureLayout3d::FTextureLayout3d ( uint32  MinSizeX,
uint32  MinSizeY,
uint32  MinSizeZ,
uint32  MaxSizeX,
uint32  MaxSizeY,
uint32  MaxSizeZ,
bool  bInPowerOfTwoSize = false,
bool  bInAlignByFour = true 
)
inline

Minimal initialization constructor.

参数
MinSizeX- The minimum width of the texture.
MinSizeY- The minimum height of the texture.
MaxSizeX- The maximum width of the texture.
MaxSizeY- The maximum height of the texture.
InPowerOfTwoSize- True if the texture size must be a power of two.

成员函数说明

◆ AddElement()

bool FTextureLayout3d::AddElement ( uint32 &  OutBaseX,
uint32 &  OutBaseY,
uint32 &  OutBaseZ,
uint32  ElementSizeX,
uint32  ElementSizeY,
uint32  ElementSizeZ 
)
inline

Finds a free area in the texture large enough to contain a surface with the given size.

If a large enough area is found, it is marked as in use, the output parameters OutBaseX and OutBaseY are set to the coordinates of the upper left corner of the free area and the function return true. Otherwise, the function returns false and OutBaseX and OutBaseY remain uninitialized.

参数
OutBaseX- If the function succeeds, contains the X coordinate of the upper left corner of the free area on return.
OutBaseY- If the function succeeds, contains the Y coordinate of the upper left corner of the free area on return.
ElementSizeX- The size of the surface to allocate in horizontal pixels.
ElementSizeY- The size of the surface to allocate in vertical pixels.
返回
True if succeeded, false otherwise.

◆ RemoveElement()

bool FTextureLayout3d::RemoveElement ( uint32  ElementBaseX,
uint32  ElementBaseY,
uint32  ElementBaseZ,
uint32  ElementSizeX,
uint32  ElementSizeY,
uint32  ElementSizeZ 
)
inline

Removes a previously allocated element from the layout and collapses the tree as much as possible, In order to create the largest free block possible and return the tree to its state before the element was added.

返回
True if the element specified by the input parameters existed in the layout.

该类的文档由以下文件生成: