org.osm2world.core.target.common.material
public enum NamedTexCoordFunction extends Enum<NamedTexCoordFunction> implements TexCoordFunction
TexCoordFunction
implementations.
They can be referenced by name in style definition files.
Target
s may also provide special implementations for them
(e.g. as a specialized shader).Enum Constant and Description |
---|
GLOBAL_X_Y
like
GLOBAL_X_Z , but uses y instead of z dimension. |
GLOBAL_X_Z
uses x and z vertex coords together with the texture's width and height
to place a texture.
|
SLOPED_TRIANGLES
creates texture coordinates for individual triangles that
orient the texture based on each triangle's downward slope.
|
STRIP_FIT
stretches the texture exactly once onto a triangle strip (alternating
between upper and lower vertex).
|
STRIP_FIT_HEIGHT
creates texture coordinates for a triangle strip (alternating between
upper and lower vertex), based on the length along a wall from the
starting point.
|
STRIP_WALL
creates texture coordinates for a triangle strip (alternating between
upper and lower vertex), based on the length along a wall from the
starting point, height of the vertex, and texture size.
|
Modifier and Type | Method and Description |
---|---|
List<VectorXZ> |
apply(List<VectorXYZ> vs,
TextureData textureData)
calculates a texture coordinate for each vertex
|
static NamedTexCoordFunction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NamedTexCoordFunction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NamedTexCoordFunction GLOBAL_X_Z
public static final NamedTexCoordFunction GLOBAL_X_Y
GLOBAL_X_Z
, but uses y instead of z dimension.
Better suited for certain vertical surfaces.public static final NamedTexCoordFunction SLOPED_TRIANGLES
public static final NamedTexCoordFunction STRIP_WALL
public static final NamedTexCoordFunction STRIP_FIT_HEIGHT
STRIP_WALL
, except that one texture coordinate
dimension alternates between 1 and 0 instead of being based on height.public static final NamedTexCoordFunction STRIP_FIT
public static NamedTexCoordFunction[] values()
for (NamedTexCoordFunction c : NamedTexCoordFunction.values()) System.out.println(c);
public static NamedTexCoordFunction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic List<VectorXZ> apply(List<VectorXYZ> vs, TextureData textureData)
TexCoordFunction
apply
in interface TexCoordFunction