forked from StrafesNET/strafe-project
hack camera offset
This commit is contained in:
parent
ff98a95bdb
commit
f34d34564e
@ -974,7 +974,7 @@ pub struct PhysicsState{
|
|||||||
//input_state
|
//input_state
|
||||||
input_state:InputState,
|
input_state:InputState,
|
||||||
//style
|
//style
|
||||||
style:StyleModifiers,//mode style with custom style updates applied
|
pub style:StyleModifiers,//mode style with custom style updates applied
|
||||||
//gameplay_state
|
//gameplay_state
|
||||||
mode_state:ModeState,
|
mode_state:ModeState,
|
||||||
move_state:MoveState,
|
move_state:MoveState,
|
||||||
@ -1076,7 +1076,7 @@ impl PhysicsState{
|
|||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct PhysicsContext{
|
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.
|
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
|
//the physics consumes the generic PhysicsInstruction, but can only emit the more narrow PhysicsInternalInstruction
|
||||||
|
@ -301,7 +301,7 @@ impl PlayBacker{
|
|||||||
// let ay_epsilon=f32::from_bits(angles.y.to_bits()&!((1<<23)-1)|1);
|
// let ay_epsilon=f32::from_bits(angles.y.to_bits()&!((1<<23)-1)|1);
|
||||||
let body=crate::physics::Body{
|
let body=crate::physics::Body{
|
||||||
time,
|
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),
|
velocity:strafesnet_common::integer::Planar64Vec3::new(v),
|
||||||
acceleration:strafesnet_common::integer::Planar64Vec3::new(a),
|
acceleration:strafesnet_common::integer::Planar64Vec3::new(a),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user