Struct TrnNWN2WalkmeshPayload
Compressed walkmesh (only contained inside TRX files) (ASWM)
struct TrnNWN2WalkmeshPayload
;
Constructors
Name | Description |
---|---|
this
(payload)
|
Build packet with raw data |
Fields
Name | Type | Description |
---|---|---|
edges
|
TrnNWN2WalkmeshPayload | |
header
|
TrnNWN2WalkmeshPayload | ASWM packet header |
islands
|
TrnNWN2WalkmeshPayload | Islands list. See Island
|
islands_path_nodes
|
TrnNWN2WalkmeshPayload | |
tiles
|
TrnNWN2WalkmeshPayload | Map tile list
Non border tiles have header
|
tiles_border_size
|
uint | Width of the map borders in tiles (8 means that 8 tiles will be removed on each side) |
tiles_flags
|
uint | Always 31 in TRX files, 15 in TRN files |
tiles_grid_height
|
uint | Number of tiles along Y axis |
tiles_grid_width
|
uint | Number of tiles along X axis |
tiles_width
|
float | Width in meters of a terrain tile (most likely to be 10.0) |
triangles
|
TrnNWN2WalkmeshPayload | |
vertices
|
TrnNWN2WalkmeshPayload |
Methods
Name | Description |
---|---|
bake
(removeBorders)
|
Bake the existing walkmesh by re-creating tiles, islands, path tables, ... |
buildEdges
()
|
Rebuilds edge data by going through every triangle / vertices |
dump
()
|
Dump trn data as text |
findIslandsPath
(fromIslandIndex, toIslandIndex)
|
Calculate the fastest route between two islands. The area need to be baked, as it uses existing path tables. |
removeTriangles
(removeFunc)
|
Removes triangles from the mesh, and removes unused vertices and edges accordingly. |
serialize
()
|
Serialize TRN packet data |
serializeUncompressed
()
|
Serialize the aswm data without compressing it. Useful for debugging raw data. |
setFootstepSounds
(trrnPackets, textureFlags)
|
Set the footstep sound flags for each triangle of the walkmesh |
setFootstepSounds
(trrnPackets, terrainmaterials)
|
ditto |
setGenericMesh
(mesh)
|
Set 3d mesh geometry |
toGenericMesh
(triangleFlags)
|
Converts terrain mesh data to a more generic format. |
translateIndices
(triTransTable, edgeTransTable, vertTransTable)
|
Translate triangle / edge / vertex indices stored in mesh data. |
validate
(strict)
|
Check if the ASWM contains legit data |
Inner structs
Name | Description |
---|---|
Edge
|
Edge between two triangles |
Header
|
ASWM packet header |
Island
|
Tile or fraction of a tile used for pathfinding through large distances. |
IslandPathNode
|
|
Tile
|
Tile with its path table |
Triangle
|
Mesh Triangle + pre-calculated data + metadata |
Unions
Name | Description |
---|---|
Vertex
|