Nimbus
0.2
A game... with arrows... which should be clouds
|
#include <WindMap.h>
Classes | |
class | ArrowCatcher |
Public Member Functions | |
WindMap (Ogre::Real worldSize, Ogre::Real resolution, Ogre::Vector2 offset, Ogre::Real minimumCurrentLength) | |
void | update (void) |
void | addWindCurrent (WindCurrent *windCurrent) |
void | removeWindCurrent (WindCurrent *windCurrent) |
Ogre::Vector2 | getWindVector (Ogre::Real x, Ogre::Real y) |
Ogre::Vector2 | getWindVector (Ogre::Vector2 position) |
Ogre::Vector2 | getAverageWindVector (Ogre::Real topLeftx, Ogre::Real topLefty, Ogre::Real botRightx, Ogre::Real botRighty) |
Ogre::Vector2 | getAverageWindVector (Ogre::Vector2 topLeft, Ogre::Vector2 botRight) |
std::list< WindCurrent * > * | getWindCurrents () |
Ogre::Vector2 | getAlphaVector () |
Ogre::Vector2 | getOffset () |
Protected Attributes | |
Nimbus::WindMap::ArrowCatcher * | mArrowCatcher |
Stores all information relating to wind movement Contains an VectorRow Contains an list of WindCurrents
WindMap::WindMap | ( | Ogre::Real | worldSize, |
Ogre::Real | resolution, | ||
Ogre::Vector2 | offset, | ||
Ogre::Real | minimumCurrentLength | ||
) |
Creates a basic wind map.
worldSize | The size of the world in world distance. Right now assumes everything to be square... could change |
resolution | The resolution of the vector map in terms of world coordinates. This value is the world distance between each wind vector in the vector map. |
offset | The offset to the center of the map. |
minimumCurrentLength | The minimum length of a current accepted by the map. |
void WindMap::addWindCurrent | ( | WindCurrent * | windCurrent | ) |
Adds a wind current to the wind current list. Any wind current shorter than mMinimumCurrentLength will not be added and an entry will be written to the log.
windCurrent | A pointer to the wind current which should be added to the wind map. |
|
inline |
Unexpectedly gets the alpha vector.
Ogre::Vector2 WindMap::getAverageWindVector | ( | Ogre::Real | topLeftx, |
Ogre::Real | topLefty, | ||
Ogre::Real | botRightx, | ||
Ogre::Real | botRighty | ||
) |
Gets the average wind vector in the given area of map coordinates.
topLeftx | The top left x coordinate in map coordinates |
topLefty | The top left y coordinate in map coordinates |
botRightx | The bottom right x coordinate in map coordinates |
botRighty | The bottom right y coordinate in map coordinates |
Ogre::Vector2 WindMap::getAverageWindVector | ( | Ogre::Vector2 | topLeft, |
Ogre::Vector2 | botRight | ||
) |
Gets the average wind vector in the given area of map coordinates.
topLeft | The top left corner of the area in map coordinates |
botRight | The bottom right corner of the area in map coordinates |
|
inline |
Gets the offset of the wind map to the center of the wind map
std::list< WindCurrent * > * WindMap::getWindCurrents | ( | ) |
Gets the current list of wind currents.
Ogre::Vector2 WindMap::getWindVector | ( | Ogre::Real | x, |
Ogre::Real | y | ||
) |
Gets the wind vector at the given map coordinates
x | The x coordinate in map coordinates of the wind vector to retrieve. |
y | The y coordinate in map coordinates of the wind vector to retrieve. |
Ogre::Vector2 WindMap::getWindVector | ( | Ogre::Vector2 | position | ) |
Gets the wind vector at the given map coordinates.
position | The x and y coordinates in map coordinates of the wind vector to retrieve. |
void WindMap::removeWindCurrent | ( | WindCurrent * | windCurrent | ) |
Removes a wind current from the current wind current list
windCurrent | A pointer to the wind current which should be deleted from the wind map. |
void WindMap::update | ( | void | ) |
Recalculates the vector map based on the current list of wind currents.