Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Classes | |
struct | EntityData |
class | EntityDistanceOrdering |
Functor for sorting entities by distance from a source point. More... | |
struct | EntityParabolicRangeOutline |
struct | Query |
Representation of a range query. More... | |
Enumerations | |
enum | FlagMasks { None = 0x00 , Normal = 0x01 , Injured = 0x02 , AllQuery = Normal | Injured , InWorld = 0x08 , RetainInFog = 0x10 , RevealShore = 0x20 , ScriptedVisibility = 0x40 , SharedVision = 0x80 } |
Representation of an entity, with the data needed for queries. More... | |
Functions | |
u32 | CalcOwnerMask (player_id_t owner) |
Convert an owner ID (-1 = unowned, 0 = gaia, 1..30 = players) into a 32-bit mask for quick set-membership tests. More... | |
u32 | CalcPlayerLosMask (player_id_t player) |
Returns LOS mask for given player. More... | |
u32 | CalcSharedLosMask (std::vector< player_id_t > players) |
Returns shared LOS mask for given list of players. More... | |
bool | SetPlayerSharedDirtyVisibilityBit (u16 &mask, player_id_t player, bool enable) |
Add/remove a player to/from mask, which is a 1-bit mask representing a list of players. More... | |
LosVisibility | GetPlayerVisibility (u32 visibilities, player_id_t player) |
Computes the 2-bit visibility for one player, given the total 32-bit visibilities. More... | |
bool | IsVisibilityDirty (u16 dirty, player_id_t player) |
Test whether the visibility is dirty for a given LoS region and a given player. More... | |
bool | HasVisionSharing (u16 visionSharing, player_id_t player) |
Test whether a player share this vision. More... | |
u16 | CalcVisionSharingMask (player_id_t player) |
Computes the shared vision mask for the player. More... | |
static bool | InParabolicRange (CFixedVector3D v, fixed range) |
Checks whether v is in a parabolic range of (0,0,0) The highest point of the paraboloid is (0,range/2,0) and the circle of distance 'range' around (0,0,0) on height y=0 is part of the paraboloid This equates to computing f(x, z) = y = -(xx + zz)/(2*range) + range/2 > 0, or alternatively sqrt(xx+zz) <= sqrt(range^2 - 2range*y). More... | |
Variables | |
constexpr int | LOS_REGION_RATIO = 8 |
How many LOS vertices to have per region. More... | |
const fixed | PARABOLIC_RANGE_TOLERANCE = fixed::FromInt(1)/2 |
Tolerance for parabolic range calculations. More... | |
static std::map< entity_id_t, EntityParabolicRangeOutline > | ParabolicRangesOutlines |
enum anonymous_namespace{CCmpRangeManager.cpp}::FlagMasks |
u32 anonymous_namespace{CCmpRangeManager.cpp}::CalcOwnerMask | ( | player_id_t | owner | ) |
Convert an owner ID (-1 = unowned, 0 = gaia, 1..30 = players) into a 32-bit mask for quick set-membership tests.
u32 anonymous_namespace{CCmpRangeManager.cpp}::CalcPlayerLosMask | ( | player_id_t | player | ) |
Returns LOS mask for given player.
u32 anonymous_namespace{CCmpRangeManager.cpp}::CalcSharedLosMask | ( | std::vector< player_id_t > | players | ) |
Returns shared LOS mask for given list of players.
u16 anonymous_namespace{CCmpRangeManager.cpp}::CalcVisionSharingMask | ( | player_id_t | player | ) |
Computes the shared vision mask for the player.
LosVisibility anonymous_namespace{CCmpRangeManager.cpp}::GetPlayerVisibility | ( | u32 | visibilities, |
player_id_t | player | ||
) |
Computes the 2-bit visibility for one player, given the total 32-bit visibilities.
bool anonymous_namespace{CCmpRangeManager.cpp}::HasVisionSharing | ( | u16 | visionSharing, |
player_id_t | player | ||
) |
Test whether a player share this vision.
|
static |
Checks whether v is in a parabolic range of (0,0,0) The highest point of the paraboloid is (0,range/2,0) and the circle of distance 'range' around (0,0,0) on height y=0 is part of the paraboloid This equates to computing f(x, z) = y = -(xx + zz)/(2*range) + range/2 > 0, or alternatively sqrt(xx+zz) <= sqrt(range^2 - 2range*y).
Avoids sqrting and overflowing.
bool anonymous_namespace{CCmpRangeManager.cpp}::IsVisibilityDirty | ( | u16 | dirty, |
player_id_t | player | ||
) |
Test whether the visibility is dirty for a given LoS region and a given player.
bool anonymous_namespace{CCmpRangeManager.cpp}::SetPlayerSharedDirtyVisibilityBit | ( | u16 & | mask, |
player_id_t | player, | ||
bool | enable | ||
) |
Add/remove a player to/from mask, which is a 1-bit mask representing a list of players.
Returns true if the mask is modified.
|
constexpr |
How many LOS vertices to have per region.
LOS regions are used to keep track of units.
const fixed anonymous_namespace{CCmpRangeManager.cpp}::PARABOLIC_RANGE_TOLERANCE = fixed::FromInt(1)/2 |
Tolerance for parabolic range calculations.
TODO C++20: change this to constexpr by fixing CFixed with std::is_constant_evaluated
|
static |