Test more realistic values
This commit is contained in:
parent
402a1b8ddf
commit
52d540e210
4 changed files with 24 additions and 22 deletions
|
@ -111,7 +111,7 @@ void own_implementation() {
|
||||||
int miss_shader_index = 0;
|
int miss_shader_index = 0;
|
||||||
int sbt_record_stride = 0;
|
int sbt_record_stride = 0;
|
||||||
float tmin = 0.001;
|
float tmin = 0.001;
|
||||||
float tmax = 1000000000.0;
|
float tmax = 1000000000000.0;
|
||||||
|
|
||||||
vec3 direction = reflect(gl_WorldRayDirectionEXT, normal);
|
vec3 direction = reflect(gl_WorldRayDirectionEXT, normal);
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ void own_implementation() {
|
||||||
int miss_shader_index = 0;
|
int miss_shader_index = 0;
|
||||||
int sbt_record_stride = 0;
|
int sbt_record_stride = 0;
|
||||||
float tmin = 0.001;
|
float tmin = 0.001;
|
||||||
float tmax = 1000000000.0;
|
float tmax = 1000000000000.0;
|
||||||
|
|
||||||
pay_load.depth++;
|
pay_load.depth++;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ void main()
|
||||||
int miss_shader_index = 0;
|
int miss_shader_index = 0;
|
||||||
int sbt_record_stride = 0;
|
int sbt_record_stride = 0;
|
||||||
float tmin = 0.001;
|
float tmin = 0.001;
|
||||||
float tmax = 1000000000.0;
|
float tmax = 1000000000000.0;
|
||||||
|
|
||||||
pay_load.depth = 0;
|
pay_load.depth = 0;
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,7 @@ use engine::prelude::{
|
||||||
*,
|
*,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{FREE_CAMERA_CONTROL, celestial_object::*};
|
||||||
FREE_CAMERA_CONTROL,
|
|
||||||
celestial_object::{
|
|
||||||
CelestialClass, CelestialObject, CelestialObjectSettings, CelestialReference,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
struct PlayerEntity(Entity);
|
struct PlayerEntity(Entity);
|
||||||
|
@ -57,7 +52,7 @@ impl Default for InputSettings {
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
("Thrustmaster T.16000M".to_string(), 1, Input::Axis(1)),
|
("Thrustmaster T.16000M".to_string(), 1, Input::Axis(1)),
|
||||||
(Control::Throttle, false),
|
(Control::Throttle, true),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
("Thrustmaster T.16000M".to_string(), 1, Input::Axis(2)),
|
("Thrustmaster T.16000M".to_string(), 1, Input::Axis(2)),
|
||||||
|
@ -287,26 +282,33 @@ impl Game {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setup_scene(world: &mut World) -> Result<()> {
|
pub fn setup_scene(world: &mut World) -> Result<()> {
|
||||||
// let mut fighter = AssetHandler::create(world).create_entity("fighter_edited")?;
|
world
|
||||||
// fighter.insert_component(FreeSpaceControl::new(
|
.resources
|
||||||
// 0.02,
|
.get_mut::<Scene>()
|
||||||
// FreeSpaceControlSettings::default(),
|
.view_mut()
|
||||||
// ));
|
.camera_mut()
|
||||||
|
.look_at(false);
|
||||||
|
|
||||||
// let player = PlayerEntity(world.add_entity(fighter)?);
|
let mut fighter = AssetHandler::create(world).create_entity("fighter_edited")?;
|
||||||
// world.resources.insert(player);
|
fighter.insert_component(FreeSpaceControl::new(
|
||||||
|
0.02,
|
||||||
|
FreeSpaceControlSettings::default(),
|
||||||
|
));
|
||||||
|
|
||||||
|
let player = PlayerEntity(world.add_entity(fighter)?);
|
||||||
|
world.resources.insert(player);
|
||||||
world.resources.insert(InputSettings::default());
|
world.resources.insert(InputSettings::default());
|
||||||
|
|
||||||
let mut example_sun = CelestialObject::new(world, CelestialClass::Sun, 5, None)?;
|
let mut example_sun = CelestialObject::new(world, CelestialClass::Sun, 5, None)?;
|
||||||
let sun_settings = example_sun.get_component_mut::<CelestialObjectSettings>()?;
|
let sun_settings = example_sun.get_component_mut::<CelestialObjectSettings>()?;
|
||||||
sun_settings.location = vec3(10_000.0, 10_000.0, 0.0);
|
sun_settings.location = vec3(1_000_000_000.0, 1_000_000_000.0, 0.0);
|
||||||
sun_settings.radius = 1_000.0;
|
sun_settings.radius = 696_340_000.0;
|
||||||
let sun_entity = world.add_entity(example_sun)?;
|
let sun_entity = world.add_entity(example_sun)?;
|
||||||
|
|
||||||
let mut example_planet = CelestialObject::new(world, CelestialClass::Solid, 5, sun_entity)?;
|
let mut example_planet = CelestialObject::new(world, CelestialClass::Solid, 5, sun_entity)?;
|
||||||
let sun_settings = example_planet.get_component_mut::<CelestialObjectSettings>()?;
|
let sun_settings = example_planet.get_component_mut::<CelestialObjectSettings>()?;
|
||||||
sun_settings.location.x = 1000.0;
|
sun_settings.location.x = 10_000_000.0;
|
||||||
sun_settings.radius = 250.0;
|
sun_settings.radius = 6_378_000.0;
|
||||||
world.add_entity(example_planet)?;
|
world.add_entity(example_planet)?;
|
||||||
|
|
||||||
let context = world.resources.get::<Context>();
|
let context = world.resources.get::<Context>();
|
||||||
|
|
|
@ -12,7 +12,7 @@ use game::Game;
|
||||||
use game_state::GameState;
|
use game_state::GameState;
|
||||||
use skybox::SkyBox;
|
use skybox::SkyBox;
|
||||||
|
|
||||||
const FREE_CAMERA_CONTROL: bool = true;
|
const FREE_CAMERA_CONTROL: bool = false;
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let mut world_builder = World::builder();
|
let mut world_builder = World::builder();
|
||||||
|
|
Loading…
Reference in a new issue