Class PlotPlacement
Decides whether a structure fits on a plot.
public static class PlotPlacement
- Inheritance
-
PlotPlacement
- Inherited Members
Remarks
Shared so a client can grey out a placement it knows will fail, while the server reaches the same verdict from the same code. The client's answer is a courtesy and the server's is the one that counts — but they must agree, or a player is shown a valid placement that is then refused, which reads as the game ignoring them.
Methods
Intersects(Bounds, Bounds)
True when two volumes share space.
public static bool Intersects(Bounds a, Bounds b)
Parameters
aBoundsbBounds
Returns
Remarks
Touching faces are not an intersection, so pieces snapped flush against one another — a wall meeting a wall, which is how anything gets built — are not read as colliding.
IsFullyInside(Bounds, Bounds)
True when one volume lies entirely inside another.
public static bool IsFullyInside(Bounds inner, Bounds outer)
Parameters
innerBoundsouterBounds
Returns
Remarks
Bounds.Contains tests a point, not a box, so a structure whose centre sits inside
a plot would pass it while three of its corners hung over the street.
ToLocal(Vector3, Vector3)
Converts a world position into a plot-relative offset.
public static Vector3 ToLocal(Vector3 plotOrigin, Vector3 worldPosition)
Parameters
plotOriginVector3worldPositionVector3
Returns
- Vector3
ToWorld(Vector3, Vector3)
Converts a plot-relative offset into a world position.
public static Vector3 ToWorld(Vector3 plotOrigin, Vector3 localOffset)
Parameters
plotOriginVector3localOffsetVector3
Returns
- Vector3
Remarks
Structures are stored relative to their plot rather than in world space, so that moving a foundation in the editor carries the house with it instead of leaving it standing in a field. The plot's own origin is its transform.