![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <CollisionMap.h>
Classes | |
| struct | PathNode |
Static Public Member Functions | |
| static NavigationMap & | Get () |
Public Attributes | |
| int | m_width = 0 |
| int | m_height = 0 |
| GridProjectionType | m_projection = GridProjectionType::Ortho |
| float | m_tileWidth = 32.0f |
| float | m_tileHeight = 32.0f |
| CollisionLayer | m_activeLayer = CollisionLayer::Ground |
| int | m_numLayers = 1 |
Definition at line 190 of file CollisionMap.h.
|
default |
|
default |
|
delete |
| void NavigationMap::Clear | ( | ) |
Definition at line 663 of file CollisionMap.cpp.
References Ground, m_activeLayer, m_height, m_numLayers, and m_width.
| bool NavigationMap::FindPath | ( | int | startX, |
| int | startY, | ||
| int | goalX, | ||
| int | goalY, | ||
| std::vector< Vector > & | outPath, | ||
| CollisionLayer | layer = CollisionLayer::Ground, |
||
| int | maxIterations = 10000 |
||
| ) |
Definition at line 498 of file CollisionMap.cpp.
References NavigationMap::PathNode::fCost(), GetComponentTypeID_Static(), GetNeighbors(), GetTraversalCost(), GridToWorld(), Heuristic(), IsNavigable(), IsValidGridPosition(), m_width, and NavigationMap::PathNode::parent.
Here is the call graph for this function:
|
inlinestatic |
Definition at line 193 of file CollisionMap.h.
References GetComponentTypeID_Static().
Referenced by ExecuteBTAction(), World::GenerateCollisionAndNavigationMaps(), and NavigationSystem::RequestPath().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 205 of file CollisionMap.h.
References m_activeLayer.
|
inline |
Definition at line 225 of file CollisionMap.h.
References m_height.
| void NavigationMap::GetNeighbors | ( | int | x, |
| int | y, | ||
| std::vector< std::pair< int, int > > & | outNeighbors | ||
| ) | const |
Definition at line 461 of file CollisionMap.cpp.
References GetComponentTypeID_Static(), HexAxial, Iso, m_projection, and Ortho.
Referenced by FindPath().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 226 of file CollisionMap.h.
References m_projection.
| bool NavigationMap::GetRandomNavigablePoint | ( | float | centerX, |
| float | centerY, | ||
| float | radius, | ||
| int | maxAttempts, | ||
| float & | outX, | ||
| float & | outY, | ||
| CollisionLayer | layer = CollisionLayer::Ground |
||
| ) | const |
Definition at line 671 of file CollisionMap.cpp.
References GetComponentTypeID_Static(), IsNavigable(), IsValidGridPosition(), and WorldToGrid().
Referenced by ExecuteBTAction().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 394 of file CollisionMap.cpp.
References GetTraversalCost(), and m_activeLayer.
Referenced by FindPath(), and GetTraversalCost().
Here is the call graph for this function:
Here is the caller graph for this function:| float NavigationMap::GetTraversalCost | ( | int | x, |
| int | y, | ||
| CollisionLayer | layer | ||
| ) | const |
Definition at line 410 of file CollisionMap.cpp.
References CollisionMap::Get(), GetComponentTypeID_Static(), and TileProperties::traversalCost.
Here is the call graph for this function:
|
inline |
Definition at line 224 of file CollisionMap.h.
References m_width.
| void NavigationMap::GridToWorld | ( | int | gridX, |
| int | gridY, | ||
| float & | outWorldX, | ||
| float & | outWorldY | ||
| ) | const |
Definition at line 426 of file CollisionMap.cpp.
References CollisionMap::Get(), GetComponentTypeID_Static(), and CollisionMap::GridToWorld().
Referenced by FindPath().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 436 of file CollisionMap.cpp.
References GetComponentTypeID_Static(), HexAxial, Iso, m_projection, and Ortho.
Referenced by FindPath().
Here is the call graph for this function:
Here is the caller graph for this function:| void NavigationMap::Initialize | ( | int | width, |
| int | height, | ||
| GridProjectionType | projection, | ||
| float | tileWidth, | ||
| float | tileHeight, | ||
| int | numLayers = 1 |
||
| ) |
Definition at line 350 of file CollisionMap.cpp.
References GetComponentTypeID_Static(), Ground, m_activeLayer, m_height, m_numLayers, m_projection, m_tileHeight, m_tileWidth, m_width, and SYSTEM_LOG.
Here is the call graph for this function:Definition at line 389 of file CollisionMap.cpp.
References IsNavigable(), and m_activeLayer.
Referenced by FindPath(), GetRandomNavigablePoint(), and IsNavigable().
Here is the call graph for this function:
Here is the caller graph for this function:| bool NavigationMap::IsNavigable | ( | int | x, |
| int | y, | ||
| CollisionLayer | layer | ||
| ) | const |
Definition at line 399 of file CollisionMap.cpp.
References CollisionMap::Get(), GetComponentTypeID_Static(), and TileProperties::isNavigable.
Here is the call graph for this function:Definition at line 431 of file CollisionMap.cpp.
References GetComponentTypeID_Static(), and m_height.
Referenced by FindPath(), and GetRandomNavigablePoint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
delete |
| void NavigationMap::SetActiveLayer | ( | CollisionLayer | layer | ) |
Definition at line 369 of file CollisionMap.cpp.
References m_activeLayer, and m_numLayers.
Definition at line 377 of file CollisionMap.cpp.
References CollisionMap::Get(), GetComponentTypeID_Static(), TileProperties::isNavigable, and m_activeLayer.
Here is the call graph for this function:| void NavigationMap::WorldToGrid | ( | float | worldX, |
| float | worldY, | ||
| int & | outGridX, | ||
| int & | outGridY | ||
| ) | const |
Definition at line 421 of file CollisionMap.cpp.
References CollisionMap::Get(), GetComponentTypeID_Static(), and CollisionMap::WorldToGrid().
Referenced by GetRandomNavigablePoint().
Here is the call graph for this function:
Here is the caller graph for this function:| CollisionLayer NavigationMap::m_activeLayer = CollisionLayer::Ground |
Definition at line 266 of file CollisionMap.h.
Referenced by Clear(), GetActiveLayer(), GetTraversalCost(), Initialize(), IsNavigable(), SetActiveLayer(), and SetNavigable().
| int NavigationMap::m_height = 0 |
Definition at line 262 of file CollisionMap.h.
Referenced by Clear(), GetHeight(), Initialize(), and IsValidGridPosition().
| int NavigationMap::m_numLayers = 1 |
Definition at line 267 of file CollisionMap.h.
Referenced by Clear(), Initialize(), and SetActiveLayer().
| GridProjectionType NavigationMap::m_projection = GridProjectionType::Ortho |
Definition at line 263 of file CollisionMap.h.
Referenced by GetNeighbors(), GetProjection(), Heuristic(), and Initialize().
| float NavigationMap::m_tileHeight = 32.0f |
Definition at line 265 of file CollisionMap.h.
Referenced by Initialize().
| float NavigationMap::m_tileWidth = 32.0f |
Definition at line 264 of file CollisionMap.h.
Referenced by Initialize().
| int NavigationMap::m_width = 0 |
Definition at line 261 of file CollisionMap.h.
Referenced by Clear(), FindPath(), GetWidth(), and Initialize().