Caution
this crate has been deprecated!
you should use the new luduvo-rs crate instead! this repository will stay up for legacy purposes.
ldv-rs is a rust library designed for interacting with the `.ldv` file format.
crates.io | luduvo development hub
Warning
this crate is completely fanmade and has no affiliation with the luduvo devs.
Important
this library is in a pre-1.0.0 state! expect breaking changes between versions.
Tip
most users will want to import the prelude, via ldv_rs::prelude::*
- creating a
Fileinstance usingFile::from - creating a
Dominstance usingDom::from_file - exporting the
Dominstance usingDom.to_file
use ldv_rs::{data_types::Vec3, dom::Dom, file::File};
fn main() -> std::io::Result<()> {
let data = std::fs::read("assets/in/world.ldv")?;
let file = File::from(&data).unwrap();
let mut dom = Dom::from_file(&file);
dom.create_entity(999);
dom.set_position(999, Vec3 { x: 1.0, y: 2.0, z: 3.0 });
let new_file = dom.to_file().unwrap();
let bytes = new_file.to_bytes();
std::fs::write("assets/out/world.ldv", bytes)?;
println!("wrote to assets/out/world.ldv");
Ok(())
}Note
this crate is MIT-licensed. feel free to do whatever with it! all contributions (pull requests, issues) are welcomed.
- contact me on discord! my discord username is
@primiti_ve.- my preferred method of communication is joining the luduvo development hub! it's full of like-minded developers who will gladly help you out with any issues.
- create an issue! this is better for organisation purposes, although you should also join the luduvo development hub aswell.