Tiled Forward Rendering #5
|
@ -1,6 +1,6 @@
|
||||||
use std::ptr::NonNull;
|
use std::{cell::Ref, ptr::NonNull};
|
||||||
|
|
||||||
use lyra_engine::{assets::gltf::Gltf, ecs::{system::{BatchedSystem, Criteria, CriteriaSchedule, IntoSystem}, Component, World}, game::Game, input::{Action, ActionHandler, ActionKind, ActionMapping, ActionMappingId, ActionSource, InputActionPlugin, KeyCode, LayoutId, MouseAxis, MouseInput}, math::{self, Transform, Vec3}, render::light::{directional::DirectionalLight, SpotLight}, scene::CameraComponent, DeltaTime};
|
use lyra_engine::{assets::gltf::Gltf, ecs::{query::{QueryBorrow, ViewState}, system::{BatchedSystem, Criteria, CriteriaSchedule, IntoSystem}, Component, World}, game::Game, input::{Action, ActionHandler, ActionKind, ActionMapping, ActionMappingId, ActionSource, InputActionPlugin, KeyCode, LayoutId, MouseAxis, MouseInput}, math::{self, Quat, Transform, Vec3}, render::light::{directional::DirectionalLight, SpotLight}, scene::CameraComponent, DeltaTime};
|
||||||
use lyra_engine::assets::ResourceManager;
|
use lyra_engine::assets::ResourceManager;
|
||||||
|
|
||||||
mod free_fly_camera;
|
mod free_fly_camera;
|
||||||
|
@ -218,7 +218,13 @@ async fn main() {
|
||||||
} */
|
} */
|
||||||
|
|
||||||
let mut camera = CameraComponent::new_3d();
|
let mut camera = CameraComponent::new_3d();
|
||||||
camera.transform.translation += math::Vec3::new(0.0, 0.0, 5.5);
|
// these values were taken by manually positioning the camera in the scene.
|
||||||
|
camera.transform = Transform::new(
|
||||||
|
Vec3::new(-10.0, 0.94, -0.28),
|
||||||
|
Quat::from_xyzw(0.03375484, -0.7116095, 0.0342693, 0.70092666),
|
||||||
|
Vec3::ONE
|
||||||
|
);
|
||||||
|
//camera.transform.translation += math::Vec3::new(0.0, 0.0, 5.5);
|
||||||
world.spawn(( camera, FreeFlyCamera::default() ));
|
world.spawn(( camera, FreeFlyCamera::default() ));
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -257,11 +263,15 @@ async fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
let jiggle_plugin = move |game: &mut Game| {
|
let jiggle_plugin = move |game: &mut Game| {
|
||||||
game.world_mut().add_resource(TpsAccumulator(0.0));
|
/* game.world_mut().add_resource(TpsAccumulator(0.0));
|
||||||
|
|
||||||
let mut sys = BatchedSystem::new();
|
let mut sys = BatchedSystem::new();
|
||||||
sys.with_criteria(FixedTimestep::new(45));
|
sys.with_criteria(FixedTimestep::new(45));
|
||||||
sys.with_system(spin_system.into_system());
|
sys.with_system(spin_system.into_system()); */
|
||||||
|
|
||||||
|
/* let mut camera = CameraComponent::new_3d();
|
||||||
|
camera.transform.translation += math::Vec3::new(0.0, 0.0, 5.5);
|
||||||
|
world.spawn(( camera, FreeFlyCamera::default() )); */
|
||||||
//sys.with_system(fps_system);
|
//sys.with_system(fps_system);
|
||||||
|
|
||||||
//game.with_system("fixed", sys, &[]);
|
//game.with_system("fixed", sys, &[]);
|
||||||
|
|
Loading…
Reference in New Issue