only use _slope postfix at js lib interface
This commit is contained in:
@@ -207,7 +207,7 @@ impl PlaybackState{
|
||||
v0::EventType::Setting=>self.push_setting(&bot.timelines().setting_events[event_index].event),
|
||||
}
|
||||
}
|
||||
pub fn get_fov_slope_y(&self)->f64{
|
||||
pub fn get_fov_y(&self)->f64{
|
||||
let zoom_enabled=self.game_controls.contains(v0::GameControls::Zoom);
|
||||
if zoom_enabled{self.fov_y*0.2}else{self.fov_y}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ impl PlaybackState{
|
||||
if self.absolute_sensitivity_enabled{
|
||||
(self.sens_x,self.sens_x*self.vertical_sensitivity_multipler)
|
||||
}else{
|
||||
let sens_x=self.sens_x*self.get_fov_slope_y()/128.0;
|
||||
let sens_x=self.sens_x*self.get_fov_y()/128.0;
|
||||
(sens_x,sens_x*self.vertical_sensitivity_multipler)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ impl<'a> PlayerWorker<'a>{
|
||||
self.graphics_thread.render(&self.surface,pos,angles);
|
||||
},
|
||||
Instruction::Resize(physical_size)=>{
|
||||
let fov_y=self.playback_head.state().get_fov_slope_y();
|
||||
let fov_y=self.playback_head.state().get_fov_y();
|
||||
let fov_x=fov_y*physical_size.width as f64/physical_size.height as f64;
|
||||
self.graphics_thread.resize(&self.surface,glam::uvec2(physical_size.width,physical_size.height),glam::vec2(fov_x as f32,fov_y as f32));
|
||||
},
|
||||
|
||||
@@ -48,8 +48,8 @@ impl Graphics{
|
||||
self.graphics.render(&self.surface,pos,angles);
|
||||
}
|
||||
#[wasm_bindgen]
|
||||
pub fn resize(&mut self,width:u32,height:u32,fov_x:f32,fov_y:f32){
|
||||
self.graphics.resize(&self.surface,[width,height].into(),[fov_x as f32,fov_y as f32].into());
|
||||
pub fn resize(&mut self,width:u32,height:u32,fov_slope_x:f32,fov_slope_y:f32){
|
||||
self.graphics.resize(&self.surface,[width,height].into(),[fov_slope_x as f32,fov_slope_y as f32].into());
|
||||
}
|
||||
#[wasm_bindgen]
|
||||
pub fn change_map(&mut self,map:&CompleteMap){
|
||||
@@ -163,6 +163,6 @@ impl PlaybackHead{
|
||||
}
|
||||
#[wasm_bindgen]
|
||||
pub fn get_fov_slope_y(&self)->f64{
|
||||
self.head.state().get_fov_slope_y()
|
||||
self.head.state().get_fov_y()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user