Pyrogenesis  trunk
Public Member Functions | List of all members
MockTerrain Class Reference

Simple terrain implementation with constant height of 50. More...

#include <ComponentTest.h>

Inheritance diagram for MockTerrain:
Inheritance graph
[legend]
Collaboration diagram for MockTerrain:
Collaboration graph
[legend]

Public Member Functions

bool IsLoaded () const override
 
CFixedVector3D CalcNormal (entity_pos_t x, entity_pos_t z) const override
 
CVector3D CalcExactNormal (float x, float z) const override
 
entity_pos_t GetGroundLevel (entity_pos_t x, entity_pos_t z) const override
 
float GetExactGroundLevel (float x, float z) const override
 
u16 GetTilesPerSide () const override
 Returns number of tiles per side on the terrain. More...
 
u32 GetMapSize () const override
 Returns the map size in metres (world space units). More...
 
u16 GetVerticesPerSide () const override
 Returns number of vertices per side on the terrain. More...
 
CTerrainGetCTerrain () override
 
void MakeDirty (i32 i0, i32 j0, i32 i1, i32 j1) override
 Indicate that terrain tiles within the given region (inclusive lower bound, exclusive upper bound) have been changed. More...
 
void ReloadTerrain (bool ReloadWater) override
 Call when the underlying CTerrain has been modified behind our backs. More...
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
virtual void Init (const CParamNode &paramNode)=0
 
virtual void Deinit ()=0
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
CEntityHandle GetEntityHandle () const
 
void SetEntityHandle (CEntityHandle ent)
 
entity_id_t GetEntityId () const
 
CEntityHandle GetSystemEntity () const
 
const CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual void Serialize (ISerializer &serialize)=0
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)=0
 
virtual bool NewJSObject (const ScriptInterface &scriptInterface, JS::MutableHandleObject out) const
 Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More...
 
virtual JS::Value GetJSInstance () const
 
virtual int GetComponentTypeId () const =0
 

Additional Inherited Members

- Public Types inherited from IComponent
using AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor)
 
using DeallocFunc = void(*)(IComponent *)
 
- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static void RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static void RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static u8 GetSerializationVersion ()
 

Detailed Description

Simple terrain implementation with constant height of 50.

Member Function Documentation

◆ CalcExactNormal()

CVector3D MockTerrain::CalcExactNormal ( float  x,
float  z 
) const
inlineoverridevirtual

Implements ICmpTerrain.

◆ CalcNormal()

CFixedVector3D MockTerrain::CalcNormal ( entity_pos_t  x,
entity_pos_t  z 
) const
inlineoverridevirtual

Implements ICmpTerrain.

◆ GetCTerrain()

CTerrain* MockTerrain::GetCTerrain ( )
inlineoverridevirtual

Implements ICmpTerrain.

◆ GetExactGroundLevel()

float MockTerrain::GetExactGroundLevel ( float  x,
float  z 
) const
inlineoverridevirtual

Implements ICmpTerrain.

◆ GetGroundLevel()

entity_pos_t MockTerrain::GetGroundLevel ( entity_pos_t  x,
entity_pos_t  z 
) const
inlineoverridevirtual

Implements ICmpTerrain.

◆ GetMapSize()

u32 MockTerrain::GetMapSize ( ) const
inlineoverridevirtual

Returns the map size in metres (world space units).

Implements ICmpTerrain.

◆ GetTilesPerSide()

u16 MockTerrain::GetTilesPerSide ( ) const
inlineoverridevirtual

Returns number of tiles per side on the terrain.

Return value is always non-zero.

Implements ICmpTerrain.

◆ GetVerticesPerSide()

u16 MockTerrain::GetVerticesPerSide ( ) const
inlineoverridevirtual

Returns number of vertices per side on the terrain.

Return value is always non-zero.

Implements ICmpTerrain.

◆ IsLoaded()

bool MockTerrain::IsLoaded ( ) const
inlineoverridevirtual

Implements ICmpTerrain.

◆ MakeDirty()

void MockTerrain::MakeDirty ( i32  i0,
i32  j0,
i32  i1,
i32  j1 
)
inlineoverridevirtual

Indicate that terrain tiles within the given region (inclusive lower bound, exclusive upper bound) have been changed.

CMessageTerrainChanged will be sent to any components that care about terrain changes.

Implements ICmpTerrain.

◆ ReloadTerrain()

void MockTerrain::ReloadTerrain ( bool  ReloadWater)
inlineoverridevirtual

Call when the underlying CTerrain has been modified behind our backs.

(TODO: eventually we should manage the CTerrain in this class so nobody can modify it behind our backs).

Implements ICmpTerrain.


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