载入中...
搜索中...
未找到
PlacementGeometry.cpp
浏览该文件的文档.
23 std::find(freeDefinition.blockedByEdgeChannels.begin(), freeDefinition.blockedByEdgeChannels.end(),
28 world.cellToWorldPlane(edge.x + (edge.axis == EdgeAxis::Horizontal), edge.y + (edge.axis == EdgeAxis::Vertical), bx,
60FreeFootprint definitionFreeFootprint(const BuildingDefinition &definition, const PlacementWorld &world, float x,
65 result.radius = definition.freeRadiusCells * std::min(world.getGrid().cellW, world.getGrid().cellH);
87 const FreeFootprint footprint = definitionFreeFootprint(definition, world, placed.worldX, placed.worldY, 0.f);
110 result.vertices.push_back({placed.freeFootprintVertices[i], placed.freeFootprintVertices[i + 1]});
227 const float tangentDot = hit.tangentX * hit.normalX + hit.tangentY * hit.normalY + hit.tangentZ * hit.normalZ;
242 const float fallbackDot = hit.tangentX * hit.normalX + hit.tangentY * hit.normalY + hit.tangentZ * hit.normalZ;
Stable, structured diagnostics shared by engine modules.
Pure cell/world projection helpers for GridConfig.
bool containsFreeFootprintPoint(const FreeFootprint &footprint, float x, float y)
Definition PlacementGeometry.cpp:203
bool isPointInPolygon(const FreeFootprint &polygon, float x, float y)
Definition PlacementGeometry.cpp:129
SurfaceFrameStatus normalizeSurfaceFrame(PlacementSystem::PlacementHit &hit)
Definition PlacementGeometry.cpp:216
FreeFootprint definitionFreeFootprint(const BuildingDefinition &definition, const PlacementWorld &world, float x, float y, float rotationDeg)
Definition PlacementGeometry.cpp:60
std::vector< FreeFootprint::Point > worldVertices(const FreeFootprint &footprint)
Transform footprint vertices. @cost Copies vertex count per overlap query.
Definition PlacementGeometry.cpp:119
bool hasFreeEdgeOverlap(const PlacementWorld &world, const BuildingDefinition &freeDefinition, const FreeFootprint &footprint, const BuildingDefinition &edgeDefinition, EdgeAddress edge)
Definition PlacementGeometry.cpp:20
float length3(float x, float y, float z)
Definition PlacementGeometry.cpp:57
void applyDefinitionFreeFootprint(PlacedBuilding &placed, const BuildingDefinition &definition, const PlacementWorld &world)
Definition PlacementGeometry.cpp:85
FreeFootprint placedFreeFootprint(const PlacedBuilding &placed)
Definition PlacementGeometry.cpp:101
int cardinalQuarter(float rotationDeg)
Definition PlacementGeometry.cpp:50
SurfaceFrameStatus
Definition PlacementInternal.h:39
void cross3(float ax, float ay, float az, float bx, float by, float bz, float &x, float &y, float &z)
Definition PlacementGeometry.cpp:210
bool hasFreeFootprintOverlap(const FreeFootprint &a, const FreeFootprint &b)
Definition PlacementGeometry.cpp:145
建筑放置模块入口:定义 / 放置世界 / 鬼影 / 变更事件的脚本绑定点。 设计文档:docs/dev/建筑放置系统设计.md
Definition Building.cpp:10
@ Vertical
@ Horizontal
std::vector< std::string > blockedByEdgeChannels
Edge channels that block this free-domain footprint at the same floor.
Definition BuildingTypes.h:125
float edgeThicknessCells
Solid edge thickness in cells; zero disables free/edge collision.
Definition BuildingTypes.h:123
One sampled point and orthonormal frame on a placement surface.
Definition PlacementSystem.h:41
bool isPolygon() const
Definition PlacementInternal.h:20
float halfHeight
Definition PlacementInternal.h:16
float rotationRadians
Definition PlacementInternal.h:17
std::vector< Point > vertices
Definition PlacementInternal.h:18
float halfWidth
Definition PlacementInternal.h:15