Crates.io | hxa |
lib.rs | hxa |
version | 0.2.2 |
source | src |
created_at | 2023-03-10 19:02:48.758076 |
updated_at | 2023-03-23 03:21:50.898531 |
description | Functions and Structs to parse HxA mesh data as specified by Eskil Steenberg |
homepage | |
repository | https://github.com/fcrisafulli-dev/hxa |
max_upload_size | |
id | 806647 |
size | 26,207 |
This is a WIP parser for the mesh format specified by Eskil Steenberg.
Link to HxA GitHub
To load a hxa file use the from()
function and pass a filepath.
use hxa;
let my_hxa = hxa::HXAFile::from("Cube.hxa");
You can parse this as is, or use the find functions to quickly obtain data:
use hxa::conventions::{hard,soft};
let model_geometry = my_hxa.get_first_geometry()
.expect("Expected to find a geometry node").0;
let vertex_stack = &model_geometry.vertex_stack;
let vertex_positions = vertex_stack
.find(hard::BASE_VERTEX_LAYER_NAME)
.expect("Expected to find a vertex layer")
.as_vec_f32();
let vertex_normals = vertex_stack
.find(soft::LAYER_NORMALS)
.expect("Expected to find a normal layer")
.as_vec_f32();