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 represents fully compressed and decoded data associated with one or more xc3_lib types. This simplifies the processing that needs to be done to access model data and abstracts away most of the game specific complexities.

§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.bin")?;

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!("{}", roots[0].image_textures.len());

Re-exports§

pub use collision::load_collisions;

Modules§

animation
Utilities for working with animation data.
collision
error
material
model
monolib
Utilities for loading global textures from the monolib/shader folder or calculated in previous passes.
shader_database
Database for compiled shader metadata for more accurate rendering.
skinning
Utilities for working with vertex skinning.
vertex
Utilities for working with vertex buffer data.

Structs§

Bone
A single node in the skeleton heirarchy.
ImageTexture
A non swizzled version of an Mibl or Mtxt texture.
LodData
See LodData.
LodGroup
See LodGroup.
LodItem
See LodItem.
MapRoot
Mesh
See MeshV112.
MeshRenderFlags2
Flags to determine how to draw a MeshV112.
Model
See ModelV112.
ModelGroup
ModelRoot
Models
See ModelsV112.
Sampler
See SamplerFlags.
Skeleton
See Skeleton and Skinning.
Transform
A decomposed transform as scale -> rotation -> translation (TRS).

Enums§

AddressMode
How edges should be handled in texture addressing.
ExtractedTextures
FilterMode
Texel mixing mode when sampling between texels.
ImageFormat
nvn image format types used by Xenoblade 1 DE, Xenoblade 2, and Xenoblade 3.
MeshRenderPass
The render pass for this draw call.
ViewDimension

Traits§

IndexMapExt
A trait for mapping unique items to an index.

Functions§

load_animations
Load all animations from a .anm, .mot, or .motstm_data file.
load_map
Load a map from a .wismhd file. The corresponding .wismda should be in the same directory.
load_model
Load a model from a .wimdo or .pcmdo file. The corresponding .wismt or .pcsmt and .chr or .arc should be in the same directory.
load_model_legacy
Load a model from a .camdo file. The corresponding .casmtshould be in the same directory.
load_skel