org.osm2world.core.world.modules.common
public final class WorldModuleGeometryUtil extends Object
WorldModule
sModifier and Type | Method and Description |
---|---|
static List<VectorXYZ> |
createLineBetween(List<VectorXYZ> leftOutline,
List<VectorXYZ> rightOutline,
float ratio) |
static List<VectorXYZ> |
createTriangleStripBetween(List<VectorXYZ> leftOutline,
List<VectorXYZ> rightOutline)
creates a triangle strip between two outlines with identical number of vectors
|
static List<VectorXYZ> |
createVerticalTriangleStrip(List<? extends VectorXYZ> baseLine,
float stripLowerYBound,
float stripUpperYBound)
creates the vectors for a vertical triangle strip
at a given elevation above a line of points
|
static void |
filterWorldObjectCollisions(Collection<VectorXZ> positions,
Collection<WorldObject> worldObjects)
removes positions from a collection if they are on the area covered by a
WorldObjectWithOutline from a collection of WorldObject s. |
static List<VectorXYZ> |
rotateShapeX(List<VectorXYZ> shape,
double angle,
double posY,
double posZ)
creates an rotated version of a list of vectors
by rotating them by the given angle around the parallel of the x axis
defined by the given Y and Z coordinates
|
static List<VectorXYZ> |
transformShape(List<VectorXYZ> shape,
VectorXYZ center,
VectorXYZ forward,
VectorXYZ up)
moves a shape that was defined at the origin to a new position.
|
public static final List<VectorXYZ> createVerticalTriangleStrip(List<? extends VectorXYZ> baseLine, float stripLowerYBound, float stripUpperYBound)
public static final List<VectorXYZ> createTriangleStripBetween(List<VectorXYZ> leftOutline, List<VectorXYZ> rightOutline)
public static final List<VectorXYZ> createLineBetween(List<VectorXYZ> leftOutline, List<VectorXYZ> rightOutline, float ratio)
ratio
- 0 is at left outline, 1 at right outlinepublic static final List<VectorXYZ> rotateShapeX(List<VectorXYZ> shape, double angle, double posY, double posZ)
angle
- rotation angle in degreespublic static final List<VectorXYZ> transformShape(List<VectorXYZ> shape, VectorXYZ center, VectorXYZ forward, VectorXYZ up)
VectorXYZ.NULL_VECTOR
, forward to VectorXYZ.Z_UNIT
,
and up to VectorXYZ.Y_UNIT
.center
- new center coordinateforward
- new forward direction (unit vector)up
- new up direction (unit vector)public static final void filterWorldObjectCollisions(Collection<VectorXZ> positions, Collection<WorldObject> worldObjects)
WorldObjectWithOutline
from a collection of WorldObject
s.
This can be used to avoid placing trees, bridge pillars
and other randomly distributed features on roads, rails
or other similar places where they don't belong.