Eris 1.3.16
Public Member Functions | Static Public Member Functions

Eris::InnerTerrainMod_impl Class Reference

Base class for the inner terrain mod implementations. More...

#include <TerrainMod_impl.h>

Inheritance diagram for Eris::InnerTerrainMod_impl:
Eris::InnerTerrainModAdjust_impl< Shape > Eris::InnerTerrainModLevel_impl< Shape > Eris::InnerTerrainModSlope_impl< Shape >

List of all members.

Public Member Functions

 InnerTerrainMod_impl ()
 Ctor.
virtual ~InnerTerrainMod_impl ()
 Dtor.
virtual Mercator::TerrainMod * getModifier ()=0
 Gets the modifier which this instance represents.

Static Public Member Functions

template<typename Shape >
static bool parseShapeAtlasData (const Atlas::Message::Element &shapeElement, const WFMath::Point< 3 > &pos, const WFMath::Quaternion &orientation, Shape **shape)
 Common method for parsing shape data from Atlas.

Detailed Description

Base class for the inner terrain mod implementations.

We keep this separate from the TerrainMod classes because of the way these classes interacts with templated WFMath structures. The parseShapeAtlasData() method can also be used externally as it's a static public.

Author:
Erik Hjortsberg <erik.hjortsberg@iteam.se>

Member Function Documentation

virtual Mercator::TerrainMod* Eris::InnerTerrainMod_impl::getModifier ( ) [pure virtual]

Gets the modifier which this instance represents.

Returns:
A pointer to a terrain modifier, or null if none could be created.

Implemented in Eris::InnerTerrainModSlope_impl< Shape >, Eris::InnerTerrainModLevel_impl< Shape >, and Eris::InnerTerrainModAdjust_impl< Shape >.

template<typename Shape >
bool Eris::InnerTerrainMod_impl::parseShapeAtlasData ( const Atlas::Message::Element &  shapeElement,
const WFMath::Point< 3 > &  pos,
const WFMath::Quaternion &  orientation,
Shape **  shape 
) [static]

Common method for parsing shape data from Atlas.

Since each different shape expects different Atlas data this is a templated method with specialized implemtations for each available shape. If you call this and get error regarding missing implementations it probably means that there's no implementation for the type of shape you're calling it with. Note that a new shape instance will be put on the heap if the parsing is successful, and it's up to the calling code to properly delete it when done.

Parameters:
shapeElementThe atlas map element which contains the shape data. Often this is found with the key "shape" in the atlas data.
posThe original position of the entity to which this shape will belong. The shape will be positioned according to this.
shapeThe resulting shape is meant to be put here, if successfully created. That means that a new shape instance will be created, and it's then up to the calling method to properly delete it, to avoid memory leaks.
Returns:
True if the atlas data was successfully parsed and a shape was created.

Just log an error and return false, this isn't fatal.

rotation about Z axis

This of course depends on the assumption that we'll only ever use 2d shapes. If a 3d shape is used the shift method expects a Vector<3> instead...


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