载入中...
搜索中...
未找到
Ghost.cpp
浏览该文件的文档.
225void Ghost::setFromSurface(PlacementWorld *world, const std::string &surface, float x, float y) {
Pure cell/world projection helpers for GridConfig.
void setFree(PlacementWorld *world, float worldX, float worldY, float elevation=0.f)
Set an exact unsnapped world-plane anchor for a free-domain definition.
Definition Ghost.cpp:207
void setFromWorld(PlacementWorld *world, float worldX, float worldY)
按世界吸附模式,从世界坐标刷新格子与世界位姿。
Definition Ghost.cpp:105
void setFromWorld3D(PlacementWorld *world, float worldX, float worldY, float worldZ)
Sets the from world 3 d.
Definition Ghost.cpp:131
void setCorner(PlacementWorld *world, int vertexX, int vertexY)
Snap this ghost to one canonical grid vertex.
Definition Ghost.cpp:190
std::string getEdgeAxis() const
Canonical edge axis (horizontal/vertical), empty for cell ghosts.
Definition Ghost.cpp:157
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.
Definition Ghost.cpp:162
void setFromSurface(PlacementWorld *world, const std::string &surface, float x, float y)
Sets the from surface.
Definition Ghost.cpp:225
static SnapResult snap(const PlacementWorld &world, const std::string &buildingId, float worldX, float worldY)
Definition PlacementSystem.cpp:677
static SnapResult snap3D(const PlacementWorld &world, const std::string &buildingId, float worldX, float worldY, float worldZ)
Definition PlacementSystem.cpp:687
static bool canPlaceFree(PlacementWorld *world, const std::string &buildingId, float worldX, float worldY, int excludeInstanceId=0, std::string *reason=nullptr, int level=std::numeric_limits< int >::min(), float rotationDeg=0.f)
Validate an exact free-domain world-plane anchor and circular or oriented-box footprint.
Definition PlacementSystem.cpp:1286
static float normalizeRotation(const std::string &buildingId, float rotationDeg)
规范化旋转角(cardinal → 0/90/180/270;none → 0)。
Definition PlacementSystem.cpp:702
static bool canPlaceCorner(PlacementWorld *world, const std::string &buildingId, int vertexX, int vertexY, int excludeInstanceId=0, std::string *reason=nullptr, int level=std::numeric_limits< int >::min())
Validate a corner-domain placement at one canonical grid vertex.
Definition PlacementSystem.cpp:1187
static eve::Result< SurfacePatch > sampleSurfacePatch(const PlacementWorld &world, const std::string &buildingId, const std::string &surfaceName, float x, float y, float rotationDegrees=0.f)
Sample the occupied cells of a rotated footprint relative to an exact anchor hit.
Definition PlacementSystem.cpp:431
static eve::Result< EdgeAddress > canonicalEdge(int cellX, int cellY, const std::string &direction)
Normalize a cell-relative cardinal direction to a unique edge address.
Definition PlacementSystem.cpp:1061
static bool canPlaceEdge(PlacementWorld *world, const std::string &buildingId, int cellX, int cellY, const std::string &direction, int excludeInstanceId=0, std::string *reason=nullptr, int level=std::numeric_limits< int >::min())
Validate an edge-domain placement without mutating the world.
Definition PlacementSystem.cpp:1084
建筑放置模块入口:定义 / 放置世界 / 鬼影 / 变更事件的脚本绑定点。 设计文档:docs/dev/建筑放置系统设计.md
Definition Building.cpp:7
@ Vertical
@ Horizontal
void worldToCell(const GridConfig &cfg, float px, float py, int &cx, int &cy, int mapW, int mapH)
Maps planar coordinates to the nearest cell. Staggered/hex layouts use a bounded nearest-neighbor sea...
Definition GridProjection.cpp:69
@ NotFound
Canonical address of one logical grid vertex used by corner objects.
Definition BuildingTypes.h:39
One sampled point and orthonormal frame on a placement surface.
Definition PlacementSystem.h:41
Surface samples and continuity metrics for one rotated building footprint.
Definition PlacementSystem.h:66
float maxSlopeDegrees
Definition PlacementSystem.h:69
PlacementHit anchor
Definition PlacementSystem.h:67
float heightDelta
Definition PlacementSystem.h:70
std::vector< SurfacePatchSample > samples
Definition PlacementSystem.h:68