Computes the velocity of a flow at a given point. More...
#include <FlowTile.h>
Public Types | |
enum | DATATYPE |
Determines the type of data at a point. More... | |
Public Member Functions | |
FlowTile (float ox, float oy, float size) | |
Creates a new FlowTile. | |
virtual | ~FlowTile () |
Deletes this FlowTile. | |
virtual int | getType (vec2d &pos) |
Returns a defined type for a given position in the tile. | |
virtual void | getVelocity (vec2d &pos, vec2d &velocity, int &type)=0 |
Returns the velocity at a given point, depending on the data contained in this FlowTile. | |
virtual void | getDataType (vec2d &pos, int &type) |
Returns the data type at a given point. | |
bool | contains (float x, float y) |
Returns true if the given point is inside this FlowTile's viewport. | |
Protected Attributes | |
float | ox |
The x coordinate of the lower left corner of this Tile. | |
float | oy |
The y coordinate of the lower left corner of this Tile. | |
float | size |
Width of this Tile. |
Computes the velocity of a flow at a given point.
Can be used for any moving elements. In this class, the word Tile will refer to a 2D region on a terrain. It may correspond to a TileProducer Tiles, but can also be completely independent from that. You just need to define the considered region on that terrain.
Determines the type of data at a point.
proland::FlowTile::FlowTile | ( | float | ox, | |
float | oy, | |||
float | size | |||
) |
Creates a new FlowTile.
ox | the x coordinate of the lower left corner of this Tile. | |
oy | the y coordinate of the lower left corner of this Tile. | |
size | width of this Tile. |
virtual proland::FlowTile::~FlowTile | ( | ) | [virtual] |
Deletes this FlowTile.
bool proland::FlowTile::contains | ( | float | x, | |
float | y | |||
) |
Returns true if the given point is inside this FlowTile's viewport.
x | x coordinate. | |
y | y coordinate. |
virtual void proland::FlowTile::getDataType | ( | vec2d & | pos, | |
int & | type | |||
) | [virtual] |
Returns the data type at a given point.
Simplified version of getVelocity().
pos | a XY position inside the viewport of this FlowTile. | |
[out] | type | type of data at given coordinates. See dataType. |
virtual int proland::FlowTile::getType | ( | vec2d & | pos | ) | [virtual] |
Returns a defined type for a given position in the tile.
pos | a position inside the tile's viewport. |
virtual void proland::FlowTile::getVelocity | ( | vec2d & | pos, | |
vec2d & | velocity, | |||
int & | type | |||
) | [pure virtual] |
float proland::FlowTile::ox [protected] |
The x coordinate of the lower left corner of this Tile.
float proland::FlowTile::oy [protected] |
The y coordinate of the lower left corner of this Tile.
float proland::FlowTile::size [protected] |
Width of this Tile.