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{ impl StageId{
pub const FIRST:Self=Self(0); pub const FIRST:Self=Self(0);
} }
#[derive(Clone)]
pub struct Stage{ pub struct Stage{
spawn:ModelId, spawn:ModelId,
//open world support lol //open world support lol
@ -85,6 +86,7 @@ impl ModeId{
pub const MAIN:Self=Self(0); pub const MAIN:Self=Self(0);
pub const BONUS:Self=Self(1); pub const BONUS:Self=Self(1);
} }
#[derive(Clone)]
pub struct Mode{ pub struct Mode{
style:gameplay_style::StyleModifiers, style:gameplay_style::StyleModifiers,
start:ModelId,//when you press reset you go here start:ModelId,//when you press reset you go here
@ -197,7 +199,7 @@ impl ModeUpdate{
} }
} }
#[derive(Default)] #[derive(Default,Clone)]
pub struct Modes{ pub struct Modes{
modes:Vec<Mode>, 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}; use crate::integer::{Time,Ratio64,Planar64,Planar64Vec3};
#[derive(Clone)]
pub struct StyleModifiers{ pub struct StyleModifiers{
pub controls_used:u32,//controls which are allowed to pass into gameplay 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) 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{ pub enum JumpCalculation{
Capped,//roblox Capped,//roblox
Energy,//new Energy,//new
Linear,//source Linear,//source
} }
#[derive(Clone)]
pub enum JumpImpulse{ pub enum JumpImpulse{
FromTime(Time),//jump time is invariant across mass and gravity changes FromTime(Time),//jump time is invariant across mass and gravity changes
FromHeight(Planar64),//jump height 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 //Energy means it adds energy
//Linear means it linearly adds on //Linear means it linearly adds on
#[derive(Clone)]
pub enum EnableStrafe{ pub enum EnableStrafe{
Always, Always,
MaskAny(u32),//hsw, shsw MaskAny(u32),//hsw, shsw
@ -235,6 +239,7 @@ pub enum EnableStrafe{
//Function(Box<dyn Fn(u32)->bool>), //Function(Box<dyn Fn(u32)->bool>),
} }
#[derive(Clone)]
pub struct StrafeSettings{ pub struct StrafeSettings{
enable:EnableStrafe, enable:EnableStrafe,
air_accel_limit:Option<Planar64>, air_accel_limit:Option<Planar64>,
@ -253,6 +258,7 @@ impl StrafeSettings{
} }
} }
#[derive(Clone)]
pub enum HitboxMesh{ pub enum HitboxMesh{
Box,//source Box,//source
Cylinder,//roblox Cylinder,//roblox
@ -262,6 +268,7 @@ pub enum HitboxMesh{
//DualCone, //DualCone,
} }
#[derive(Clone)]
pub struct Hitbox{ pub struct Hitbox{
pub halfsize:Planar64Vec3, pub halfsize:Planar64Vec3,
pub mesh:HitboxMesh, pub mesh:HitboxMesh,

View File

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