working on obj description format
This commit is contained in:
parent
c5a3e9ad6b
commit
23057dac83
@ -25,4 +25,4 @@ thiserror = "1.0.30"
|
|||||||
approx = "0.5.1"
|
approx = "0.5.1"
|
||||||
poll-promise = { version = "0.1.0", features = ["tokio"] }
|
poll-promise = { version = "0.1.0", features = ["tokio"] }
|
||||||
tempfile = "3.3.0"
|
tempfile = "3.3.0"
|
||||||
nalgebra = "0.30.1"
|
nalgebra = { version = "0.30.1", features=["serde-serialize"]}
|
@ -1 +1,2 @@
|
|||||||
pub mod player;
|
pub mod player;
|
||||||
|
pub mod world_object;
|
26
game/game_logic/src/model/world_object.rs
Normal file
26
game/game_logic/src/model/world_object.rs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
use nalgebra as na;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
|
pub struct PossiblyAnimatedTexture {
|
||||||
|
/// Signal if the texture is animated or static
|
||||||
|
pub animated: bool,
|
||||||
|
/// Relative file path from `dist` to the texture
|
||||||
|
pub rel_file_path: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
|
pub struct WorldObject {
|
||||||
|
/// Object name. Must match the name of the texture
|
||||||
|
pub name: String,
|
||||||
|
/// Object variant name. Must match the name of the texture, or None if there is only one variant
|
||||||
|
pub variant_name: Option<String>,
|
||||||
|
/// Object position. 1,1 being up and to the right
|
||||||
|
pub position: na::Vector2<f32>,
|
||||||
|
/// Object rotation, positive is clockwise
|
||||||
|
pub rotation_radians: f32,
|
||||||
|
/// The object's bottom texture
|
||||||
|
pub bottom_texture: PossiblyAnimatedTexture,
|
||||||
|
/// The object's top texture
|
||||||
|
pub top_texture: Option<PossiblyAnimatedTexture>,
|
||||||
|
}
|
Reference in New Issue
Block a user