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