|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectWorldModuleGeometryUtil
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<VectorXYZ[]> |
createShapeExtrusionAlong(VectorXYZ[] shape,
List<VectorXYZ> extrusionPath,
List<VectorXYZ> upVectors)
creates triangle stip vectors for a shape extruded along a line of coordinates |
static VectorXYZ[] |
createVectorsForTriangleStripBetween(List<? extends VectorXYZ> leftOutline,
List<? extends VectorXYZ> rightOutline)
creates a triangle strip between two outlines with identical number of vectors |
static VectorXYZ[] |
createVectorsForVerticalTriangleStrip(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 boolean |
piercesWorldObject(VectorXZ pos,
Collection<WorldObject> worldObjects)
checks whether a position is on the area covered by a WorldObjectWithOutline from a collection
of WorldObject s. |
static VectorXYZ[] |
transformShape(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 VectorXYZ[] createVectorsForVerticalTriangleStrip(List<? extends VectorXYZ> baseLine, float stripLowerYBound, float stripUpperYBound)
public static final VectorXYZ[] createVectorsForTriangleStripBetween(List<? extends VectorXYZ> leftOutline, List<? extends 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[]> createShapeExtrusionAlong(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 VectorXYZ[] transformShape(VectorXYZ[] shape, VectorXYZ center, VectorXYZ forward, VectorXYZ up)
createShapeExtrusionAlong(VectorXYZ[], List, List)
center
- new center coordinateforward
- new forward direction (unit vector)up
- new up direction (unit vector)
public static final boolean piercesWorldObject(VectorXZ pos, 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.
WorldObjectWithOutline
from the collection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |