Skip to content

Commit

Permalink
Exclude wall strips around windows and doors from attachment surface
Browse files Browse the repository at this point in the history
  • Loading branch information
tordanik committed Aug 30, 2023
1 parent b37f686 commit c7bfd90
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,26 @@ public void renderTo(Target target, VectorXZ textureOrigin,

/* draw insets around the elements */

for (WallElement e : elements) {
if (e.insetDistance() > 0) {
if (renderElements) {
for (WallElement e : elements) {
if (e.insetDistance() > 0) {

PolygonXYZ frontOutline = convertTo3D(e.outline());
PolygonXYZ backOutline = frontOutline.add(normalAt(e.outline().getCentroid()).mult(-e.insetDistance()));
PolygonXYZ frontOutline = convertTo3D(e.outline());
PolygonXYZ backOutline = frontOutline.add(normalAt(e.outline().getCentroid()).mult(-e.insetDistance()));

List<VectorXYZ> vsWall = createTriangleStripBetween(
backOutline.vertices(), frontOutline.vertices());
List<VectorXYZ> vsWall = createTriangleStripBetween(
backOutline.vertices(), frontOutline.vertices());

Material material = this.material;
// TODO attempt to simulate ambient occlusion with a different baked ao texture?
Material material = this.material;
// TODO attempt to simulate ambient occlusion with a different baked ao texture?

target.drawTriangleStrip(material, vsWall,
texCoordLists(vsWall, material, NamedTexCoordFunction.STRIP_WALL));
target.drawTriangleStrip(material, vsWall,
texCoordLists(vsWall, material, NamedTexCoordFunction.STRIP_WALL));

}
}
}

/* decompose and triangulate the empty wall surface */

List<SimplePolygonXZ> holes = elements.stream().map(WallElement::outline).collect(toList());
Expand Down

0 comments on commit c7bfd90

Please sign in to comment.