Wasabi
Public Member Functions | Friends | List of all members
WTerrainManager Class Reference

#include <WTerrain.hpp>

Inheritance diagram for WTerrainManager:
WManager< WTerrain >

Public Member Functions

 WTerrainManager (class Wasabi *const app)
 
WError Load ()
 
WTerrainCreateTerrain (uint32_t N=256, float size=1.0f, uint32_t numRings=7, uint32_t ID=0)
 
- Public Member Functions inherited from WManager< WTerrain >
 WManager (class Wasabi *const a)
 
bool RegisterChangeCallback (std::string name, std::function< void(WTerrain *, bool)> callback)
 
void RemoveChangeCallback (std::string name)
 
void AddEntity (WTerrain *entity)
 
bool RemoveEntity (WTerrain *entity)
 
void OnEntityNameChanged (WTerrain *entity, std::string oldName)
 
virtual void Init ()
 
WTerrainGetEntity (uint32_t ID) const
 
WTerrainGetEntity (std::string name) const
 
WTerrainGetEntityByIndex (uint32_t index) const
 
uint32_t GetEntitiesCount (void) const
 

Friends

class WTerrain
 

Additional Inherited Members

- Public Attributes inherited from WManager< WTerrain >
class Wasabi *const m_app
 
- Protected Attributes inherited from WManager< WTerrain >
std::vector< WTerrain * > m_entities [W_HASHTABLESIZE]
 
std::unordered_map< std::string, WTerrain * > m_entitiesByName
 

Detailed Description

Manager class for WTerrain.

Member Function Documentation

◆ CreateTerrain()

WTerrain* WTerrainManager::CreateTerrain ( uint32_t  N = 256,
float  size = 1.0f,
uint32_t  numRings = 7,
uint32_t  ID = 0 
)

Initializes the terrain.

Parameters
NDimension (in number of vertices) of each block in the terrain, must be a power of 2 greater than 1
sizeSize of each square in the highest resolution block, must be greater than 0
numRingsNumber of LOD rings drawn around the origin
IDID of the newly created terrain
Returns
Newly allocated terrain, or nullptr on failure

◆ Load()

WError WTerrainManager::Load ( )

Loads the manager.

Returns
Error code, see WError.h

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