Crate xc3_model

source ·
Expand description

xc3_model

xc3_model provides high level data access for the files that make up a model.

Each type typically represents the decoded data associated with one or more types in xc3_lib. This simplifies the processing that needs to be done to access model data and abstracts away most of the game specific complexities. This conversion is currently one way, so saving types back to files is not yet supported.

Getting Started

Loading a normal model returns a single ModelRoot. Loading a map returns multiple ModelRoot. Each ModelRoot has its own set of images.

The ShaderDatabase is optional and improves the accuracy of texture and material assignments.

use xc3_model::shader_database::ShaderDatabase;

let database = ShaderDatabase::from_file("xc3.json");

let root = xc3_model::load_model("ch01011013.wimdo", Some(&database));
println!("{}", root.image_textures.len());

let roots = xc3_model::load_map("ma59a.wismhd", Some(&database));
println!("{}", root.image_textures.len());

Modules

  • Utilities for working with animation data.
  • Conversions from xc3_model types to glTF.
  • Database for compiled shader metadata for more accurate rendering.
  • Utilities for working with vertex skinning.
  • Utilities for working with vertex buffer data.

Structs

Enums

Functions

  • Load all animations from a .anm, .mot, or .motstm_data file.
  • Load a map from a .wismhd file. The corresponding .wismda should be in the same directory.
  • Load a model from a .wimdo or .pcmdo file. The corresponding .wismt or .pcsmt and .chr or .arc should be in the same directory.
  • Returns true if a mesh with lod should be rendered as part of the highest detail or base level of detail (LOD).