Expand description
BWM/WOK binary walkmesh support. BWM/WOK binary reader and writer.
BWM is KotOR’s binary walkmesh container format. The same binary layout is
used by .wok (area walkmesh), .pwk (placeable walkmesh), and .dwk
(door walkmesh) resources.
This module provides lossless table-level parsing and deterministic
serialization for the binary BWM V1.0 layout.
§Format Layout
+------------------------------+ 0x0000
| Header (136 bytes) |
| "BWM " + "V1.0" + |
| properties + counts/offsets |
+------------------------------+ vertex_offset
| Vertices |
| 12 bytes * vertex_count |
+------------------------------+ face_indices_offset
| Face indices |
| 12 bytes * face_count |
+------------------------------+ materials_offset
| Face materials |
| 4 bytes * face_count |
+------------------------------+ normals_offset
| Face normals |
| 12 bytes * face_count |
+------------------------------+ planar_distances_offset
| Planar distances |
| 4 bytes * face_count |
+------------------------------+ aabb_offset
| AABB nodes |
| 44 bytes * aabb_count |
+------------------------------+ adjacency_offset
| Adjacency table |
| 12 bytes * adjacency_count |
+------------------------------+ edges_offset
| Edge transitions |
| 8 bytes * edge_count |
+------------------------------+ perimeters_offset
| Perimeter entries |
| 4 bytes * perimeter_count |
+------------------------------+Re-exports§
pub use ascii_reader::read_bwm_ascii;pub use ascii_reader::BwmAsciiError;pub use ascii_writer::write_bwm_ascii;
Modules§
- ascii_
reader - ASCII reader. BWM ASCII reader implementation.
- ascii_
writer - ASCII writer. BWM ASCII writer implementation.
Structs§
- Bwm
- In-memory binary BWM container.
- BwmAabb
Node - One AABB-node row.
- BwmAdjacency
- One adjacency row.
- BwmEdge
- One edge-transition row.
- BwmFace
- One face row assembled from index/material/normal/distance tables.
- BwmType
Code - Lossless walkmesh-type wrapper.
- BwmVec3
- Three-dimensional vector value.
Enums§
- BwmBinary
Error - Errors produced while parsing or serializing BWM binary data.
- BwmType
- Known walkmesh type values.
- Surface
Material - Surface material IDs used in walkmeshes.
Functions§
- read_
bwm - Reads BWM data from a reader.
- read_
bwm_ from_ bytes - Reads BWM data from bytes.
- write_
bwm - Writes BWM data to a writer.
- write_
bwm_ to_ vec - Serializes BWM data to a byte vector.