Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3594268cf6 | |||
| fac0383bb1 | |||
| 2e8cdf968c | |||
| dd0ac7cc7e |
61
Cargo.lock
generated
61
Cargo.lock
generated
@@ -538,6 +538,12 @@ dependencies = [
|
||||
"simd-adler32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.27"
|
||||
@@ -617,6 +623,15 @@ dependencies = [
|
||||
"waker-fn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fxhash"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
@@ -762,6 +777,16 @@ version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||
|
||||
[[package]]
|
||||
name = "include_wgsl"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57ac28436974a64aef47cbf8453e8f1a558b779177fe50b7e3c3774e2cb9ba47"
|
||||
dependencies = [
|
||||
"naga 0.7.3",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.3"
|
||||
@@ -1013,6 +1038,24 @@ dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "806f448a7ce662ca79ef5484ef8f451a9b7c51b8166c95f5a667228b3825a6ca"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"bitflags 1.3.2",
|
||||
"codespan-reporting",
|
||||
"fxhash",
|
||||
"hexf-parse",
|
||||
"indexmap 1.9.3",
|
||||
"log",
|
||||
"num-traits 0.2.16",
|
||||
"spirv",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.13.0"
|
||||
@@ -1026,6 +1069,7 @@ dependencies = [
|
||||
"indexmap 1.9.3",
|
||||
"log",
|
||||
"num-traits 0.2.16",
|
||||
"petgraph",
|
||||
"rustc-hash",
|
||||
"spirv",
|
||||
"termcolor",
|
||||
@@ -1282,6 +1326,16 @@ version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
|
||||
dependencies = [
|
||||
"fixedbitset",
|
||||
"indexmap 2.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.13"
|
||||
@@ -1696,6 +1750,7 @@ dependencies = [
|
||||
"ddsfile",
|
||||
"env_logger",
|
||||
"glam",
|
||||
"include_wgsl",
|
||||
"lazy-regex",
|
||||
"log",
|
||||
"obj",
|
||||
@@ -2027,7 +2082,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
"log",
|
||||
"naga",
|
||||
"naga 0.13.0",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
@@ -2052,7 +2107,7 @@ dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"codespan-reporting",
|
||||
"log",
|
||||
"naga",
|
||||
"naga 0.13.0",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
@@ -2089,7 +2144,7 @@ dependencies = [
|
||||
"libloading 0.8.0",
|
||||
"log",
|
||||
"metal",
|
||||
"naga",
|
||||
"naga 0.13.0",
|
||||
"objc",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
|
||||
@@ -12,6 +12,7 @@ configparser = "3.0.2"
|
||||
ddsfile = "0.5.1"
|
||||
env_logger = "0.10.0"
|
||||
glam = "0.24.1"
|
||||
include_wgsl = { version = "1.1.1", features = ["spv-out"] }
|
||||
lazy-regex = "3.0.2"
|
||||
log = "0.4.20"
|
||||
obj = "0.10.2"
|
||||
@@ -21,7 +22,7 @@ rbx_binary = "0.7.1"
|
||||
rbx_dom_weak = "2.5.0"
|
||||
rbx_reflection_database = "0.2.7"
|
||||
rbx_xml = "0.13.1"
|
||||
wgpu = "0.17.0"
|
||||
wgpu = { version = "0.17.0", features = ["spirv"] }
|
||||
winit = "0.28.6"
|
||||
|
||||
#[profile.release]
|
||||
|
||||
@@ -556,7 +556,7 @@ impl framework::Example for GlobalState {
|
||||
// Create the render pipeline
|
||||
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: None,
|
||||
source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(include_str!("shader.wgsl"))),
|
||||
source: wgpu::ShaderSource::SpirV(Cow::Borrowed(include_wgsl_to_spv!("shader.wgsl"))),
|
||||
});
|
||||
|
||||
//load textures
|
||||
|
||||
@@ -913,7 +913,7 @@ impl PhysicsState {
|
||||
fn predict_collision_start(&self,time:TIME,time_limit:TIME,model_id:u32) -> Option<TimedInstruction<PhysicsInstruction>> {
|
||||
let mesh0=self.mesh();
|
||||
let mesh1=self.models.get(model_id as usize).unwrap().mesh();
|
||||
let (p,v,a,time)=(self.body.position,self.body.velocity,self.body.acceleration,self.body.time);
|
||||
let (p,v,a,body_time)=(self.body.position,self.body.velocity,self.body.acceleration,self.body.time);
|
||||
//find best t
|
||||
let mut best_time=time_limit;
|
||||
let mut best_face:Option<TreyMeshFace>=None;
|
||||
@@ -922,7 +922,7 @@ impl PhysicsState {
|
||||
//must collide now or in the future
|
||||
//must beat the current soonest collision time
|
||||
//must be moving towards surface
|
||||
let t_time=time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
if time<=t_time&&t_time<best_time&&0f32<v.x+a.x*t{
|
||||
let dp=self.body.extrapolated_position(t_time)-p;
|
||||
//faces must be overlapping
|
||||
@@ -938,7 +938,7 @@ impl PhysicsState {
|
||||
//must collide now or in the future
|
||||
//must beat the current soonest collision time
|
||||
//must be moving towards surface
|
||||
let t_time=time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
if time<=t_time&&t_time<best_time&&v.x+a.x*t<0f32{
|
||||
let dp=self.body.extrapolated_position(t_time)-p;
|
||||
//faces must be overlapping
|
||||
@@ -955,7 +955,7 @@ impl PhysicsState {
|
||||
//must collide now or in the future
|
||||
//must beat the current soonest collision time
|
||||
//must be moving towards surface
|
||||
let t_time=time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
if time<=t_time&&t_time<best_time&&0f32<v.y+a.y*t{
|
||||
let dp=self.body.extrapolated_position(t_time)-p;
|
||||
//faces must be overlapping
|
||||
@@ -971,7 +971,7 @@ impl PhysicsState {
|
||||
//must collide now or in the future
|
||||
//must beat the current soonest collision time
|
||||
//must be moving towards surface
|
||||
let t_time=time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
if time<=t_time&&t_time<best_time&&v.y+a.y*t<0f32{
|
||||
let dp=self.body.extrapolated_position(t_time)-p;
|
||||
//faces must be overlapping
|
||||
@@ -988,7 +988,7 @@ impl PhysicsState {
|
||||
//must collide now or in the future
|
||||
//must beat the current soonest collision time
|
||||
//must be moving towards surface
|
||||
let t_time=time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
if time<=t_time&&t_time<best_time&&0f32<v.z+a.z*t{
|
||||
let dp=self.body.extrapolated_position(t_time)-p;
|
||||
//faces must be overlapping
|
||||
@@ -1004,7 +1004,7 @@ impl PhysicsState {
|
||||
//must collide now or in the future
|
||||
//must beat the current soonest collision time
|
||||
//must be moving towards surface
|
||||
let t_time=time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME;
|
||||
if time<=t_time&&t_time<best_time&&v.z+a.z*t<0f32{
|
||||
let dp=self.body.extrapolated_position(t_time)-p;
|
||||
//faces must be overlapping
|
||||
|
||||
@@ -79,7 +79,7 @@ fn test_worker() {
|
||||
);
|
||||
|
||||
// Send tasks to the worker
|
||||
for i in 0..5 {
|
||||
for _ in 0..5 {
|
||||
let task = crate::instruction::TimedInstruction{
|
||||
time:0,
|
||||
instruction:crate::physics::PhysicsInstruction::StrafeTick,
|
||||
|
||||
Reference in New Issue
Block a user