physics requirements

This commit is contained in:
Quaternions 2024-02-07 22:33:51 -08:00
parent a1fa2c2781
commit 03868552c2
3 changed files with 10 additions and 3 deletions

View File

@ -38,6 +38,7 @@ pub struct StageId(u32);
impl StageId{
pub const FIRST:Self=Self(0);
}
#[derive(Clone)]
pub struct Stage{
spawn:ModelId,
//open world support lol
@ -85,6 +86,7 @@ impl ModeId{
pub const MAIN:Self=Self(0);
pub const BONUS:Self=Self(1);
}
#[derive(Clone)]
pub struct Mode{
style:gameplay_style::StyleModifiers,
start:ModelId,//when you press reset you go here
@ -197,7 +199,7 @@ impl ModeUpdate{
}
}
#[derive(Default)]
#[derive(Default,Clone)]
pub struct Modes{
modes:Vec<Mode>,
}

View File

@ -2,6 +2,7 @@ const VALVE_SCALE:Planar64=Planar64::raw(1<<28);// 1/16
use crate::integer::{Time,Ratio64,Planar64,Planar64Vec3};
#[derive(Clone)]
pub struct StyleModifiers{
pub controls_used:u32,//controls which are allowed to pass into gameplay
pub controls_mask:u32,//controls which are masked from control state (e.g. jump in scroll style)
@ -211,12 +212,14 @@ impl StyleModifiers{
}
}
#[derive(Clone)]
pub enum JumpCalculation{
Capped,//roblox
Energy,//new
Linear,//source
}
#[derive(Clone)]
pub enum JumpImpulse{
FromTime(Time),//jump time is invariant across mass and gravity changes
FromHeight(Planar64),//jump height is invariant across mass and gravity changes
@ -228,6 +231,7 @@ pub enum JumpImpulse{
//Energy means it adds energy
//Linear means it linearly adds on
#[derive(Clone)]
pub enum EnableStrafe{
Always,
MaskAny(u32),//hsw, shsw
@ -235,6 +239,7 @@ pub enum EnableStrafe{
//Function(Box<dyn Fn(u32)->bool>),
}
#[derive(Clone)]
pub struct StrafeSettings{
enable:EnableStrafe,
air_accel_limit:Option<Planar64>,
@ -253,6 +258,7 @@ impl StrafeSettings{
}
}
#[derive(Clone)]
pub enum HitboxMesh{
Box,//source
Cylinder,//roblox
@ -262,6 +268,7 @@ pub enum HitboxMesh{
//DualCone,
}
#[derive(Clone)]
pub struct Hitbox{
pub halfsize:Planar64Vec3,
pub mesh:HitboxMesh,

View File

@ -1,7 +1,5 @@
use std::collections::HashMap;
use crate::integer::{Planar64Vec3,Planar64Affine3};
use crate::gameplay_attributes;
use crate::updatable::Updatable;
pub type TextureCoordinate=glam::Vec2;
pub type Color4=glam::Vec4;