载入中...
搜索中...
未找到
eve::map::Fov类 参考

Dynamic field-of-view / fog-of-war facade. Phase A: 2D shadowcast + multi-revealer + explored memory. Phase B: raycast/permissive, heightmap, volume, dirty-skip, CPU masks. Phase C: hex topology FOV, rectangle-based FOV, perception/stealth detection helpers, GPU mask Texture upload. 更多...

#include <Fov.h>

类

struct  Impl
 
struct  Snapshot
 Owning visibility-memory snapshot for the current grid/volume dimensions. 更多...
 

Public 成员函数

 Fov ()
 
 Fov (TileLayer *layer)
 
 Fov (int width, int height)
 
 Fov (int width, int height, int depth)
 
 ~Fov ()
 
 Fov (Fov &&) noexcept
 
Fov & operator= (Fov &&) noexcept
 
 Fov (const Fov &)=delete
 
Fov & operator= (const Fov &)=delete
 
void bindLayer (TileLayer *layer)
 
void setSize (int width, int height)
 
void setVolumeSize (int width, int height, int depth)
 
int getWidth () const
 
int getHeight () const
 
int getDepth () const
 
void setMode (const std::string &name)
 "grid2d" (default) | "heightmap" | "volume"
 
std::string getMode () const
 
void setAlgorithm (const std::string &name)
 "shadowcast" | "raycast" | "permissive" | "rectangle"
 
std::string getAlgorithm () const
 
void setRadiusMetric (const std::string &name)
 "euclidean" | "chebyshev" | "manhattan" — ignored when topology is hex (cube distance).
 
std::string getRadiusMetric () const
 
void setTopology (const std::string &name)
 "ortho" (default) | "hex" | "auto" (hex if bound layer is hex/staggered).
 
std::string getTopology () const
 
void setCornerPeek (bool enable)
 
bool getCornerPeek () const
 
void blockOpaqueGid (int gid)
 
void unblockOpaqueGid (int gid)
 
void clearOpaqueGids ()
 
void setBlockEmpty (bool enable)
 
bool getBlockEmpty () const
 
void setOpaque (int x, int y, bool opaque)
 
bool isOpaque (int x, int y) const
 
void setOpaque3 (int x, int y, int z, bool opaque)
 
bool isOpaque3 (int x, int y, int z) const
 
void syncFromLayer ()
 
void setElevation (int x, int y, float elev)
 
float getElevation (int x, int y) const
 
void setCliffBlock (float delta)
 
float getCliffBlock () const
 
void setEyeOffset (float offset)
 
float getEyeOffset () const
 
void setVerticalRange (int range)
 
int getVerticalRange () const
 
int addRevealer (int x, int y, int radius)
 
int addRevealer3 (int x, int y, int z, int radius)
 
void removeRevealer (int id)
 
void clearRevealers ()
 
void setRevealerPosition (int id, int x, int y)
 
void setRevealerPosition3 (int id, int x, int y, int z)
 
void setRevealerRadius (int id, int radius)
 
void setRevealerFacing (int id, float facingDeg, float halfAngleDeg)
 
void clearRevealerFacing (int id)
 
void setRevealerEnabled (int id, bool enabled)
 
int getRevealerCount () const
 
void setRevealerPerception (int id, float perception)
 Soft RPG hooks (no hard dependency on rpg module). effectiveRadius = radius + floor(perception * perceptionRadiusScale) canDetect: cell visible AND perception + detectionMargin >= targetStealth
 
float getRevealerPerception (int id) const
 
void setPerceptionRadiusScale (float scale)
 
float getPerceptionRadiusScale () const
 
void setDetectionMargin (float margin)
 
float getDetectionMargin () const
 
int getEffectiveRadius (int id) const
 
bool canDetect (int revealerId, int x, int y, float targetStealth) const
 
bool canDetect3 (int revealerId, int x, int y, int z, float targetStealth) const
 
void markDirty ()
 
bool isDirty () const
 
void compute ()
 
bool isVisible (int x, int y) const
 
bool isExplored (int x, int y) const
 
bool isVisible3 (int x, int y, int z) const
 
bool isExplored3 (int x, int y, int z) const
 
std::string getState (int x, int y) const
 
std::string getState3 (int x, int y, int z) const
 
void clearMemory ()
 
void resetVisibleOnly ()
 
Snapshot snapshot () const
 Capture exact unknown/explored/visible cell states without revealers.
 
Result< void > restore (const Snapshot &snapshot)
 Restore exact cell states atomically.
 
float getMaskValue (int x, int y) const
 
int getMaskByte (int x, int y) const
 
float getMaskValue3 (int x, int y, int z) const
 
int getMaskByte3 (int x, int y, int z) const
 
bool fillMaskR8 (std::vector< uint8_t > &out) const
 
bool fillMaskR8Slice (std::vector< uint8_t > &out, int sliceZ) const
 
graphics::Texture * buildMaskTexture (graphics::Graphics *gfx) const
 Upload current 2D / slice mask as RGBA8 Texture (R=G=B=A=mask byte). Caller owns the returned Texture*. Null gfx / empty grid → nullptr.
 
graphics::Texture * buildMaskTextureSlice (graphics::Graphics *gfx, int sliceZ) const
 

详细描述

Dynamic field-of-view / fog-of-war facade. Phase A: 2D shadowcast + multi-revealer + explored memory. Phase B: raycast/permissive, heightmap, volume, dirty-skip, CPU masks. Phase C: hex topology FOV, rectangle-based FOV, perception/stealth detection helpers, GPU mask Texture upload.

在文件 Fov.h 第 27 行定义.

构造及析构函数说明

◆ Fov() [1/6]

eve::map::Fov::Fov ( )

在文件 Fov.cpp 第 912 行定义.

◆ Fov() [2/6]

eve::map::Fov::Fov ( TileLayer *  layer)
explicit

在文件 Fov.cpp 第 913 行定义.

引用了 bindLayer() , 以及 layer.

◆ Fov() [3/6]

eve::map::Fov::Fov ( int  width,
int  height 
)
explicit

在文件 Fov.cpp 第 914 行定义.

引用了 height, setSize() , 以及 width.

◆ Fov() [4/6]

eve::map::Fov::Fov ( int  width,
int  height,
int  depth 
)

在文件 Fov.cpp 第 915 行定义.

引用了 depth, height, setVolumeSize() , 以及 width.

◆ ~Fov()

eve::map::Fov::~Fov ( )
default

◆ Fov() [5/6]

eve::map::Fov::Fov ( Fov &&  )
defaultnoexcept

◆ Fov() [6/6]

eve::map::Fov::Fov ( const Fov &  )
delete

成员函数说明

◆ addRevealer()

int eve::map::Fov::addRevealer ( int  x,
int  y,
int  radius 
)

在文件 Fov.cpp 第 1069 行定义.

引用了 addRevealer3(), radius, x , 以及 y.

◆ addRevealer3()

int eve::map::Fov::addRevealer3 ( int  x,
int  y,
int  z,
int  radius 
)

在文件 Fov.cpp 第 1071 行定义.

引用了 eve::map::Fov::Impl::Revealer::id, r, radius, x, y , 以及 z.

被这些函数引用 addRevealer().

◆ bindLayer()

void eve::map::Fov::bindLayer ( TileLayer *  layer)

在文件 Fov.cpp 第 920 行定义.

引用了 bindLayer() , 以及 layer.

被这些函数引用 bindLayer() , 以及 Fov().

◆ blockOpaqueGid()

void eve::map::Fov::blockOpaqueGid ( int  gid)

在文件 Fov.cpp 第 989 行定义.

◆ buildMaskTexture()

graphics::Texture * eve::map::Fov::buildMaskTexture ( graphics::Graphics *  gfx) const

Upload current 2D / slice mask as RGBA8 Texture (R=G=B=A=mask byte). Caller owns the returned Texture*. Null gfx / empty grid → nullptr.

在文件 Fov.cpp 第 1315 行定义.

引用了 buildMaskTextureSlice().

◆ buildMaskTextureSlice()

graphics::Texture * eve::map::Fov::buildMaskTextureSlice ( graphics::Graphics *  gfx,
int  sliceZ 
) const

在文件 Fov.cpp 第 1319 行定义.

引用了 fillMaskR8Slice(), eve::graphics::Graphics::newTexture() , 以及 v.

被这些函数引用 buildMaskTexture().

◆ canDetect()

bool eve::map::Fov::canDetect ( int  revealerId,
int  x,
int  y,
float  targetStealth 
) const

在文件 Fov.cpp 第 1167 行定义.

引用了 canDetect3(), isVisible(), r, x , 以及 y.

◆ canDetect3()

bool eve::map::Fov::canDetect3 ( int  revealerId,
int  x,
int  y,
int  z,
float  targetStealth 
) const

在文件 Fov.cpp 第 1175 行定义.

引用了 isVisible3(), r, x, y , 以及 z.

被这些函数引用 canDetect().

◆ clearMemory()

void eve::map::Fov::clearMemory ( )

在文件 Fov.cpp 第 1235 行定义.

◆ clearOpaqueGids()

void eve::map::Fov::clearOpaqueGids ( )

在文件 Fov.cpp 第 1003 行定义.

◆ clearRevealerFacing()

void eve::map::Fov::clearRevealerFacing ( int  id)

在文件 Fov.cpp 第 1124 行定义.

引用了 r.

◆ clearRevealers()

void eve::map::Fov::clearRevealers ( )

在文件 Fov.cpp 第 1090 行定义.

◆ compute()

void eve::map::Fov::compute ( )

在文件 Fov.cpp 第 1184 行定义.

◆ fillMaskR8()

bool eve::map::Fov::fillMaskR8 ( std::vector< uint8_t > &  out) const

在文件 Fov.cpp 第 1291 行定义.

引用了 fillMaskR8Slice().

◆ fillMaskR8Slice()

bool eve::map::Fov::fillMaskR8Slice ( std::vector< uint8_t > &  out,
int  sliceZ 
) const

在文件 Fov.cpp 第 1293 行定义.

引用了 s, x , 以及 y.

被这些函数引用 buildMaskTextureSlice() , 以及 fillMaskR8().

◆ getAlgorithm()

std::string eve::map::Fov::getAlgorithm ( ) const

在文件 Fov.cpp 第 957 行定义.

◆ getBlockEmpty()

bool eve::map::Fov::getBlockEmpty ( ) const

在文件 Fov.cpp 第 1015 行定义.

◆ getCliffBlock()

float eve::map::Fov::getCliffBlock ( ) const

在文件 Fov.cpp 第 1055 行定义.

◆ getCornerPeek()

bool eve::map::Fov::getCornerPeek ( ) const

在文件 Fov.cpp 第 987 行定义.

◆ getDepth()

int eve::map::Fov::getDepth ( ) const

在文件 Fov.cpp 第 939 行定义.

◆ getDetectionMargin()

float eve::map::Fov::getDetectionMargin ( ) const

在文件 Fov.cpp 第 1160 行定义.

◆ getEffectiveRadius()

int eve::map::Fov::getEffectiveRadius ( int  id) const

在文件 Fov.cpp 第 1162 行定义.

引用了 r.

◆ getElevation()

float eve::map::Fov::getElevation ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1049 行定义.

引用了 x , 以及 y.

◆ getEyeOffset()

float eve::map::Fov::getEyeOffset ( ) const

在文件 Fov.cpp 第 1061 行定义.

◆ getHeight()

int eve::map::Fov::getHeight ( ) const

在文件 Fov.cpp 第 938 行定义.

◆ getMaskByte()

int eve::map::Fov::getMaskByte ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1275 行定义.

引用了 getMaskByte3(), x , 以及 y.

◆ getMaskByte3()

int eve::map::Fov::getMaskByte3 ( int  x,
int  y,
int  z 
) const

在文件 Fov.cpp 第 1286 行定义.

引用了 x, y , 以及 z.

被这些函数引用 getMaskByte().

◆ getMaskValue()

float eve::map::Fov::getMaskValue ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1269 行定义.

引用了 getMaskValue3(), x , 以及 y.

◆ getMaskValue3()

float eve::map::Fov::getMaskValue3 ( int  x,
int  y,
int  z 
) const

在文件 Fov.cpp 第 1281 行定义.

引用了 x, y , 以及 z.

被这些函数引用 getMaskValue().

◆ getMode()

std::string eve::map::Fov::getMode ( ) const

在文件 Fov.cpp 第 950 行定义.

◆ getPerceptionRadiusScale()

float eve::map::Fov::getPerceptionRadiusScale ( ) const

在文件 Fov.cpp 第 1157 行定义.

◆ getRadiusMetric()

std::string eve::map::Fov::getRadiusMetric ( ) const

在文件 Fov.cpp 第 964 行定义.

◆ getRevealerCount()

int eve::map::Fov::getRevealerCount ( ) const

在文件 Fov.cpp 第 1139 行定义.

◆ getRevealerPerception()

float eve::map::Fov::getRevealerPerception ( int  id) const

在文件 Fov.cpp 第 1148 行定义.

引用了 r.

◆ getState()

std::string eve::map::Fov::getState ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1210 行定义.

引用了 getState3(), x , 以及 y.

◆ getState3()

std::string eve::map::Fov::getState3 ( int  x,
int  y,
int  z 
) const

在文件 Fov.cpp 第 1223 行定义.

引用了 x, y , 以及 z.

被这些函数引用 getState().

◆ getTopology()

std::string eve::map::Fov::getTopology ( ) const

在文件 Fov.cpp 第 981 行定义.

◆ getVerticalRange()

int eve::map::Fov::getVerticalRange ( ) const

在文件 Fov.cpp 第 1067 行定义.

◆ getWidth()

int eve::map::Fov::getWidth ( ) const

在文件 Fov.cpp 第 937 行定义.

◆ isDirty()

bool eve::map::Fov::isDirty ( ) const

在文件 Fov.cpp 第 1183 行定义.

◆ isExplored()

bool eve::map::Fov::isExplored ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1192 行定义.

引用了 isExplored3(), s, x , 以及 y.

◆ isExplored3()

bool eve::map::Fov::isExplored3 ( int  x,
int  y,
int  z 
) const

在文件 Fov.cpp 第 1204 行定义.

引用了 s, x, y , 以及 z.

被这些函数引用 isExplored().

◆ isOpaque()

bool eve::map::Fov::isOpaque ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1028 行定义.

引用了 x , 以及 y.

被这些函数引用 eve::map::Fov::Impl::syncFromLayer().

◆ isOpaque3()

bool eve::map::Fov::isOpaque3 ( int  x,
int  y,
int  z 
) const

在文件 Fov.cpp 第 1039 行定义.

引用了 x, y , 以及 z.

◆ isVisible()

bool eve::map::Fov::isVisible ( int  x,
int  y 
) const

在文件 Fov.cpp 第 1186 行定义.

引用了 isVisible3(), x , 以及 y.

被这些函数引用 canDetect().

◆ isVisible3()

bool eve::map::Fov::isVisible3 ( int  x,
int  y,
int  z 
) const

在文件 Fov.cpp 第 1199 行定义.

引用了 x, y , 以及 z.

被这些函数引用 canDetect3() , 以及 isVisible().

◆ markDirty()

void eve::map::Fov::markDirty ( )

在文件 Fov.cpp 第 1182 行定义.

◆ operator=() [1/2]

Fov & eve::map::Fov::operator= ( const Fov &  )
delete

◆ operator=() [2/2]

Fov & eve::map::Fov::operator= ( Fov &&  )
defaultnoexcept

◆ removeRevealer()

void eve::map::Fov::removeRevealer ( int  id)

在文件 Fov.cpp 第 1083 行定义.

引用了 r , 以及 v.

◆ resetVisibleOnly()

void eve::map::Fov::resetVisibleOnly ( )

在文件 Fov.cpp 第 1237 行定义.

◆ restore()

Result< void > eve::map::Fov::restore ( const Snapshot &  snapshot)

◆ setAlgorithm()

void eve::map::Fov::setAlgorithm ( const std::string &  name)

"shadowcast" | "raycast" | "permissive" | "rectangle"

在文件 Fov.cpp 第 952 行定义.

引用了 name.

◆ setBlockEmpty()

void eve::map::Fov::setBlockEmpty ( bool  enable)

在文件 Fov.cpp 第 1009 行定义.

◆ setCliffBlock()

void eve::map::Fov::setCliffBlock ( float  delta)

在文件 Fov.cpp 第 1051 行定义.

◆ setCornerPeek()

void eve::map::Fov::setCornerPeek ( bool  enable)

在文件 Fov.cpp 第 983 行定义.

◆ setDetectionMargin()

void eve::map::Fov::setDetectionMargin ( float  margin)

在文件 Fov.cpp 第 1159 行定义.

引用了 margin.

◆ setElevation()

void eve::map::Fov::setElevation ( int  x,
int  y,
float  elev 
)

在文件 Fov.cpp 第 1043 行定义.

引用了 x , 以及 y.

◆ setEyeOffset()

void eve::map::Fov::setEyeOffset ( float  offset)

在文件 Fov.cpp 第 1057 行定义.

引用了 offset.

◆ setMode()

void eve::map::Fov::setMode ( const std::string &  name)

"grid2d" (default) | "heightmap" | "volume"

在文件 Fov.cpp 第 941 行定义.

引用了 name.

◆ setOpaque()

void eve::map::Fov::setOpaque ( int  x,
int  y,
bool  opaque 
)

在文件 Fov.cpp 第 1017 行定义.

引用了 u, x , 以及 y.

◆ setOpaque3()

void eve::map::Fov::setOpaque3 ( int  x,
int  y,
int  z,
bool  opaque 
)

在文件 Fov.cpp 第 1033 行定义.

引用了 u, x, y , 以及 z.

◆ setPerceptionRadiusScale()

void eve::map::Fov::setPerceptionRadiusScale ( float  scale)

在文件 Fov.cpp 第 1153 行定义.

引用了 scale.

◆ setRadiusMetric()

void eve::map::Fov::setRadiusMetric ( const std::string &  name)

"euclidean" | "chebyshev" | "manhattan" — ignored when topology is hex (cube distance).

在文件 Fov.cpp 第 959 行定义.

引用了 name.

◆ setRevealerEnabled()

void eve::map::Fov::setRevealerEnabled ( int  id,
bool  enabled 
)

在文件 Fov.cpp 第 1132 行定义.

引用了 enabled , 以及 r.

◆ setRevealerFacing()

void eve::map::Fov::setRevealerFacing ( int  id,
float  facingDeg,
float  halfAngleDeg 
)

在文件 Fov.cpp 第 1115 行定义.

引用了 r.

◆ setRevealerPerception()

void eve::map::Fov::setRevealerPerception ( int  id,
float  perception 
)

Soft RPG hooks (no hard dependency on rpg module). effectiveRadius = radius + floor(perception * perceptionRadiusScale) canDetect: cell visible AND perception + detectionMargin >= targetStealth

在文件 Fov.cpp 第 1141 行定义.

引用了 r.

◆ setRevealerPosition()

void eve::map::Fov::setRevealerPosition ( int  id,
int  x,
int  y 
)

在文件 Fov.cpp 第 1095 行定义.

引用了 r, setRevealerPosition3(), x , 以及 y.

◆ setRevealerPosition3()

void eve::map::Fov::setRevealerPosition3 ( int  id,
int  x,
int  y,
int  z 
)

在文件 Fov.cpp 第 1099 行定义.

引用了 r, x, y , 以及 z.

被这些函数引用 setRevealerPosition().

◆ setRevealerRadius()

void eve::map::Fov::setRevealerRadius ( int  id,
int  radius 
)

在文件 Fov.cpp 第 1108 行定义.

引用了 r , 以及 radius.

◆ setSize()

void eve::map::Fov::setSize ( int  width,
int  height 
)

在文件 Fov.cpp 第 925 行定义.

引用了 height , 以及 width.

被这些函数引用 Fov().

◆ setTopology()

void eve::map::Fov::setTopology ( const std::string &  name)

"ortho" (default) | "hex" | "auto" (hex if bound layer is hex/staggered).

在文件 Fov.cpp 第 966 行定义.

引用了 name.

◆ setVerticalRange()

void eve::map::Fov::setVerticalRange ( int  range)

在文件 Fov.cpp 第 1063 行定义.

引用了 range.

◆ setVolumeSize()

void eve::map::Fov::setVolumeSize ( int  width,
int  height,
int  depth 
)

在文件 Fov.cpp 第 931 行定义.

引用了 depth, height , 以及 width.

被这些函数引用 Fov().

◆ snapshot()

Fov::Snapshot eve::map::Fov::snapshot ( ) const

Capture exact unknown/explored/visible cell states without revealers.

在文件 Fov.cpp 第 1242 行定义.

引用了 eve::map::Fov::Snapshot::depth, eve::map::Fov::Snapshot::height, state, eve::map::Fov::Snapshot::states , 以及 eve::map::Fov::Snapshot::width.

◆ syncFromLayer()

void eve::map::Fov::syncFromLayer ( )

在文件 Fov.cpp 第 1041 行定义.

◆ unblockOpaqueGid()

void eve::map::Fov::unblockOpaqueGid ( int  gid)

在文件 Fov.cpp 第 996 行定义.


该类的文档由以下文件生成: