handle modules larger than 1x1, widen door size to allow walking around it
This commit is contained in:
@@ -9,14 +9,17 @@ namespace EscapeRoomEngine.Engine.Runtime.Requirements
|
||||
{
|
||||
protected override List<Placement> FilterCandidates(List<Placement> candidates, Module module, Space space)
|
||||
{
|
||||
float width = space.rrPlacement.size.x - 1;
|
||||
float length = space.rrPlacement.size.y - 1;
|
||||
float width = space.rrPlacement.size.x;
|
||||
float length = space.rrPlacement.size.y;
|
||||
|
||||
candidates.RemoveAll(candidate =>
|
||||
{
|
||||
var xRel = candidate.position.x / width;
|
||||
var zRel = candidate.position.z / length;
|
||||
|
||||
var bottomLeft = candidate.BottomLeft;
|
||||
var center = new Vector2(bottomLeft.x, bottomLeft.z) +
|
||||
new Vector2(candidate.size.x / 2f, candidate.size.y / 2f);
|
||||
var xRel = center.x / width;
|
||||
var zRel = center.y / length;
|
||||
|
||||
return candidate.orientation !=
|
||||
(zRel > xRel
|
||||
? zRel > 1 - xRel
|
||||
|
||||
Reference in New Issue
Block a user