From 586bf8ce894385b94d6bb9471b3d04ceba6b0005 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 16 Oct 2023 18:57:37 -0700 Subject: [PATCH] unpub a bunch of physics stuff --- src/main.rs | 3 ++- src/physics.rs | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 47e87f2..cb152f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -931,7 +931,7 @@ impl framework::Example for GlobalState { let screen_size=glam::uvec2(config.width,config.height); let camera=GraphicsCamera::new(screen_size,user_settings.calculate_fov(1.0,&screen_size).as_vec2()); - let camera_uniforms = camera.to_uniform_data(physics.output().adjust_mouse(&physics.next_mouse)); + let camera_uniforms = camera.to_uniform_data(physics.output().adjust_mouse(&physics::MouseState::default())); let camera_buf = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { label: Some("Camera"), contents: bytemuck::cast_slice(&camera_uniforms), @@ -1063,6 +1063,7 @@ impl framework::Example for GlobalState { self.graphics.clear(); let mut physics=physics::PhysicsState::default(); + //physics.spawn() physics.game.stage_id=0; physics.spawn_point=spawn_point; physics.process_instruction(instruction::TimedInstruction{ diff --git a/src/physics.rs b/src/physics.rs index 05f7e5a..df07dc6 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -286,22 +286,22 @@ enum MoveState{ pub struct PhysicsState{ pub time:Time, - pub body:Body, - pub world:WorldState,//currently there is only one state the world can be in + body:Body, + world:WorldState,//currently there is only one state the world can be in pub game:GameMechanicsState, - pub style:StyleModifiers, + style:StyleModifiers, touching:TouchingState, //camera must exist in state because wormholes modify the camera, also camera punch - pub camera:PhysicsCamera, - pub next_mouse:MouseState,//Where is the mouse headed next - pub controls:u32, - pub move_state:MoveState, + camera:PhysicsCamera, + next_mouse:MouseState,//Where is the mouse headed next + controls:u32, + move_state:MoveState, //all models - pub models:Vec, - pub bvh:crate::bvh::BvhNode, + models:Vec, + bvh:crate::bvh::BvhNode, - pub modes:Vec, - pub mode_from_mode_id:std::collections::HashMap::, + modes:Vec, + mode_from_mode_id:std::collections::HashMap::, //the spawn point is where you spawn when you load into the map. //This is not the same as Reset which teleports you to Spawn0 pub spawn_point:Planar64Vec3,