|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object WorldModuleGeometryUtil
public final class WorldModuleGeometryUtil
offers some geometry-related utility functions for WorldModule
s
Method Summary | |
---|---|
static List<VectorXYZ> |
createLineBetween(List<VectorXYZ> leftOutline,
List<VectorXYZ> rightOutline,
float ratio)
|
static List<List<VectorXYZ>> |
createShapeExtrusionAlong(List<VectorXYZ> shape,
List<VectorXYZ> extrusionPath,
List<VectorXYZ> upVectors)
creates triangle strip vectors for a shape extruded along a line of coordinates |
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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<List<VectorXYZ>> createShapeExtrusionAlong(List<VectorXYZ> shape, List<VectorXYZ> extrusionPath, List<VectorXYZ> upVectors)
shape
- shape relative to originextrusionPath
- nodes to extrude the shape along; needs at least 2 nodesupVectors
- vector for "up" direction at each extrusion path node.
You can use Collections.nCopies(int, Object)
if you want the same up vector for all nodes.
public 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)
createShapeExtrusionAlong(List, List, List)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |