From f34d34564e992dbae668c500ef844e81b9408312 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Fri, 3 Jan 2025 22:11:29 -0800
Subject: [PATCH] hack camera offset

---
 strafe-client/src/physics.rs        | 4 ++--
 strafe-client/src/physics_worker.rs | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/strafe-client/src/physics.rs b/strafe-client/src/physics.rs
index d9be5ddbc..eade11cbc 100644
--- a/strafe-client/src/physics.rs
+++ b/strafe-client/src/physics.rs
@@ -974,7 +974,7 @@ pub struct PhysicsState{
 	//input_state
 	input_state:InputState,
 	//style
-	style:StyleModifiers,//mode style with custom style updates applied
+	pub style:StyleModifiers,//mode style with custom style updates applied
 	//gameplay_state
 	mode_state:ModeState,
 	move_state:MoveState,
@@ -1076,7 +1076,7 @@ impl PhysicsState{
 
 #[derive(Default)]
 pub struct PhysicsContext{
-	state:PhysicsState,//this captures the entire state of the physics.
+	pub state:PhysicsState,//this captures the entire state of the physics.
 	data:PhysicsData,//data currently loaded into memory which is needded for physics to run, but is not part of the state.
 }
 //the physics consumes the generic PhysicsInstruction, but can only emit the more narrow PhysicsInternalInstruction
diff --git a/strafe-client/src/physics_worker.rs b/strafe-client/src/physics_worker.rs
index 99940fb6c..6b165a092 100644
--- a/strafe-client/src/physics_worker.rs
+++ b/strafe-client/src/physics_worker.rs
@@ -301,7 +301,7 @@ impl PlayBacker{
 		// let ay_epsilon=f32::from_bits(angles.y.to_bits()&!((1<<23)-1)|1);
 		let body=crate::physics::Body{
 			time,
-			position:strafesnet_common::integer::Planar64Vec3::new(p),
+			position:strafesnet_common::integer::Planar64Vec3::new(p)+self.physics.state.style.camera_offset,
 			velocity:strafesnet_common::integer::Planar64Vec3::new(v),
 			acceleration:strafesnet_common::integer::Planar64Vec3::new(a),
 		};