Struct TrnNWN2WalkmeshPayload

Compressed walkmesh (only contained inside TRX files) (ASWM)

struct TrnNWN2WalkmeshPayload ;

Constructors

NameDescription
this (payload) Build packet with raw data

Fields

NameTypeDescription
edges TrnNWN2WalkmeshPayload.Edge[]
header TrnNWN2WalkmeshPayload.HeaderASWM packet header
islands TrnNWN2WalkmeshPayload.Island[]Islands list. See Island
islands_path_nodes TrnNWN2WalkmeshPayload.IslandPathNode[]
tiles TrnNWN2WalkmeshPayload.Tile[]Map tile list Non border tiles have header.vertices_count > 0 || header.edges_count > 0 || header.triangles_count > 0
tiles_border_size uintWidth of the map borders in tiles (8 means that 8 tiles will be removed on each side)
tiles_flags uintAlways 31 in TRX files, 15 in TRN files
tiles_grid_height uintNumber of tiles along Y axis
tiles_grid_width uintNumber of tiles along X axis
tiles_width floatWidth in meters of a terrain tile (most likely to be 10.0)
triangles TrnNWN2WalkmeshPayload.Triangle[]
vertices TrnNWN2WalkmeshPayload.Vertex[]

Methods

NameDescription
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

NameDescription
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

NameDescription
Vertex