Compare commits
2 commits
7724808d14
...
9b1703fa50
Author | SHA1 | Date | |
---|---|---|---|
9b1703fa50 | |||
2e268510a7 |
3 changed files with 10 additions and 12 deletions
|
@ -18,7 +18,7 @@ fn main() -> Result<()> {
|
|||
world_builder.resources.insert(GameState::default());
|
||||
|
||||
// let dir = Path::new("C:/Users/M.Huebner/Downloads/Space Skybox Generator/Export");
|
||||
let dir = Path::new("/home/michaelh/Sync/skybox");
|
||||
let dir = Path::new("/home/michaelh/Sync/skybox_labeled");
|
||||
SkyBox::new(
|
||||
&mut world_builder,
|
||||
[
|
||||
|
@ -47,8 +47,7 @@ fn main() -> Result<()> {
|
|||
enum GameState {
|
||||
#[default]
|
||||
Startup,
|
||||
Loading,
|
||||
Menu,
|
||||
|
||||
Game(Game),
|
||||
}
|
||||
|
||||
|
@ -58,8 +57,6 @@ impl GameState {
|
|||
|
||||
match me {
|
||||
GameState::Startup => *me = GameState::Game(Game { start: world.now() }),
|
||||
GameState::Loading => (),
|
||||
GameState::Menu => (),
|
||||
GameState::Game(game) => game.update(world)?,
|
||||
}
|
||||
|
||||
|
@ -71,8 +68,6 @@ impl EventConsumer for GameState {
|
|||
fn event(&mut self, world: &mut World, event: EngineEvent<'_>) -> Result<()> {
|
||||
match self {
|
||||
GameState::Startup => (),
|
||||
GameState::Loading => (),
|
||||
GameState::Menu => (),
|
||||
GameState::Game(game) => game.event(world, event)?,
|
||||
}
|
||||
|
||||
|
@ -90,10 +85,10 @@ impl Game {
|
|||
let view = world.resources.get_mut::<Scene>().view_mut();
|
||||
let camera = view.camera_mut();
|
||||
|
||||
let diff = now.as_secs_f32() - self.start.as_secs_f32();
|
||||
camera.set_eye_dir(
|
||||
Matrix3::from_angle_z(Deg((now.as_secs_f32() - self.start.as_secs_f32())
|
||||
* 36.0
|
||||
* 2.0))
|
||||
Matrix3::from_angle_z(Deg(diff * 36.0))
|
||||
* Matrix3::from_angle_x(Deg(diff.sin() * 45.0))
|
||||
* Vector3::unit_y(),
|
||||
);
|
||||
view.update_buffer()?;
|
||||
|
@ -101,7 +96,7 @@ impl Game {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn event(&mut self, world: &mut World, event: EngineEvent<'_>) -> Result<()> {
|
||||
fn event(&mut self, _world: &mut World, _event: EngineEvent<'_>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ fn find_shader_files(path: impl AsRef<Path>) -> Vec<String> {
|
|||
}
|
||||
|
||||
fn compile_shader(shader_files: &[String]) {
|
||||
println!("cargo:rerun-if-changed=shader/skybox.vert");
|
||||
println!("cargo:rerun-if-changed=shader/skybox.frag");
|
||||
|
||||
Command::new("glslangValidator")
|
||||
.arg("--help")
|
||||
.output()
|
||||
|
|
|
@ -19,7 +19,7 @@ void main()
|
|||
out_uvw = in_position;
|
||||
|
||||
// Convert cubemap coordinates into Vulkan coordinate space
|
||||
out_uvw.xy *= -1.0;
|
||||
// out_uvw.xy *= -1.0;
|
||||
|
||||
// Remove translation from view matrix
|
||||
mat4 view_mat = mat4(mat3(globals.view));
|
||||
|
|
Loading…
Reference in a new issue