Skip to content

atl/sm/terraintile

import "atl/sm/terraintile"

Reading tile files (.tile) (sm.terrainTile). tile is a tile uuid from TileUuid(path); cellOffsetX/Y pick the cell in the tile.

func TileUuid(path string) sm.Uuid

The uuid of a tile file.

func Size(path string) int

The number of cells along one side of a tile.

func CreatorID(path string) string

The id of the tile's creator.

func HeightAt(tile sm.Uuid, cellOffsetX, cellOffsetY, lod, x, y int) float64

Terrain height at a vertex of a tile cell.

func ColorAt(tile sm.Uuid, cellOffsetX, cellOffsetY, lod, x, y int) sm.TerrainColor

Terrain color at a vertex of a tile cell.

func MaterialAt(tile sm.Uuid, cellOffsetX, cellOffsetY, lod, x, y int) sm.MaterialWeights

The 8 terrain material weights at a vertex of a tile cell.

func ClutterIdxAt(tile sm.Uuid, cellOffsetX, cellOffsetY, x, y int) int

The clutter index at a point of a tile cell.

func AssetsForCell(tile sm.Uuid, cellOffsetX, cellOffsetY, sizeLevel int) atl.Value
func HarvestablesForCell(tile sm.Uuid, cellOffsetX, cellOffsetY, sizeLevel int) atl.Value
func KinematicsForCell(tile sm.Uuid, cellOffsetX, cellOffsetY, sizeLevel int) atl.Value
func CreationsForCell(tile sm.Uuid, cellOffsetX, cellOffsetY int) atl.Value
func NodesForCell(tile sm.Uuid, cellOffsetX, cellOffsetY int) atl.Value
func DecalsForCell(tile sm.Uuid, cellOffsetX, cellOffsetY int) atl.Value
func PrefabsForCell(tile sm.Uuid, cellOffsetX, cellOffsetY int) atl.Value

A cell's contents, as the tables the matching TerrainScript Get...ForCell returns.

type PrefabContent struct {
Creations, Prefabs, Nodes, Assets, Decals, Harvestables, Kinematics atl.Value
}

Everything in a prefab file.

func ContentFromPrefab(path string, loadFlags *int) PrefabContent

Loads a prefab file. loadFlags is the PrepareCell mask.