Base class for the inner terrain mod implementations. More...
#include <TerrainMod_impl.h>
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. |
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.
virtual Mercator::TerrainMod* Eris::InnerTerrainMod_impl::getModifier | ( | ) | [pure virtual] |
Gets the modifier which this instance represents.
Implemented in Eris::InnerTerrainModSlope_impl< Shape >, Eris::InnerTerrainModLevel_impl< Shape >, and Eris::InnerTerrainModAdjust_impl< Shape >.
Referenced by Eris::InnerTerrainModSlope::parseAtlasData().
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.
shapeElement | The atlas map element which contains the shape data. Often this is found with the key "shape" in the atlas data. | |
pos | The original position of the entity to which this shape will belong. The shape will be positioned according to this. | |
shape | The 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. |
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...