载入中...
搜索中...
未找到
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
 

Public 成员函数

 Fov ()
 
 Fov (TileLayer *layer)
 
 Fov (int width, int height)
 
 Fov (int width, int height, int depth)
 
 ~Fov ()
 
 Fov (Fov &&) noexcept
 
Fovoperator= (Fov &&) noexcept
 
 Fov (const Fov &)=delete
 
Fovoperator= (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 ()
 
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::TexturebuildMaskTexture (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::TexturebuildMaskTextureSlice (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.h24 行定义.

构造及析构函数说明

◆ Fov() [1/6]

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

在文件 Fov.cpp904 行定义.

◆ Fov() [2/6]

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

在文件 Fov.cpp905 行定义.

引用了 bindLayer() , 以及 layer.

◆ Fov() [3/6]

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

在文件 Fov.cpp906 行定义.

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

◆ Fov() [4/6]

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

在文件 Fov.cpp907 行定义.

引用了 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.cpp1061 行定义.

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

◆ addRevealer3()

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

◆ bindLayer()

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

在文件 Fov.cpp912 行定义.

引用了 bindLayer() , 以及 layer.

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

◆ blockOpaqueGid()

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

在文件 Fov.cpp981 行定义.

◆ 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.cpp1280 行定义.

引用了 buildMaskTextureSlice().

◆ buildMaskTextureSlice()

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

在文件 Fov.cpp1284 行定义.

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

被这些函数引用 buildMaskTexture().

◆ canDetect()

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

在文件 Fov.cpp1159 行定义.

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

◆ canDetect3()

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

在文件 Fov.cpp1167 行定义.

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

被这些函数引用 canDetect().

◆ clearMemory()

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

在文件 Fov.cpp1227 行定义.

◆ clearOpaqueGids()

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

在文件 Fov.cpp995 行定义.

◆ clearRevealerFacing()

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

在文件 Fov.cpp1116 行定义.

◆ clearRevealers()

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

在文件 Fov.cpp1082 行定义.

◆ compute()

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

在文件 Fov.cpp1176 行定义.

◆ fillMaskR8()

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

在文件 Fov.cpp1256 行定义.

引用了 fillMaskR8Slice().

◆ fillMaskR8Slice()

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

在文件 Fov.cpp1258 行定义.

引用了 s, x , 以及 y.

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

◆ getAlgorithm()

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

在文件 Fov.cpp949 行定义.

◆ getBlockEmpty()

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

在文件 Fov.cpp1007 行定义.

◆ getCliffBlock()

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

在文件 Fov.cpp1047 行定义.

◆ getCornerPeek()

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

在文件 Fov.cpp979 行定义.

◆ getDepth()

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

在文件 Fov.cpp931 行定义.

◆ getDetectionMargin()

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

在文件 Fov.cpp1152 行定义.

◆ getEffectiveRadius()

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

在文件 Fov.cpp1154 行定义.

◆ getElevation()

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

在文件 Fov.cpp1041 行定义.

引用了 x , 以及 y.

◆ getEyeOffset()

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

在文件 Fov.cpp1053 行定义.

◆ getHeight()

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

在文件 Fov.cpp930 行定义.

◆ getMaskByte()

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

在文件 Fov.cpp1240 行定义.

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

◆ getMaskByte3()

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

在文件 Fov.cpp1251 行定义.

引用了 x, y , 以及 z.

被这些函数引用 getMaskByte().

◆ getMaskValue()

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

在文件 Fov.cpp1234 行定义.

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

◆ getMaskValue3()

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

在文件 Fov.cpp1246 行定义.

引用了 x, y , 以及 z.

被这些函数引用 getMaskValue().

◆ getMode()

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

在文件 Fov.cpp942 行定义.

◆ getPerceptionRadiusScale()

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

在文件 Fov.cpp1149 行定义.

◆ getRadiusMetric()

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

在文件 Fov.cpp956 行定义.

◆ getRevealerCount()

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

在文件 Fov.cpp1131 行定义.

◆ getRevealerPerception()

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

在文件 Fov.cpp1140 行定义.

◆ getState()

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

在文件 Fov.cpp1202 行定义.

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

◆ getState3()

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

在文件 Fov.cpp1215 行定义.

引用了 x, y , 以及 z.

被这些函数引用 getState().

◆ getTopology()

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

在文件 Fov.cpp973 行定义.

◆ getVerticalRange()

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

在文件 Fov.cpp1059 行定义.

◆ getWidth()

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

在文件 Fov.cpp929 行定义.

◆ isDirty()

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

在文件 Fov.cpp1175 行定义.

◆ isExplored()

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

在文件 Fov.cpp1184 行定义.

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

◆ isExplored3()

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

在文件 Fov.cpp1196 行定义.

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

被这些函数引用 isExplored().

◆ isOpaque()

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

在文件 Fov.cpp1020 行定义.

引用了 x , 以及 y.

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

◆ isOpaque3()

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

在文件 Fov.cpp1031 行定义.

引用了 x, y , 以及 z.

◆ isVisible()

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

在文件 Fov.cpp1178 行定义.

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

被这些函数引用 canDetect().

◆ isVisible3()

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

在文件 Fov.cpp1191 行定义.

引用了 x, y , 以及 z.

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

◆ markDirty()

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

在文件 Fov.cpp1174 行定义.

◆ 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.cpp1075 行定义.

引用了 v.

◆ resetVisibleOnly()

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

在文件 Fov.cpp1229 行定义.

◆ setAlgorithm()

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

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

在文件 Fov.cpp944 行定义.

引用了 name.

◆ setBlockEmpty()

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

在文件 Fov.cpp1001 行定义.

◆ setCliffBlock()

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

在文件 Fov.cpp1043 行定义.

◆ setCornerPeek()

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

在文件 Fov.cpp975 行定义.

◆ setDetectionMargin()

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

在文件 Fov.cpp1151 行定义.

引用了 margin.

◆ setElevation()

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

在文件 Fov.cpp1035 行定义.

引用了 x , 以及 y.

◆ setEyeOffset()

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

在文件 Fov.cpp1049 行定义.

◆ setMode()

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

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

在文件 Fov.cpp933 行定义.

引用了 name.

◆ setOpaque()

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

在文件 Fov.cpp1009 行定义.

引用了 u, x , 以及 y.

◆ setOpaque3()

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

在文件 Fov.cpp1025 行定义.

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

◆ setPerceptionRadiusScale()

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

在文件 Fov.cpp1145 行定义.

引用了 scale.

◆ setRadiusMetric()

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

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

在文件 Fov.cpp951 行定义.

引用了 name.

◆ setRevealerEnabled()

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

在文件 Fov.cpp1124 行定义.

引用了 enabled.

◆ setRevealerFacing()

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

在文件 Fov.cpp1107 行定义.

◆ 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.cpp1133 行定义.

◆ setRevealerPosition()

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

在文件 Fov.cpp1087 行定义.

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

◆ setRevealerPosition3()

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

在文件 Fov.cpp1091 行定义.

引用了 x, y , 以及 z.

被这些函数引用 setRevealerPosition().

◆ setRevealerRadius()

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

在文件 Fov.cpp1100 行定义.

◆ setSize()

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

在文件 Fov.cpp917 行定义.

引用了 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.cpp958 行定义.

引用了 name.

◆ setVerticalRange()

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

在文件 Fov.cpp1055 行定义.

◆ setVolumeSize()

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

在文件 Fov.cpp923 行定义.

引用了 depth, height , 以及 width.

被这些函数引用 Fov().

◆ syncFromLayer()

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

在文件 Fov.cpp1033 行定义.

◆ unblockOpaqueGid()

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

在文件 Fov.cpp988 行定义.


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