EVENGINE_API_WORLD public API. 更多...
#include <Ghost.h>
Public 成员函数 | |
| Ghost ()=default | |
| Ghost. | |
| ~Ghost ()=default | |
| Ghost. | |
| void | destroy () |
| Destroys . | |
| std::string | getBuildingId () const |
| Returns the building id. | |
| void | setBuildingId (const std::string &id) |
| Sets the building id. | |
| int | getCellX () const |
| Returns the cell x. | |
| int | getCellY () const |
| Returns the cell y. | |
| void | setCell (int cellX, int cellY) |
| Sets the cell. | |
| float | getWorldX () const |
| Returns the world x. | |
| float | getWorldY () const |
| Returns the world y. | |
| void | setWorld (float worldX, float worldY) |
| Sets the world. | |
| float | getElevation () const |
| Returns the elevation. | |
| void | setElevation (float elevation) |
| Sets the elevation. | |
| float | getRotationDeg () const |
| Returns the rotation deg. | |
| void | setRotationDeg (float deg) |
| Sets the rotation deg. | |
| void | rotateBy (float deltaDeg) |
| Rotate by. | |
| std::string | getPlacementKind () const |
Current placement domain (cell, edge, corner, or free). | |
| std::string | getEdgeAxis () const |
Canonical edge axis (horizontal/vertical), empty for cell ghosts. | |
| void | setEdge (PlacementWorld *world, int cellX, int cellY, const std::string &direction) |
| Snap this ghost to a canonicalized cell edge and its exact midpoint pose. | |
| void | setCorner (PlacementWorld *world, int vertexX, int vertexY) |
| Snap this ghost to one canonical grid vertex. | |
| void | setFree (PlacementWorld *world, float worldX, float worldY, float elevation=0.f) |
| Set an exact unsnapped world-plane anchor for a free-domain definition. | |
| bool | isValid () const |
| True when valid. | |
| std::string | getReason () const |
| Returns the reason. | |
| std::string | getSurfaceId () const |
| Surface identity captured by the last successful setFromSurface call. | |
| int64_t | getSurfaceRevision () const |
| Surface revision captured by the last successful setFromSurface call. | |
| float | getSurfaceNormalX () const |
| X component of the captured unit surface normal. | |
| float | getSurfaceNormalY () const |
| Y component of the captured unit surface normal. | |
| float | getSurfaceNormalZ () const |
| Z component of the captured unit surface normal. | |
| float | getSurfaceTangentX () const |
| X component of the captured unit surface tangent. | |
| float | getSurfaceTangentY () const |
| Y component of the captured unit surface tangent. | |
| float | getSurfaceTangentZ () const |
| Z component of the captured unit surface tangent. | |
| int | getSurfaceSampleCount () const |
| Number of occupied footprint cells sampled in the current patch. | |
| float | getSurfaceMaxSlopeDegrees () const |
| Maximum sampled slope relative to the grid-plane up axis. | |
| float | getSurfaceHeightDelta () const |
| Sampled elevation range across the complete footprint. | |
| void | setFromWorld (PlacementWorld *world, float worldX, float worldY) |
| 按世界吸附模式,从世界坐标刷新格子与世界位姿。 | |
| void | setFromWorld3D (PlacementWorld *world, float worldX, float worldY, float worldZ) |
| Sets the from world 3 d. | |
| void | setFromSurface (PlacementWorld *world, const std::string &surface, float x, float y) |
| Sets the from surface. | |
| bool | validate (PlacementWorld *world) |
| 对当前姿态做校验,写入 valid_/reason_。 | |
友元 | |
| class | PlacementSystem |
详细描述
构造及析构函数说明
◆ Ghost()
|
default |
◆ ~Ghost()
|
default |
成员函数说明
◆ destroy()
| void eve::building::Ghost::destroy | ( | ) |
◆ getBuildingId()
|
inline |
Returns the building id.
被这些函数引用 eve::building::PlacementSession::beginEdgePath(), eve::building::PlacementSession::execute(), eve::building::PlacementSession::executeEdgeLine(), eve::building::PlacementSession::getBuildingId(), eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getCellX()
|
inline |
Returns the cell x.
被这些函数引用 eve::building::PlacementSession::execute(), eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getCellY()
|
inline |
Returns the cell y.
被这些函数引用 eve::building::PlacementSession::execute(), eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getEdgeAxis()
| std::string eve::building::Ghost::getEdgeAxis | ( | ) | const |
Canonical edge axis (horizontal/vertical), empty for cell ghosts.
引用了 eve::building::EdgeAddress::axis , 以及 eve::building::Horizontal.
◆ getElevation()
|
inline |
Returns the elevation.
被这些函数引用 eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getPlacementKind()
|
inline |
Current placement domain (cell, edge, corner, or free).
被这些函数引用 eve::building::PlacementSession::execute() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getReason()
|
inline |
◆ getRotationDeg()
|
inline |
Returns the rotation deg.
被这些函数引用 eve::building::PlacementSession::getRotationDeg(), eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getSurfaceHeightDelta()
|
inline |
◆ getSurfaceId()
|
inline |
Surface identity captured by the last successful setFromSurface call.
◆ getSurfaceMaxSlopeDegrees()
|
inline |
◆ getSurfaceNormalX()
|
inline |
X component of the captured unit surface normal.
◆ getSurfaceNormalY()
|
inline |
Y component of the captured unit surface normal.
◆ getSurfaceNormalZ()
|
inline |
Z component of the captured unit surface normal.
◆ getSurfaceRevision()
|
inline |
◆ getSurfaceSampleCount()
|
inline |
◆ getSurfaceTangentX()
|
inline |
X component of the captured unit surface tangent.
◆ getSurfaceTangentY()
|
inline |
Y component of the captured unit surface tangent.
◆ getSurfaceTangentZ()
|
inline |
Z component of the captured unit surface tangent.
◆ getWorldX()
|
inline |
Returns the world x.
被这些函数引用 eve::building::PlacementSession::execute(), eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ getWorldY()
|
inline |
Returns the world y.
被这些函数引用 eve::building::PlacementSession::execute(), eve::building::PlacementSystem::placeGhost() , 以及 eve::buildingfx::BuildingFx::updateGhost().
◆ isValid()
|
inline |
◆ rotateBy()
| void eve::building::Ghost::rotateBy | ( | float | deltaDeg | ) |
Rotate by.
引用了 setRotationDeg().
◆ setBuildingId()
| void eve::building::Ghost::setBuildingId | ( | const std::string & | id | ) |
Sets the building id.
引用了 id.
◆ setCell()
◆ setCorner()
| void eve::building::Ghost::setCorner | ( | PlacementWorld * | world, |
| int | vertexX, | ||
| int | vertexY | ||
| ) |
Snap this ghost to one canonical grid vertex.
引用了 eve::building::PlacementSystem::normalizeRotation() , 以及 world.
◆ setEdge()
| void eve::building::Ghost::setEdge | ( | PlacementWorld * | world, |
| int | cellX, | ||
| int | cellY, | ||
| const std::string & | direction | ||
| ) |
Snap this ghost to a canonicalized cell edge and its exact midpoint pose.
引用了 ax, eve::building::EdgeAddress::axis, ay, bx, by, eve::building::PlacementSystem::canonicalEdge(), direction, eve::building::Horizontal, eve::building::Vertical, world, eve::building::EdgeAddress::x , 以及 eve::building::EdgeAddress::y.
◆ setElevation()
| void eve::building::Ghost::setElevation | ( | float | elevation | ) |
◆ setFree()
| void eve::building::Ghost::setFree | ( | PlacementWorld * | world, |
| float | worldX, | ||
| float | worldY, | ||
| float | elevation = 0.f |
||
| ) |
Set an exact unsnapped world-plane anchor for a free-domain definition.
引用了 elevation, eve::building::PlacementSystem::normalizeRotation(), world , 以及 eve::grid::worldToCell().
◆ setFromSurface()
| void eve::building::Ghost::setFromSurface | ( | PlacementWorld * | world, |
| const std::string & | surface, | ||
| float | x, | ||
| float | y | ||
| ) |
Sets the from surface.
通过注册的放置表面(如内置 "plane")刷新位姿。
引用了 eve::building::PlacementSystem::SurfacePatch::anchor, eve::building::BuildingRegistry::find(), eve::building::PlacementSystem::SurfacePatch::heightDelta, hit, eve::building::PlacementSystem::SurfacePatch::maxSlopeDegrees, eve::NotFound, eve::building::PlacementSystem::SurfacePatch::samples, eve::building::PlacementSystem::sampleSurfacePatch(), setFromWorld3D(), world, x , 以及 y.
被这些函数引用 eve::building::PlacementSession::updateFromSurface() , 以及 validate().
◆ setFromWorld()
| void eve::building::Ghost::setFromWorld | ( | PlacementWorld * | world, |
| float | worldX, | ||
| float | worldY | ||
| ) |
按世界吸附模式,从世界坐标刷新格子与世界位姿。
引用了 s, eve::building::PlacementSystem::snap() , 以及 world.
◆ setFromWorld3D()
| void eve::building::Ghost::setFromWorld3D | ( | PlacementWorld * | world, |
| float | worldX, | ||
| float | worldY, | ||
| float | worldZ | ||
| ) |
Sets the from world 3 d.
3D 版本:真实世界坐标 (wx, wy, wz),按世界平面轴映射后吸附。
引用了 s, eve::building::PlacementSystem::snap3D() , 以及 world.
被这些函数引用 setFromSurface() , 以及 eve::building::PlacementSession::updateFromWorld3D().
◆ setRotationDeg()
| void eve::building::Ghost::setRotationDeg | ( | float | deg | ) |
Sets the rotation deg.
被这些函数引用 rotateBy() , 以及 eve::building::PlacementSession::setRotationDeg().
◆ setWorld()
| void eve::building::Ghost::setWorld | ( | float | worldX, |
| float | worldY | ||
| ) |
◆ validate()
| bool eve::building::Ghost::validate | ( | PlacementWorld * | world | ) |
对当前姿态做校验,写入 valid_/reason_。
引用了 eve::building::EdgeAddress::axis, eve::building::PlacementSystem::canPlaceCorner(), eve::building::PlacementSystem::canPlaceEdge(), eve::building::PlacementSystem::canPlaceFree(), direction, eve::building::BuildingRegistry::find(), eve::building::Horizontal, eve::building::PlacementSystem::normalizeRotation(), setFromSurface(), world, eve::building::EdgeAddress::x, eve::building::CornerAddress::x, eve::building::EdgeAddress::y , 以及 eve::building::CornerAddress::y.
友元及相关函数文档
◆ PlacementSystem
|
friend |
该类的文档由以下文件生成: