org.osm2world.core.map_elevation.data
public class EleConnector extends Object
WorldObject
s, with known xz coords
and an elevation to be assigned by an ElevationCalculator
.
This class is a core concept of elevation calculation:
Because there is no injective mapping from xz coords to elevation (that
would not allow for bridges etc.), we need to represent whether points
are supposed to be "the same" with regards to elevation in some other manner.
Moreover, not all such points correspond to MapNode
s.
Thus, this purpose is served by EleConnectors.Modifier and Type | Field and Description |
---|---|
GroundState |
groundState
indicates whether this connector should be connected to the terrain,
or is instead above or below the terrain
|
VectorXZ |
pos |
Object |
reference
TODO document - MapNode or Intersection object, for example
|
Constructor and Description |
---|
EleConnector(VectorXZ pos,
Object reference,
GroundState groundState)
creates an EleConnector at the given xz coordinates.
|
Modifier and Type | Method and Description |
---|---|
boolean |
connectsTo(EleConnector other)
returns true if this connector is to be joined with the other one.
|
VectorXYZ |
getPosXYZ()
returns the 3d position after it has been calculated.
|
void |
setPosXYZ(VectorXYZ posXYZ)
assigns the elevation that has been calculated for this connector.
|
String |
toString() |
public final VectorXZ pos
public final Object reference
public final GroundState groundState
public EleConnector(VectorXZ pos, Object reference, GroundState groundState)
pos
- final value for pos
; != nullreference
- final value for reference
; may be nullgroundState
- final value for groundState
public void setPosXYZ(VectorXYZ posXYZ)
ElevationCalculator
.
TODO make package-visiblepublic VectorXYZ getPosXYZ()
VectorXYZ
, is the only
property which changes (exactly once) over the lifetime of an
EleConnector
: It is null before elevation calculation,
and assigned its ultimate value afterwards.public boolean connectsTo(EleConnector other)
public String toString()
toString
in class Object