~starkingdoms/starkingdoms

ref: bfce7aada3774a92f1b304dd3f9cd5524f22fcef starkingdoms/crates/unified/src/config/part.rs -rw-r--r-- 832 bytes
bfce7aad — core fix: parts 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use bevy::asset::Asset;
use bevy::math::Vec3;
use bevy::prelude::TypePath;
use serde::{Deserialize, Serialize};

#[derive(Deserialize, TypePath, Serialize, Clone, Debug, PartialEq, Asset)]
pub struct PartConfig {
    pub part: PartPartConfig,
    pub physics: PartPhysicsConfig,
    pub joints: Vec<JointConfig>
}
#[derive(Deserialize, TypePath, Serialize, Clone, Debug, PartialEq, Asset)]
pub struct PartPartConfig {
    pub name: String,
    pub sprite_connected: String,
    pub sprite_disconnected: String,
}
#[derive(Deserialize, TypePath, Serialize, Clone, Debug, PartialEq, Asset)]
pub struct PartPhysicsConfig {
    pub width: f32,
    pub height: f32,
    pub mass: f32
}
#[derive(Deserialize, TypePath, Serialize, Clone, Debug, PartialEq, Asset)]
pub struct JointConfig {
    pub translation: Vec3,
    pub rotation: f32
}