Crates.io | bvh_anim |
lib.rs | bvh_anim |
version | 0.4.0 |
source | src |
created_at | 2019-03-11 20:50:38.274672 |
updated_at | 2019-05-02 20:19:22.823798 |
description | A .bvh file parser |
homepage | |
repository | https://github.com/burtonageo/bvh_anim |
max_upload_size | |
id | 120131 |
size | 540,474 |
A rust library for loading .bvh
files containing skeletal animation data.
⚠⚠NOTE: This library is currently alpha quality software.⚠⚠
To get started, add the following to your Cargo.toml
:
[dependencies]
bvh_anim = "0.2"
And then, you can import the library using the use bvh_anim::*;
statement
in your rust files. A small example is shown below:
use bvh_anim;
use std::fs::File;
let bvh_file = File::open("./path/to/anim.bvh")?;
let bvh = bvh_anim::load(BufReader::new(bvh_file))?;
for joint in bvh.joints() {
println!("{:#?}", joint);
}
println!("Frame time: {:?}", bvh.frame_time());
for frame in bvh.frames() {
println!("{:?}", frame);
}
let mut out_file = File::create("./out.bvh");
bvh.write_to(&mut out_file)?;
For more information about the bvh file format and using this library, see the documentation on docs.rs.
This crate has a small ffi module which allows you to parse bvh
files
from C
code. The ffi
module can be enabled with the ffi
feature,
and you can read the docs for it on docs.rs
.
In addition, the bindings
feature can be enabled to generate the C
bindings using cbindgen
. The bindings header is written to either
$CARGO_TARGET_DIR
if it is specified, or
$CARGO_MANIFEST_DIR/target/include/bvh_anim/bvh_anim.h
if it is
not.
This library welcomes open source contributions, including pull requests and bug reports (including feature requests).
This library aims to be the primary bvh
parser in the Rust ecosystem, and aims
to correctly parse a wide variety of bvh
files. If you have a file which does
not parse correctly, please report a bug. Parsing should always return an error on
failure and never panic.
Copyright © 2019 George Burton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.