BuildingOptions

Description

sealed class Tinman.Engine.Models.BuildingOptions

Set of options for ShapeExtruderTexture.Building.

The building side texture is assumed to be a seamlessly tiled image of a building front, usually having a repetitive pattern of one or more windows / stories, for example:

#|^^^^^^^^^^^^|##|^^^^^^^^^^^^|##|^^^^^^^^^^^^|#  \
#|            |##|            |##|            |#  |
#|   .----.   |##|   .----.   |##|   .----.   |#  |
#|   |    |   |##|   |    |   |##|   |    |   |#  | Vertical
#|   | #1 |   |##|   | #2 |   |##|   | #3 |   |#  | Repetition
#|   |____|   |##|   |____|   |##|   |____|   |#  |
#|            |##|            |##|            |#  |
#|____________|##|____________|##|____________|#  /
#|^^^^^^^^^^^^|##|^^^^^^^^^^^^|##|^^^^^^^^^^^^|#
#|            |##|            |##|            |#
#|   .----.   |##|   .----.   |##|   .----.   |#
#|   |    |   |##|   |    |   |##|   |    |   |#
#|   | #4 |   |##|   | #5 |   |##|   | #6 |   |#
#|   |____|   |##|   |____|   |##|   |____|   |#
#|            |##|            |##|            |#
#|____________|##|____________|##|____________|#
\______________/              \__/
 Horizontal Repetition         Fill

The SideSize option scales the texture to model-space. The image X-axis / texture U-axis points along contour of the extrusion polygon (see IShape.ContourStart), where the left image border is mapped to the first vertex of each contour. The image Y-axis / texture V-axis points downwards, i.e. from RangeD.End of the extrusion range to RangeD.Start (which is mapped to the bottom image border). The SideRepeat option specifies the repetitions of the pattern (in this example, 3 and 2). This information is used to snap texture coordinates, so that only full repetitions are visible vertically and horizontally for each building edge.

Public / Constructors

Building​Options


public constructor BuildingOptions → ()

Creates a new instance of BuildingOptions.

Public / Attributes

Side​Angle


public attribute SideAngle → (float32)

The maximum angle (in degrees) between two consecutive shape edges that will be tolerated while merging edges, before applying the texture repetitions.

Will be clamped to 0. Set to 0 to disable edge merging. Defaults to 0.

Side​Fill


public attribute SideFill → (float32)

The width of the texture area (given in normalized texture coordinates) which shall be used to fill very short shape edges.

Will be clamped to 0 before use. Set to 0 to disable. Defaults to 0.

Side​Fill​Adjust


public attribute SideFillAdjust → (float32)

Optional coefficient that controls detection of very short shape edges.

Values greater than 1 detect short edges more aggressively, values less than 1 detect short edges in a more lenient way. Will be clamped to 0 before use. Defaults to 1.

Side​Offset


public attribute SideOffset → (Vec2F)

Optional offset to apply to texture coordinates.

Use this to shift tiled images, if repetitions straddle the image borders. Defaults to Vec2F.Zero.

Side​Repeat


public attribute SideRepeat → (Vec2I)

The tiling repetition count of the building side texture, along its X- and Y-axes.

Will be clamped to (1,1) before use. Defaults to (1,1).

Side​Size


public attribute SideSize → (Vec2D)

The size of the tiled building side texture, given in the length unit of the extrusion model.

If Vec2D.Zero, no texture coordinates will be generated for the sides of the extrusion model, see IShapeExtruder.Sides. For negative sizes, the respective texture axis will be flipped. Defaults to Vec2D.Zero.

Top​Matrix


public attribute TopMatrix → (Mat23D)

Optional matrix to use for transforming the shape vertex coordinates, before applying texturing.

Set to Mat2D.Zero or Mat2D.Identity to disable the transformation. Defaults to Mat2D.Zero.

Top​Size


public attribute TopSize → (Vec2D)

Size of the tiled building top texture, given in the length unit of the extrusion model.

If Vec2D.Zero, no texture coordinates will be generated for the caps of the extrusion model, see IShapeExtruder.CapStart and IShapeExtruder.CapEnd. Defaults to Vec2D.Zero.