Compare commits
9 Commits
prototype-
...
updatable
Author | SHA1 | Date | |
---|---|---|---|
165a59be6d | |||
2c926efa0d | |||
74acfbf206 | |||
a9f3e61f2b | |||
db142d125b | |||
ef922135e6 | |||
9aec0e1b52 | |||
b065f83faf | |||
39b202176f |
7
Cargo.lock
generated
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
|
||||
|
Reference in New Issue
Block a user