wow_m2/
lib.rs

1//! A parser for World of Warcraft M2 model files with version conversion support
2//!
3//! This library allows parsing, validating, and converting M2 model files between different versions
4//! of the World of Warcraft client.
5//!
6//! # Example
7//! ```rust,no_run
8//! use wow_m2::model::M2Model;
9//! use wow_m2::version::M2Version;
10//! use wow_m2::converter::M2Converter;
11//!
12//! // Load a model
13//! let model = M2Model::load("path/to/model.m2").unwrap();
14//!
15//! // Print model info
16//! println!("Model name: {:?}", model.name);
17//! println!("Model version: {:?}", model.header.version());
18//! println!("Vertices: {}", model.vertices.len());
19//!
20//! // Convert to a different version
21//! let converter = M2Converter::new();
22//! let converted = converter.convert(&model, M2Version::MoP).unwrap();
23//!
24//! // Save the converted model
25//! converted.save("path/to/converted.m2").unwrap();
26//! ```
27
28// Re-export main components
29pub mod anim;
30pub mod blp;
31pub mod chunks;
32pub mod common;
33pub mod converter;
34pub mod error;
35pub mod header;
36pub mod io_ext;
37pub mod model;
38pub mod skin;
39pub mod version;
40
41// Re-export common types
42pub use anim::AnimFile;
43pub use blp::BlpTexture;
44pub use converter::M2Converter;
45pub use error::{M2Error, Result};
46pub use model::M2Model;
47pub use skin::Skin;
48pub use version::M2Version;
49
50/// Library version
51pub const VERSION: &str = env!("CARGO_PKG_VERSION");