public class TerrainFeature

  1. Object
  2. 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

public String getId()
public TerrainFeature setId(String id)
public String getType()
public TerrainFeature setType(String type)
public double getX()
public double getY()
public double getZ()
public TerrainFeature setPosition(double x, double y, double z)Sets the feature’s world position in tile units (y = elevation).
public double getWidth()
public double getHeight()
public double getDepth()
public TerrainFeature setSize(double width, double height, double depth)Sets the feature size in tile units.
public double getRotation()
public TerrainFeature setRotation(double rotation)
public String getMaterial()
public TerrainFeature setMaterial(String material)
public Map<String, Object> props()

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()