Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CCmpTerrain Class Referencefinal
Inheritance diagram for CCmpTerrain:
Inheritance graph
[legend]
Collaboration diagram for CCmpTerrain:
Collaboration graph
[legend]

Public Member Functions

int GetComponentTypeId () const override
 
void Init (const CParamNode &paramNode) override
 
void Deinit () override
 
void Serialize (ISerializer &serialize) override
 
void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize) override
 
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 ReloadTerrain (bool ReloadWater) override
 Call when the underlying CTerrain has been modified behind our backs. More...
 
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...
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
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 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
 

Static Public Member Functions

static void ClassInit (CComponentManager &componentManager)
 
static IComponentAllocate (const ScriptInterface &, JS::HandleValue)
 
static void Deallocate (IComponent *cmp)
 
static std::string GetSchema ()
 
- 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 ()
 

Public Attributes

CTerrainm_Terrain
 

Additional Inherited Members

- Public Types inherited from IComponent
using AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor)
 
using DeallocFunc = void(*)(IComponent *)
 

Member Function Documentation

◆ Allocate()

static IComponent* CCmpTerrain::Allocate ( const ScriptInterface ,
JS::HandleValue   
)
inlinestatic

◆ CalcExactNormal()

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

Implements ICmpTerrain.

◆ CalcNormal()

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

Implements ICmpTerrain.

◆ ClassInit()

static void CCmpTerrain::ClassInit ( CComponentManager componentManager)
inlinestatic

◆ Deallocate()

static void CCmpTerrain::Deallocate ( IComponent cmp)
inlinestatic

◆ Deinit()

void CCmpTerrain::Deinit ( )
inlineoverridevirtual

Implements IComponent.

◆ Deserialize()

void CCmpTerrain::Deserialize ( const CParamNode paramNode,
IDeserializer deserialize 
)
inlineoverridevirtual

Implements IComponent.

◆ GetComponentTypeId()

int CCmpTerrain::GetComponentTypeId ( ) const
inlineoverridevirtual

Implements IComponent.

◆ GetCTerrain()

CTerrain* CCmpTerrain::GetCTerrain ( )
inlineoverridevirtual

Implements ICmpTerrain.

◆ GetExactGroundLevel()

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

Implements ICmpTerrain.

◆ GetGroundLevel()

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

Implements ICmpTerrain.

◆ GetMapSize()

u32 CCmpTerrain::GetMapSize ( ) const
inlineoverridevirtual

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

Implements ICmpTerrain.

◆ GetSchema()

static std::string CCmpTerrain::GetSchema ( )
inlinestatic

◆ GetTilesPerSide()

u16 CCmpTerrain::GetTilesPerSide ( ) const
inlineoverridevirtual

Returns number of tiles per side on the terrain.

Return value is always non-zero.

Implements ICmpTerrain.

◆ GetVerticesPerSide()

u16 CCmpTerrain::GetVerticesPerSide ( ) const
inlineoverridevirtual

Returns number of vertices per side on the terrain.

Return value is always non-zero.

Implements ICmpTerrain.

◆ Init()

void CCmpTerrain::Init ( const CParamNode paramNode)
inlineoverridevirtual

Implements IComponent.

◆ IsLoaded()

bool CCmpTerrain::IsLoaded ( ) const
inlineoverridevirtual

Implements ICmpTerrain.

◆ MakeDirty()

void CCmpTerrain::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 CCmpTerrain::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.

◆ Serialize()

void CCmpTerrain::Serialize ( ISerializer serialize)
inlineoverridevirtual

Implements IComponent.

Member Data Documentation

◆ m_Terrain

CTerrain* CCmpTerrain::m_Terrain

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