
#include <hgePolygonMap.h>
Public Member Functions | |
| bool | SaveFile (std::string filename="MyFile.map") |
| bool | LoadFile (std::string filename="MyFile.map") |
| std::vector< hgeEntity * > * | GetDynamicEntityList (int m_renderlayer) |
| std::vector< hgeEntity * > * | GetDynamicEntityList (std::string m_classname) |
| hgePolygon * | GetStaticEntityFromProperty (std::string m_pname, std::string m_pval) |
| hgePolygon * | GetDynamicEntityFromProperty (std::string m_pname, std::string m_pval) |
| void | RegisterEntityClass (std::string entclass, hgeEntity *ent) |
| void | SetTransform (hgeVector m_pos, float m_zoom=1) |
| hgeVector | MapToScreen (hgeVector pos) |
| hgeVector | ScreenToMap (hgeVector pos) |
| void | AddDynamicEntity (hgeEntity *entity, bool initialize_entity=true) |
| void | RemoveDynamicEntitys (std::string entity_class) |
| bool | TestVisibility (hgePolygon *p, float padding=0) |
| hgePolygon * | TestPoint (hgeVector pos, int test_type=COLLIDE_STATIC, std::string class_filter="", int layer_filter=-1) |
| hgeIntersect | Test (hgeShape *shape, hgeVector offset=hgeVector(0, 0), hgePolygon **return_poly=NULL, int test_type=COLLIDE_STATIC, std::string class_filter="", int layer_filter=-1) |
| hgeIntersect | TestEx (hgeEntityEx *polygon, hgeVector offset=hgeVector(0, 0), float rot=0, hgePolygon **return_poly=NULL, int test_type=COLLIDE_STATIC, std::string class_filter="", int layer_filter=-1) |
| void | Clear () |
| void | Update (float dt) |
| void | Render () |
| hgePolygonMap (hgeVector m_viewSize=hgeVector(800, 600)) | |
| void hgePolygonMap::AddDynamicEntity | ( | hgeEntity * | entity, | |
| bool | initialize_entity = true | |||
| ) |
| hgePolygon * hgePolygonMap::GetDynamicEntityFromProperty | ( | std::string | m_pname, | |
| std::string | m_pval | |||
| ) |
Returns a polygon pointer given a property & value in entity data.
| m_pname | Property name to check, eg "sprite" | |
| m_pval | Property value to check, eg "test.png" |
| hgePolygon * hgePolygonMap::GetStaticEntityFromProperty | ( | std::string | m_pname, | |
| std::string | m_pval | |||
| ) |
Returns a polygon pointer given a property & value in entity data.
| m_pname | Property name to check, eg "sprite" | |
| m_pval | Property value to check, eg "test.png" |
| bool hgePolygonMap::LoadFile | ( | std::string | filename = "MyFile.map" |
) |
Loads a map file.
| filename | Location of the map file to load, eg "maps/my_level.map". |
| hgeVector hgePolygonMap::MapToScreen | ( | hgeVector | pos | ) |
Converts map coordinates to screen coordinates.
| pos | Vector in world coordinates. |
| void hgePolygonMap::RegisterEntityClass | ( | std::string | entclass, | |
| hgeEntity * | ent | |||
| ) |
Links a hgeEntity derived class to a given classname.
| entclass | String containing the class name you wish to link the entity to. | |
| ent | Pointer to an instance of the class to link to the classname. The map will handle this pointer once registered. |
| void hgePolygonMap::RemoveDynamicEntitys | ( | std::string | entity_class | ) |
Removes dynamic entitys by their classname.
| entity_class | Class name to search for. |
| void hgePolygonMap::Render | ( | ) |
Renders the map.
| hgeVector hgePolygonMap::ScreenToMap | ( | hgeVector | pos | ) |
Converts screen coordinates to world coordinates.
| pos | Vector in screen coordinates. |
| void hgePolygonMap::SetTransform | ( | hgeVector | m_pos, | |
| float | m_zoom = 1 | |||
| ) |
Sets the cameras position & zoom over the map.
| m_pos | Camera position, in world coordinates. | |
| m_zoom | Camera zoom. |
| hgeIntersect hgePolygonMap::Test | ( | hgeShape * | shape, | |
| hgeVector | offset = hgeVector(0,0), |
|||
| hgePolygon ** | return_poly = NULL, |
|||
| int | test_type = COLLIDE_STATIC, |
|||
| std::string | class_filter = "", |
|||
| int | layer_filter = -1 | |||
| ) |
Test the map & entitys for a collision with a given shape.
| shape | Pointer to a hgeShape derivative, eg a line, circle, or polygon | |
| offset | Vector specifying an offset to test the shape at | |
| return_poly | Pointer which is set to the polygon hit in the collision test | |
| test_type | Determines collision test type. Possible values are: COLLIDE_STATIC - Tests the given shape against all static polygons. COLLIDE_DYNAIC - Tests the given shape against dynamic entitys. COLLIDE_MULTI - Tests for multiple collisions. These parameters can be added together, eg COLLIDE_STATIC + COLLIDE_MULTIPLE | |
| class_filter | String specifying a specific classname of entity to test against | |
| layer_filter | Integer specifying a particular map layer to perform the collision test on |
| hgeIntersect hgePolygonMap::TestEx | ( | hgeEntityEx * | polygon, | |
| hgeVector | offset = hgeVector(0,0), |
|||
| float | rot = 0, |
|||
| hgePolygon ** | return_poly = NULL, |
|||
| int | test_type = COLLIDE_STATIC, |
|||
| std::string | class_filter = "", |
|||
| int | layer_filter = -1 | |||
| ) |
Test the map & entitys for a collision with an hgeEntityEx, including an offset rotation.
| shape | Pointer to a hgeEntityEx derivative, eg a line, circle, or polygon | |
| offset | Vector specifying an offset to test the shape at | |
| rot | Float specifying an offset angle to test the shape at | |
| return_poly | Pointer which is set to the polygon hit in the collision test | |
| test_type | Determines collision test type. Possible values are: COLLIDE_STATIC - Tests the given shape against all static polygons. COLLIDE_DYNAIC - Tests the given shape against dynamic entitys. COLLIDE_MULTI - Tests for multiple collisions. These parameters can be added together, eg COLLIDE_STATIC + COLLIDE_MULTIPLE | |
| class_filter | String specifying a specific classname of entity to test against | |
| layer_filter | Integer specifying a particular map layer to perform the collision test on |
| hgePolygon * hgePolygonMap::TestPoint | ( | hgeVector | point, | |
| int | test_type = COLLIDE_STATIC, |
|||
| std::string | class_filter = "", |
|||
| int | layer_filter = -1 | |||
| ) |
Finds polygon at specified point.
| pos | Point to test, in world coordinates. | |
| test_type | Determines collision test type. Possible values are: COLLIDE_STATIC - Tests the given shape against all static polygons. COLLIDE_DYNAIC - Tests the given shape against dynamic entitys. COLLIDE_MULTI - Tests for multiple collisions. These parameters can be added together, eg COLLIDE_STATIC + COLLIDE_MULTIPLE | |
| class_filter | String specifying a specific classname of entity to test against | |
| layer_filter | Integer specifying a particular map layer to perform the collision test on |
| bool hgePolygonMap::TestVisibility | ( | hgePolygon * | p, | |
| float | padding = 0 | |||
| ) |
Tests if a polygon is visible to the camera.
| p | Polygon to test | |
| padding | Padding value around the edges of the screen to add to the visibility test. |
| void hgePolygonMap::Update | ( | float | dt | ) |
Updates the map & entitys.
| dt | Delta time |
1.5.8