9 Commits

Author SHA1 Message Date
165a59be6d Revert "delete updatable"
This reverts commit c519ed4ec2.
2024-03-29 01:10:18 -07:00
2c926efa0d delete updatable 2024-03-29 01:10:15 -07:00
74acfbf206 use strafesnet registry 2024-03-29 01:10:15 -07:00
a9f3e61f2b why is this private 2024-03-13 11:25:02 -07:00
db142d125b add Clone for Mesh 2024-03-12 21:42:19 -07:00
ef922135e6 update deps 2024-03-02 13:06:04 -08:00
9aec0e1b52 misc 2024-03-02 04:58:39 -08:00
b065f83faf fix jump limit 2024-03-02 04:58:31 -08:00
39b202176f redesign StyleModifiers 2024-03-02 04:58:00 -08:00
5 changed files with 30 additions and 39 deletions

7
Cargo.lock generated

@ -17,7 +17,8 @@ checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3"
[[package]]
name = "id"
version = "0.1.0"
source = "git+https://git.itzana.me/Quaternions/id?rev=1f710976cc786c8853dab73d6e1cee53158deeb0#1f710976cc786c8853dab73d6e1cee53158deeb0"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "2337e7a6c273082b672e377e159d7a168fb51438461b7c4033c79a515dd7a25a"
dependencies = [
"proc-macro2",
"quote",
@ -53,9 +54,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.48"
version = "2.0.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07"
dependencies = [
"proc-macro2",
"quote",

@ -8,4 +8,4 @@ edition = "2021"
[dependencies]
bitflags = "2.4.2"
glam = "0.25.0"
id = { git = "https://git.itzana.me/Quaternions/id", rev = "1f710976cc786c8853dab73d6e1cee53158deeb0" }
id = { version = "0.1.0", registry = "strafesnet" }

@ -3,41 +3,33 @@ const VALVE_SCALE:Planar64=Planar64::raw(1<<28);// 1/16
use crate::integer::{Time,Ratio64,Planar64,Planar64Vec3};
use crate::controls_bitflag::Controls;
#[derive(Clone,Debug)]
pub enum Continuity{
FirstDegree(FlySettings),
SecondDegree{
//strafing
strafe:Option<StrafeSettings>,
//player gets a controllable rocket force
rocket:Option<PropulsionSettings>,
//flying
//jumping is allowed
jump:Option<JumpSettings>,
//standing & walking is allowed
walk:Option<WalkSettings>,
//laddering is allowed
ladder:Option<LadderSettings>,
//water propulsion
swim:Option<PropulsionSettings>,
//maximum slope before sloped surfaces become frictionless
gravity:Planar64Vec3,
//unused
mass:Planar64,
}
}
#[derive(Clone,Debug)]
pub struct StyleModifiers{
//controls which are allowed to pass into gameplay (usually all)
pub controls_mask:Controls,
//controls which are masked from control state (e.g. !jump in scroll style)
pub controls_mask_state:Controls,
pub continuity:Continuity,
//strafing
pub strafe:Option<StrafeSettings>,
//player gets a controllable rocket force
pub rocket:Option<PropulsionSettings>,
//flying
//jumping is allowed
pub jump:Option<JumpSettings>,
//standing & walking is allowed
pub walk:Option<WalkSettings>,
//laddering is allowed
pub ladder:Option<LadderSettings>,
//water propulsion
pub swim:Option<PropulsionSettings>,
//maximum slope before sloped surfaces become frictionless
pub gravity:Planar64Vec3,
//hitbox
pub hitbox:Hitbox,
//camera location relative to the center (0,0,0) of the hitbox
pub camera_offset:Planar64Vec3,
//unused
pub mass:Planar64,
}
impl std::default::Default for StyleModifiers{
fn default()->Self{
@ -45,12 +37,6 @@ impl std::default::Default for StyleModifiers{
}
}
#[derive(Clone,Debug)]
pub struct FlySettings{
speed:Planar64,
clip:bool,//noclip
}
#[derive(Clone,Debug)]
pub enum JumpCalculation{
Capped,//roblox

@ -824,9 +824,9 @@ impl std::ops::Div<i64> for Planar64Vec3{
///[-1.0,1.0] = [-2^32,2^32]
#[derive(Clone,Copy,Hash,Eq,PartialEq)]
pub struct Planar64Mat3{
x_axis:Planar64Vec3,
y_axis:Planar64Vec3,
z_axis:Planar64Vec3,
pub x_axis:Planar64Vec3,
pub y_axis:Planar64Vec3,
pub z_axis:Planar64Vec3,
}
impl Default for Planar64Mat3{
#[inline]

@ -27,6 +27,7 @@ pub trait PolygonIter{
pub trait MapVertexId{
fn map_vertex_id<F:Fn(VertexId)->VertexId>(self,f:F)->Self;
}
#[derive(Clone)]
pub struct PolygonList(Vec<IndexedVertexList>);
impl PolygonList{
pub const fn new(list:Vec<IndexedVertexList>)->Self{
@ -54,6 +55,7 @@ impl MapVertexId for PolygonList{
// }
#[derive(Clone,Copy,Hash,id::Id,PartialEq,Eq)]
pub struct PolygonGroupId(u32);
#[derive(Clone)]
pub enum PolygonGroup{
PolygonList(PolygonList),
//TriangleStrip(TriangleStrip),
@ -89,12 +91,13 @@ impl RenderConfig{
}
}
}
#[derive(Clone)]
pub struct IndexedGraphicsGroup{
//Render pattern material/texture/shader/flat color
pub render:RenderConfigId,
pub groups:Vec<PolygonGroupId>,
}
#[derive(Default)]
#[derive(Clone,Default)]
pub struct IndexedPhysicsGroup{
//the polygons in this group are guaranteed to make a closed convex shape
pub groups:Vec<PolygonGroupId>,
@ -102,6 +105,7 @@ pub struct IndexedPhysicsGroup{
//This is a superset of PhysicsModel and GraphicsModel
#[derive(Clone,Copy,Hash,id::Id,Eq,PartialEq)]
pub struct MeshId(u32);
#[derive(Clone)]
pub struct Mesh{
pub unique_pos:Vec<Planar64Vec3>,//Unit32Vec3
pub unique_normal:Vec<Planar64Vec3>,//Unit32Vec3