This commit is contained in:
Quaternions 2024-02-21 03:23:50 -08:00
parent 04c70ba0bc
commit aadcca91ea

View File

@ -47,7 +47,7 @@ pub enum PhysicsInputInstruction {
//to be 1 instruction ahead to generate the next state for interpolation.
}
#[derive(Clone,Copy,Hash,Default)]
#[derive(Clone,Copy,Debug,Default,Hash)]
pub struct Body{
pub position:Planar64Vec3,//I64 where 2^32 = 1 u
pub velocity:Planar64Vec3,//I64 where 2^32 = 1 u/s
@ -125,7 +125,7 @@ impl InputState{
((dm*t)/dt).as_ivec2()
}
}
#[derive(Clone,Debug)]
enum JumpDirection{
Exactly(Planar64Vec3),
FromContactNormal,
@ -138,6 +138,7 @@ impl JumpDirection{
}
}
}
#[derive(Clone,Debug)]
enum TransientAcceleration{
Reached,
Reachable{
@ -149,6 +150,7 @@ enum TransientAcceleration{
acceleration:Planar64Vec3,
}
}
#[derive(Clone,Debug)]
struct ContactMoveState{
jump_direction:JumpDirection,
contact:ContactCollision,
@ -251,7 +253,7 @@ impl PhysicsModels{
}
}
#[derive(Clone,Copy)]
#[derive(Clone,Copy,Debug)]
pub struct PhysicsCamera{
//punch: Planar64Vec3,
//punch_velocity: Planar64Vec3,
@ -322,6 +324,7 @@ impl std::default::Default for PhysicsCamera{
}
mod gameplay{
use super::{gameplay_modes,HashSet,HashMap,ModelId};
#[derive(Clone,Debug)]
pub struct ModeState{
mode_id:gameplay_modes::ModeId,
stage_id:gameplay_modes::StageId,
@ -390,7 +393,7 @@ mod gameplay{
}
}
}
#[derive(Clone,Debug)]
struct WorldState{}
struct HitboxMesh{
@ -474,7 +477,7 @@ impl StyleHelper for StyleModifiers{
HitboxMesh::new(mesh,transform)
}
}
#[derive(Clone,Debug)]
enum MoveState{
Air,
Walk(ContactMoveState),
@ -684,7 +687,7 @@ impl Collision{
}
}
}
#[derive(Default)]
#[derive(Clone,Debug,Default)]
struct TouchingState{
contacts:HashSet::<ContactCollision>,
intersects:HashSet::<IntersectCollision>,
@ -880,6 +883,7 @@ impl VirtualBody<'_>{
}
}
#[derive(Clone,Debug)]
pub struct PhysicsState{
time:Time,
body:Body,