Wasabi
|
#include <WTerrain.hpp>
Public Member Functions | |
virtual std::string | GetTypeName () const override |
virtual void | SetID (uint32_t newID) override |
virtual void | SetName (std::string newName) override |
WTerrain (class Wasabi *const app, uint32_t ID=0) | |
WError | Create (uint32_t N=256, float size=1.0f, uint32_t numRings=6) |
void | SetViewpoint (WVector3 point) |
bool | WillRender (class WRenderTarget *rt) |
void | Render (class WRenderTarget *rt, WMaterial *material) |
float | GetHeight (WVector2 pos2D) |
void | Show () |
void | Hide () |
bool | Hidden () const |
WMatrix | GetWorldMatrix () |
bool | UpdateLocals () |
virtual bool | Valid () const override |
virtual void | OnStateChange (STATE_CHANGE_TYPE type) override |
![]() | |
WBase (class Wasabi *const app, uint32_t ID=0) | |
uint32_t | GetID () const |
std::string | GetName () const |
class Wasabi * | GetAppPtr () const |
void | AddReference () |
void | RemoveReference () |
![]() | |
void | SetPosition (float x, float y, float z) |
void | SetPosition (const WVector3 pos) |
void | Point (float x, float y, float z) |
void | Point (WVector3 target) |
void | SetAngle (WQuaternion quat) |
void | SetToRotation (const WOrientation *const device) |
void | SetULRVectors (WVector3 up, WVector3 look, WVector3 right) |
void | SetToTransformation (WMatrix mtx) |
void | Yaw (float angle) |
void | Roll (float angle) |
void | Pitch (float angle) |
void | Move (float units) |
void | Strafe (float units) |
void | Fly (float units) |
float | GetPositionX () const |
float | GetPositionY () const |
float | GetPositionZ () const |
WVector3 | GetPosition () const |
float | GetAngleX () const |
float | GetAngleY () const |
float | GetAngleZ () const |
WQuaternion | GetRotation () const |
WVector3 | GetUVector () const |
WVector3 | GetLVector () const |
WVector3 | GetRVector () const |
virtual void | SetBindingMatrix (WMatrix mtx) |
void | RemoveBinding () |
WMatrix | GetBindingMatrix () const |
bool | IsBound () const |
WMatrix | ComputeTransformation () const |
WMatrix | ComputeInverseTransformation () const |
![]() | |
void | AddEffect (class WEffect *effect, uint32_t bindingSet=0) |
void | RemoveEffect (class WEffect *effect) |
void | RemoveEffect (class WMaterial *material) |
void | ClearEffects () |
class WMaterial * | GetMaterial (class WEffect *effect) |
class WMaterialCollection & | GetMaterials () |
Static Public Member Functions | |
static std::string | _GetTypeName () |
Additional Inherited Members | |
![]() | |
void | _AddMaterial (class WMaterial *material) |
virtual void | OnMaterialAdded (class WMaterial *newMaterial) |
![]() | |
class Wasabi * | m_app |
uint32_t | m_ID |
std::string | m_name |
![]() | |
std::unordered_map< class WEffect *, class WMaterial * > | m_materialMap |
class WMaterialCollection * | m_materialsCollection |
This represents a terrain object and is responsible for rendering it.
|
static |
Returns "Terrain" string.
WError WTerrain::Create | ( | uint32_t | N = 256 , |
float | size = 1.0f , |
||
uint32_t | numRings = 6 |
||
) |
Initializes the terrain.
N | Dimension (in number of vertices) of each block in the terrain, must be a power of 2 greater than 1 |
size | Size of each square in the highest resolution block, must be greater than 0 |
numRings | Number of LOD rings drawn around the origin |
float WTerrain::GetHeight | ( | WVector2 | pos2D | ) |
Retrieves the height of the terrain at a given point on the xz plain
pos2D | x and z coordinates to retrieve the height at |
|
overridevirtual |
This function must be implemented by a child class. This is used for debugging, in which a class should return its name.
Implements WBase.
WMatrix WTerrain::GetWorldMatrix | ( | ) |
Retrieves the world matrix for the terrain.
bool WTerrain::Hidden | ( | ) | const |
Checks if the terrain hidden.
void WTerrain::Hide | ( | ) |
Hides the terrain.
|
overridevirtual |
A callback called by this class when the entity changes its position or orientation.
type | Orientation change type |
Reimplemented from WOrientation.
void WTerrain::Render | ( | class WRenderTarget * | rt, |
WMaterial * | material | ||
) |
Renders the terrain to the given render target. @params rt Render target to render to
material | Material to use for rendering |
|
overridevirtual |
|
overridevirtual |
void WTerrain::SetViewpoint | ( | WVector3 | point | ) |
Sets the point around which the terrain is loaded. The terrain will not immediately load around the point.
point | Point to load the terrain around |
void WTerrain::Show | ( | ) |
Shows the terrain so that it can be rendered.
bool WTerrain::UpdateLocals | ( | ) |
Updates the world matrix of the terrain.
|
overridevirtual |
Implements WBase.
bool WTerrain::WillRender | ( | class WRenderTarget * | rt | ) |
Checks whether a call to Render() will cause any rendering (draw call) to happen.