Differential D2004 Diff 8673 ps/trunk/binaries/data/mods/public/maps/random/rmgen/placer/noncentered/EntitiesObstructionPlacer.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/rmgen/placer/noncentered/EntitiesObstructionPlacer.js
Show All 18 Lines | for (let entity of this.entities) | ||||
let obstructionCorners = [ | let obstructionCorners = [ | ||||
new Vector2D(-halfObstructionSize.x, -halfObstructionSize.y), | new Vector2D(-halfObstructionSize.x, -halfObstructionSize.y), | ||||
new Vector2D(-halfObstructionSize.x, +halfObstructionSize.y), | new Vector2D(-halfObstructionSize.x, +halfObstructionSize.y), | ||||
new Vector2D(+halfObstructionSize.x, -halfObstructionSize.y), | new Vector2D(+halfObstructionSize.x, -halfObstructionSize.y), | ||||
new Vector2D(+halfObstructionSize.x, +halfObstructionSize.y) | new Vector2D(+halfObstructionSize.x, +halfObstructionSize.y) | ||||
].map(corner => Vector2D.add(entity.GetPosition2D(), corner.rotate(-entity.rotation.y))); | ].map(corner => Vector2D.add(entity.GetPosition2D(), corner.rotate(-entity.rotation.y))); | ||||
points = points.concat(new ConvexPolygonPlacer(obstructionCorners, this.failFraction).place(constraint)) | points = points.concat(new ConvexPolygonPlacer(obstructionCorners, this.failFraction).place(constraint)); | ||||
} | } | ||||
return points; | return points; | ||||
}; | }; |
Wildfire Games · Phabricator