forked from StrafesNET/strafe-client
game mechanics enums v1
This commit is contained in:
parent
bb8c53aee2
commit
b04a6d870a
78
src/body.rs
78
src/body.rs
@ -257,28 +257,66 @@ fn get_control_dir(controls: u32) -> glam::Vec3{
|
|||||||
return control_dir
|
return control_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PhysicsState {
|
pub enum SetSpawnBehaviour{
|
||||||
pub body: Body,
|
None,
|
||||||
pub hitbox_halfsize: glam::Vec3,
|
Trigger,
|
||||||
pub contacts: std::collections::HashSet::<RelativeCollision>,
|
Teleport,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum GameMechanicAttributes{
|
||||||
|
Platform{
|
||||||
|
spawn_id:u32,
|
||||||
|
},
|
||||||
|
SetSpawn{
|
||||||
|
spawn_id:u32,//which spawn to send to
|
||||||
|
force:bool,//allow setting to lower spawn id i.e. 7->3
|
||||||
|
behaviour:SetSpawnBehaviour
|
||||||
|
},
|
||||||
|
//Spawn(u32) NO! spawns are indexed in the map header instead of marked with attibutes
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct GameMechanicsState{
|
||||||
|
pub spawn_id:u32,
|
||||||
|
//jump_count:u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct WorldState{
|
||||||
|
//all models
|
||||||
|
pub models:Vec<ModelPhysics>,
|
||||||
|
//indexed list spawns[mode][spawn_id]=model_id
|
||||||
|
pub spawns:Vec<Vec<u32>>,
|
||||||
|
//the spawn point is where you spawn when you load into the map.
|
||||||
|
//This is not the same as Reset which teleports you to Spawn0
|
||||||
|
pub spawn_point:glam::Vec3,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct StyleModifiers{
|
||||||
|
pub keys_mask:u32,//keys which are unable to be activated
|
||||||
|
pub keys_held:u32,//keys which must be active to be able to strafe
|
||||||
|
pub mv:f32,
|
||||||
|
pub walk:WalkState,
|
||||||
|
pub walkspeed:f32,
|
||||||
|
pub friction:f32,
|
||||||
|
pub walk_accel:f32,
|
||||||
|
pub gravity:glam::Vec3,
|
||||||
|
pub strafe_tick_num:TIME,
|
||||||
|
pub strafe_tick_den:TIME,
|
||||||
|
pub hitbox_halfsize:glam::Vec3,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PhysicsState{
|
||||||
|
pub time:TIME,
|
||||||
|
pub body:Body,
|
||||||
|
pub world:WorldState,
|
||||||
|
pub game:GameMechanicsState,
|
||||||
|
pub style:StyleModifiers,
|
||||||
|
pub contacts:std::collections::HashSet::<RelativeCollision>,
|
||||||
//pub intersections: Vec<ModelId>,
|
//pub intersections: Vec<ModelId>,
|
||||||
pub models: Vec<ModelPhysics>,
|
|
||||||
//camera must exist in state because wormholes modify the camera, also camera punch
|
//camera must exist in state because wormholes modify the camera, also camera punch
|
||||||
pub camera: Camera,
|
pub camera:Camera,
|
||||||
pub mouse_interpolation: MouseInterpolationState,
|
pub mouse_interpolation:MouseInterpolationState,
|
||||||
pub controls: u32,
|
pub controls:u32,
|
||||||
pub time: TIME,
|
pub grounded:bool,
|
||||||
pub strafe_tick_num: TIME,
|
|
||||||
pub strafe_tick_den: TIME,
|
|
||||||
pub tick: u32,
|
|
||||||
pub mv: f32,
|
|
||||||
pub walk: WalkState,
|
|
||||||
pub walkspeed: f32,
|
|
||||||
pub friction: f32,
|
|
||||||
pub walk_accel: f32,
|
|
||||||
pub gravity: glam::Vec3,
|
|
||||||
pub grounded: bool,
|
|
||||||
pub spawn_point: glam::Vec3,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug,Clone,Copy,Hash,Eq,PartialEq)]
|
#[derive(Debug,Clone,Copy,Hash,Eq,PartialEq)]
|
||||||
|
Loading…
Reference in New Issue
Block a user