public class TerrainFeature
- Object
- TerrainFeature
A placed, variable-size terrain element such as a wall, ramp or platform. Unlike a per-cell
height/wall value, a feature has a free world position (in tile units) and an arbitrary
widthxheightxdepth plus rotation, so dungeon walls, sloped roads and raised platforms
of any size are first-class, dynamic objects. The #getType() names the shape family
(#TYPE_WALL, #TYPE_RAMP, #TYPE_PLATFORM) and #getMaterial() its surface.Fields
public static final String TYPE_WALL = "wall" | |
public static final String TYPE_RAMP = "ramp" | |
public static final String TYPE_PLATFORM = "platform" |
Constructors
public TerrainFeature() | |
public TerrainFeature(String id, String type) |
Methods
Inherited methods
Field details
TYPE_WALL
public static final String TYPE_WALL = "wall"TYPE_RAMP
public static final String TYPE_RAMP = "ramp"TYPE_PLATFORM
public static final String TYPE_PLATFORM = "platform"Constructor details
TerrainFeature
public TerrainFeature()TerrainFeature
public TerrainFeature(String id, String type)Method details
getId
public String getId()setId
public TerrainFeature setId(String id)getType
public String getType()setType
public TerrainFeature setType(String type)getX
public double getX()getY
public double getY()getZ
public double getZ()setPosition
public TerrainFeature setPosition(double x, double y, double z)Sets the feature’s world position in tile units (y = elevation).
getWidth
public double getWidth()getHeight
public double getHeight()getDepth
public double getDepth()setSize
public TerrainFeature setSize(double width, double height, double depth)Sets the feature size in tile units.
getRotation
public double getRotation()setRotation
public TerrainFeature setRotation(double rotation)getMaterial
public String getMaterial()setMaterial
public TerrainFeature setMaterial(String material)props
public Map<String, Object> props()