mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix warnings all around voxygen
This commit is contained in:
@ -4,7 +4,7 @@ use crossbeam::{
|
|||||||
atomic::AtomicCell,
|
atomic::AtomicCell,
|
||||||
channel::{unbounded, Sender},
|
channel::{unbounded, Sender},
|
||||||
queue::SegQueue,
|
queue::SegQueue,
|
||||||
sync::{ShardedLock, WaitGroup},
|
sync::ShardedLock,
|
||||||
};
|
};
|
||||||
use rodio::{Decoder, Device, Sink, SpatialSink};
|
use rodio::{Decoder, Device, Sink, SpatialSink};
|
||||||
use std::sync::{Arc, Condvar, Mutex};
|
use std::sync::{Arc, Condvar, Mutex};
|
||||||
@ -220,7 +220,7 @@ impl Jukebox {
|
|||||||
|
|
||||||
// TODO: The `update` function should associate with `conrod` to visualise the audio playlist
|
// TODO: The `update` function should associate with `conrod` to visualise the audio playlist
|
||||||
// and settings.
|
// and settings.
|
||||||
pub(crate) fn update(&mut self, msg: AudioPlayerMsg) {
|
pub(crate) fn update(&mut self, _msg: AudioPlayerMsg) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ use log::error;
|
|||||||
use scene::Scene;
|
use scene::Scene;
|
||||||
use std::{cell::RefCell, rc::Rc, time::Duration};
|
use std::{cell::RefCell, rc::Rc, time::Duration};
|
||||||
use ui::CharSelectionUi;
|
use ui::CharSelectionUi;
|
||||||
use vek::*;
|
|
||||||
|
|
||||||
pub struct CharSelectionState {
|
pub struct CharSelectionState {
|
||||||
char_selection_ui: CharSelectionUi,
|
char_selection_ui: CharSelectionUi,
|
||||||
@ -31,14 +30,6 @@ impl CharSelectionState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Background colour
|
|
||||||
const BG_COLOR: Rgba<f32> = Rgba {
|
|
||||||
r: 0.0,
|
|
||||||
g: 0.3,
|
|
||||||
b: 1.0,
|
|
||||||
a: 1.0,
|
|
||||||
};
|
|
||||||
|
|
||||||
impl PlayState for CharSelectionState {
|
impl PlayState for CharSelectionState {
|
||||||
fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult {
|
fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult {
|
||||||
// Set up an fps clock.
|
// Set up an fps clock.
|
||||||
@ -61,7 +52,7 @@ impl PlayState for CharSelectionState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global_state.window.renderer_mut().clear(BG_COLOR);
|
global_state.window.renderer_mut().clear();
|
||||||
|
|
||||||
// Maintain the UI.
|
// Maintain the UI.
|
||||||
for event in self
|
for event in self
|
||||||
|
@ -7,7 +7,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
window::Window,
|
window::Window,
|
||||||
};
|
};
|
||||||
use common::comp::{humanoid, item::Weapon, quadruped, quadruped_medium};
|
use common::comp::{humanoid, item::Weapon};
|
||||||
use conrod_core::{
|
use conrod_core::{
|
||||||
color,
|
color,
|
||||||
color::TRANSPARENT,
|
color::TRANSPARENT,
|
||||||
@ -1038,7 +1038,7 @@ impl CharSelectionUi {
|
|||||||
.font_id(self.fonts.metamorph)
|
.font_id(self.fonts.metamorph)
|
||||||
.color(TEXT_COLOR_2)
|
.color(TEXT_COLOR_2)
|
||||||
.set(self.ids.beard_text, ui_widgets);
|
.set(self.ids.beard_text, ui_widgets);
|
||||||
if let Some(val) = ImageSlider::continuous(
|
if let Some(_val) = ImageSlider::continuous(
|
||||||
5.0,
|
5.0,
|
||||||
0.0,
|
0.0,
|
||||||
10.0,
|
10.0,
|
||||||
|
@ -10,7 +10,6 @@ use log::warn;
|
|||||||
use start_singleplayer::StartSingleplayerState;
|
use start_singleplayer::StartSingleplayerState;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use ui::{Event as MainMenuEvent, MainMenuUi};
|
use ui::{Event as MainMenuEvent, MainMenuUi};
|
||||||
use vek::*;
|
|
||||||
|
|
||||||
pub struct MainMenuState {
|
pub struct MainMenuState {
|
||||||
main_menu_ui: MainMenuUi,
|
main_menu_ui: MainMenuUi,
|
||||||
@ -27,14 +26,6 @@ impl MainMenuState {
|
|||||||
|
|
||||||
const DEFAULT_PORT: u16 = 59003;
|
const DEFAULT_PORT: u16 = 59003;
|
||||||
|
|
||||||
// Background colour
|
|
||||||
const BG_COLOR: Rgba<f32> = Rgba {
|
|
||||||
r: 0.0,
|
|
||||||
g: 0.3,
|
|
||||||
b: 1.0,
|
|
||||||
a: 1.0,
|
|
||||||
};
|
|
||||||
|
|
||||||
impl PlayState for MainMenuState {
|
impl PlayState for MainMenuState {
|
||||||
fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult {
|
fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult {
|
||||||
// Set up an fps clock.
|
// Set up an fps clock.
|
||||||
@ -57,7 +48,7 @@ impl PlayState for MainMenuState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global_state.window.renderer_mut().clear(BG_COLOR);
|
global_state.window.renderer_mut().clear();
|
||||||
|
|
||||||
// Poll client creation.
|
// Poll client creation.
|
||||||
match client_init.as_ref().and_then(|init| init.poll()) {
|
match client_init.as_ref().and_then(|init| init.poll()) {
|
||||||
|
@ -8,16 +8,20 @@ use log::warn;
|
|||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
pub struct StartSingleplayerState {
|
pub struct StartSingleplayerState {
|
||||||
singleplayer: Singleplayer,
|
// Necessary to keep singleplayer working
|
||||||
|
_singleplayer: Singleplayer,
|
||||||
sock: SocketAddr,
|
sock: SocketAddr,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StartSingleplayerState {
|
impl StartSingleplayerState {
|
||||||
/// Create a new `MainMenuState`.
|
/// Create a new `MainMenuState`.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let (singleplayer, sock) = Singleplayer::new(None); // TODO: Make client and server use the same thread pool
|
let (_singleplayer, sock) = Singleplayer::new(None); // TODO: Make client and server use the same thread pool
|
||||||
|
|
||||||
Self { singleplayer, sock }
|
Self {
|
||||||
|
_singleplayer,
|
||||||
|
sock,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,16 +58,6 @@ impl<V: BaseVol<Vox = Block> + ReadVol + Debug, S: VolSize + Clone> Meshable for
|
|||||||
|
|
||||||
// Create mesh polygons
|
// Create mesh polygons
|
||||||
if let Some(col) = self.get(pos).ok().and_then(|vox| vox.get_color()) {
|
if let Some(col) = self.get(pos).ok().and_then(|vox| vox.get_color()) {
|
||||||
let avg_light = neighbour_light
|
|
||||||
.iter()
|
|
||||||
.map(|row| row.iter())
|
|
||||||
.flatten()
|
|
||||||
.map(|col| col.iter())
|
|
||||||
.flatten()
|
|
||||||
.fold(0.0, |a, x| a + x)
|
|
||||||
/ 27.0;
|
|
||||||
let light = avg_light;
|
|
||||||
|
|
||||||
let col = col.map(|e| e as f32 / 255.0);
|
let col = col.map(|e| e as f32 / 255.0);
|
||||||
|
|
||||||
let offs = (pos - range.min * Vec3::new(1, 1, 0)).map(|e| e as f32)
|
let offs = (pos - range.min * Vec3::new(1, 1, 0)).map(|e| e as f32)
|
||||||
@ -80,12 +70,7 @@ impl<V: BaseVol<Vox = Block> + ReadVol + Debug, S: VolSize + Clone> Meshable for
|
|||||||
offs,
|
offs,
|
||||||
col,
|
col,
|
||||||
|pos, norm, col, ao, light| {
|
|pos, norm, col, ao, light| {
|
||||||
TerrainVertex::new(
|
TerrainVertex::new(pos, norm, col, light * ao)
|
||||||
pos,
|
|
||||||
norm,
|
|
||||||
Lerp::lerp(Rgb::zero(), col, 1.0),
|
|
||||||
light * ao,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
&neighbour_light,
|
&neighbour_light,
|
||||||
|
@ -15,12 +15,10 @@ fn get_ao_quad<V: ReadVol>(
|
|||||||
pos: Vec3<i32>,
|
pos: Vec3<i32>,
|
||||||
shift: Vec3<i32>,
|
shift: Vec3<i32>,
|
||||||
dirs: &[Vec3<i32>],
|
dirs: &[Vec3<i32>],
|
||||||
corners: &[[usize; 3]; 4],
|
|
||||||
darknesses: &[[[f32; 3]; 3]; 3],
|
darknesses: &[[[f32; 3]; 3]; 3],
|
||||||
) -> Vec4<(f32, f32)> {
|
) -> Vec4<(f32, f32)> {
|
||||||
dirs.windows(2)
|
dirs.windows(2)
|
||||||
.enumerate()
|
.map(|offs| {
|
||||||
.map(|(i, offs)| {
|
|
||||||
let (s1, s2) = (
|
let (s1, s2) = (
|
||||||
vol.get(pos + shift + offs[0])
|
vol.get(pos + shift + offs[0])
|
||||||
.map(|v| !v.is_empty())
|
.map(|v| !v.is_empty())
|
||||||
@ -30,8 +28,6 @@ fn get_ao_quad<V: ReadVol>(
|
|||||||
.unwrap_or(false),
|
.unwrap_or(false),
|
||||||
);
|
);
|
||||||
|
|
||||||
let darkness = darknesses[corners[i][0]][corners[i][1]][corners[i][2]];
|
|
||||||
|
|
||||||
let darkness = darknesses
|
let darkness = darknesses
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| x.iter().map(|y| y.iter()))
|
.map(|x| x.iter().map(|y| y.iter()))
|
||||||
@ -70,9 +66,6 @@ fn create_quad<P: Pipeline, F: Fn(Vec3<f32>, Vec3<f32>, Rgb<f32>, f32, f32) -> P
|
|||||||
darkness_ao: Vec4<(f32, f32)>,
|
darkness_ao: Vec4<(f32, f32)>,
|
||||||
vcons: &F,
|
vcons: &F,
|
||||||
) -> Quad<P> {
|
) -> Quad<P> {
|
||||||
let ao_scale = 0.95;
|
|
||||||
let dark = col * (1.0 - ao_scale);
|
|
||||||
|
|
||||||
let darkness = darkness_ao.map(|e| e.0);
|
let darkness = darkness_ao.map(|e| e.0);
|
||||||
let ao = darkness_ao.map(|e| e.1);
|
let ao = darkness_ao.map(|e| e.1);
|
||||||
|
|
||||||
@ -123,14 +116,7 @@ pub fn push_vox_verts<
|
|||||||
Vec3::unit_y(),
|
Vec3::unit_y(),
|
||||||
-Vec3::unit_x(),
|
-Vec3::unit_x(),
|
||||||
col,
|
col,
|
||||||
get_ao_quad(
|
get_ao_quad(vol, pos, -Vec3::unit_x(), &[-z, -y, z, y, -z], darknesses),
|
||||||
vol,
|
|
||||||
pos,
|
|
||||||
-Vec3::unit_x(),
|
|
||||||
&[-z, -y, z, y, -z],
|
|
||||||
&[[0; 3]; 4],
|
|
||||||
darknesses,
|
|
||||||
),
|
|
||||||
&vcons,
|
&vcons,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -146,14 +132,7 @@ pub fn push_vox_verts<
|
|||||||
Vec3::unit_z(),
|
Vec3::unit_z(),
|
||||||
Vec3::unit_x(),
|
Vec3::unit_x(),
|
||||||
col,
|
col,
|
||||||
get_ao_quad(
|
get_ao_quad(vol, pos, Vec3::unit_x(), &[-y, -z, y, z, -y], darknesses),
|
||||||
vol,
|
|
||||||
pos,
|
|
||||||
Vec3::unit_x(),
|
|
||||||
&[-y, -z, y, z, -y],
|
|
||||||
&[[0; 3]; 4],
|
|
||||||
darknesses,
|
|
||||||
),
|
|
||||||
&vcons,
|
&vcons,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -169,14 +148,7 @@ pub fn push_vox_verts<
|
|||||||
Vec3::unit_z(),
|
Vec3::unit_z(),
|
||||||
-Vec3::unit_y(),
|
-Vec3::unit_y(),
|
||||||
col,
|
col,
|
||||||
get_ao_quad(
|
get_ao_quad(vol, pos, -Vec3::unit_y(), &[-x, -z, x, z, -x], darknesses),
|
||||||
vol,
|
|
||||||
pos,
|
|
||||||
-Vec3::unit_y(),
|
|
||||||
&[-x, -z, x, z, -x],
|
|
||||||
&[[0; 3]; 4],
|
|
||||||
darknesses,
|
|
||||||
),
|
|
||||||
&vcons,
|
&vcons,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -192,14 +164,7 @@ pub fn push_vox_verts<
|
|||||||
Vec3::unit_x(),
|
Vec3::unit_x(),
|
||||||
Vec3::unit_y(),
|
Vec3::unit_y(),
|
||||||
col,
|
col,
|
||||||
get_ao_quad(
|
get_ao_quad(vol, pos, Vec3::unit_y(), &[-z, -x, z, x, -z], darknesses),
|
||||||
vol,
|
|
||||||
pos,
|
|
||||||
Vec3::unit_y(),
|
|
||||||
&[-z, -x, z, x, -z],
|
|
||||||
&[[0; 3]; 4],
|
|
||||||
darknesses,
|
|
||||||
),
|
|
||||||
&vcons,
|
&vcons,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -215,14 +180,7 @@ pub fn push_vox_verts<
|
|||||||
Vec3::unit_x(),
|
Vec3::unit_x(),
|
||||||
-Vec3::unit_z(),
|
-Vec3::unit_z(),
|
||||||
col,
|
col,
|
||||||
get_ao_quad(
|
get_ao_quad(vol, pos, -Vec3::unit_z(), &[-y, -x, y, x, -y], darknesses),
|
||||||
vol,
|
|
||||||
pos,
|
|
||||||
-Vec3::unit_z(),
|
|
||||||
&[-y, -x, y, x, -y],
|
|
||||||
&[[0; 3]; 4],
|
|
||||||
darknesses,
|
|
||||||
),
|
|
||||||
&vcons,
|
&vcons,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -238,14 +196,7 @@ pub fn push_vox_verts<
|
|||||||
Vec3::unit_y(),
|
Vec3::unit_y(),
|
||||||
Vec3::unit_z(),
|
Vec3::unit_z(),
|
||||||
col,
|
col,
|
||||||
get_ao_quad(
|
get_ao_quad(vol, pos, Vec3::unit_z(), &[-x, -y, x, y, -x], darknesses),
|
||||||
vol,
|
|
||||||
pos,
|
|
||||||
Vec3::unit_z(),
|
|
||||||
&[-x, -y, x, y, -x],
|
|
||||||
&[[0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]],
|
|
||||||
darknesses,
|
|
||||||
),
|
|
||||||
&vcons,
|
&vcons,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -228,8 +228,7 @@ impl Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Queue the clearing of the color and depth targets ready for a new frame to be rendered.
|
/// Queue the clearing of the color and depth targets ready for a new frame to be rendered.
|
||||||
/// TODO: Make a version of this that doesn't clear the colour target for speed.
|
pub fn clear(&mut self) {
|
||||||
pub fn clear(&mut self, col: Rgba<f32>) {
|
|
||||||
self.encoder.clear_depth(&self.tgt_depth_view, 1.0);
|
self.encoder.clear_depth(&self.tgt_depth_view, 1.0);
|
||||||
self.encoder.clear_depth(&self.win_depth_view, 1.0);
|
self.encoder.clear_depth(&self.win_depth_view, 1.0);
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ use common::{
|
|||||||
assets,
|
assets,
|
||||||
comp::{self, humanoid, item::Weapon, quadruped, quadruped_medium, Body},
|
comp::{self, humanoid, item::Weapon, quadruped, quadruped_medium, Body},
|
||||||
figure::Segment,
|
figure::Segment,
|
||||||
state::DeltaTime,
|
|
||||||
terrain::TerrainChunkSize,
|
terrain::TerrainChunkSize,
|
||||||
vol::VolSize,
|
vol::VolSize,
|
||||||
};
|
};
|
||||||
@ -200,13 +199,6 @@ impl FigureModelCache {
|
|||||||
"figure/head/head_danari_female.vox",
|
"figure/head/head_danari_female.vox",
|
||||||
Vec3::new(-9.0, -5.5, -2.5),
|
Vec3::new(-9.0, -5.5, -2.5),
|
||||||
),
|
),
|
||||||
_ => {
|
|
||||||
warn!("Invalid race, body_type combination for figure head");
|
|
||||||
(
|
|
||||||
"figure/head/head_human_male.vox",
|
|
||||||
Vec3::new(-7.0, -5.5, -9.25),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
Self::load_mesh(name, offset)
|
Self::load_mesh(name, offset)
|
||||||
}
|
}
|
||||||
@ -306,7 +298,6 @@ impl FigureModelCache {
|
|||||||
Weapon::Sword => ("weapon/sword/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)),
|
Weapon::Sword => ("weapon/sword/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)),
|
||||||
Weapon::Hammer => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)),
|
Weapon::Hammer => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)),
|
||||||
Weapon::Axe => ("weapon/axe/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)),
|
Weapon::Axe => ("weapon/axe/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)),
|
||||||
Weapon::Sword => ("weapon/sword/wood_2h.vox", Vec3::new(-1.5, -6.5, -4.0)),
|
|
||||||
Weapon::Daggers => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)),
|
Weapon::Daggers => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)),
|
||||||
Weapon::SwordShield => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -2.0)),
|
Weapon::SwordShield => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -2.0)),
|
||||||
Weapon::Bow => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)),
|
Weapon::Bow => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)),
|
||||||
|
@ -41,7 +41,7 @@ pub struct Scene {
|
|||||||
|
|
||||||
impl Scene {
|
impl Scene {
|
||||||
/// Create a new `Scene` with default parameters.
|
/// Create a new `Scene` with default parameters.
|
||||||
pub fn new(renderer: &mut Renderer, client: &Client) -> Self {
|
pub fn new(renderer: &mut Renderer) -> Self {
|
||||||
let resolution = renderer.get_resolution().map(|e| e as f32);
|
let resolution = renderer.get_resolution().map(|e| e as f32);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
@ -9,7 +9,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use client::{self, Client};
|
use client::{self, Client};
|
||||||
use common::{
|
use common::{
|
||||||
clock::Clock, comp, comp::Pos, msg::ClientState, ray::Ray, terrain::block::Block, vol::ReadVol,
|
clock::Clock, comp, comp::Pos, msg::ClientState, terrain::block::Block, vol::ReadVol,
|
||||||
};
|
};
|
||||||
use log::{error, warn};
|
use log::{error, warn};
|
||||||
use std::{cell::RefCell, rc::Rc, time::Duration};
|
use std::{cell::RefCell, rc::Rc, time::Duration};
|
||||||
@ -28,7 +28,7 @@ impl SessionState {
|
|||||||
/// Create a new `SessionState`.
|
/// Create a new `SessionState`.
|
||||||
pub fn new(window: &mut Window, client: Rc<RefCell<Client>>, _settings: Settings) -> Self {
|
pub fn new(window: &mut Window, client: Rc<RefCell<Client>>, _settings: Settings) -> Self {
|
||||||
// Create a scene for this session. The scene handles visible elements of the game world.
|
// Create a scene for this session. The scene handles visible elements of the game world.
|
||||||
let scene = Scene::new(window.renderer_mut(), &client.borrow());
|
let scene = Scene::new(window.renderer_mut());
|
||||||
Self {
|
Self {
|
||||||
scene,
|
scene,
|
||||||
client,
|
client,
|
||||||
@ -39,14 +39,6 @@ impl SessionState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Background colour
|
|
||||||
const BG_COLOR: Rgba<f32> = Rgba {
|
|
||||||
r: 0.0,
|
|
||||||
g: 0.3,
|
|
||||||
b: 1.0,
|
|
||||||
a: 1.0,
|
|
||||||
};
|
|
||||||
|
|
||||||
impl SessionState {
|
impl SessionState {
|
||||||
/// Tick the session (and the client attached to it).
|
/// Tick the session (and the client attached to it).
|
||||||
fn tick(&mut self, dt: Duration) -> Result<(), Error> {
|
fn tick(&mut self, dt: Duration) -> Result<(), Error> {
|
||||||
@ -72,7 +64,7 @@ impl SessionState {
|
|||||||
/// This method should be called once per frame.
|
/// This method should be called once per frame.
|
||||||
pub fn render(&mut self, renderer: &mut Renderer) {
|
pub fn render(&mut self, renderer: &mut Renderer) {
|
||||||
// Clear the screen
|
// Clear the screen
|
||||||
renderer.clear(BG_COLOR);
|
renderer.clear();
|
||||||
|
|
||||||
// Render the screen using the global renderer
|
// Render the screen using the global renderer
|
||||||
self.scene.render(renderer, &mut self.client.borrow_mut());
|
self.scene.render(renderer, &mut self.client.borrow_mut());
|
||||||
@ -120,8 +112,7 @@ impl PlayState for SessionState {
|
|||||||
.get(client.entity())
|
.get(client.entity())
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
let (view_mat, _, cam_pos) =
|
let cam_pos = self.scene.camera().compute_dependents(&client).2;
|
||||||
self.scene.camera().compute_dependents(&client);
|
|
||||||
let cam_dir =
|
let cam_dir =
|
||||||
(self.scene.camera().get_focus_pos() - cam_pos).normalized();
|
(self.scene.camera().get_focus_pos() - cam_pos).normalized();
|
||||||
|
|
||||||
@ -158,8 +149,7 @@ impl PlayState for SessionState {
|
|||||||
.get(client.entity())
|
.get(client.entity())
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
let (view_mat, _, cam_pos) =
|
let cam_pos = self.scene.camera().compute_dependents(&client).2;
|
||||||
self.scene.camera().compute_dependents(&client);
|
|
||||||
let cam_dir =
|
let cam_dir =
|
||||||
(self.scene.camera().get_focus_pos() - cam_pos).normalized();
|
(self.scene.camera().get_focus_pos() - cam_pos).normalized();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user