From 824009e25833f48cfa12a1a20e5709c05d5af423 Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <joseph@walton-rivers.uk> Date: Sat, 30 Apr 2022 20:13:33 +0100 Subject: [PATCH] fix camera direction, mockup of scene script --- demo/data/packs/rollball/scene.yml | 65 ++++++++++++++++++++++++++++++ demo/include/rollball.hpp | 2 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 demo/data/packs/rollball/scene.yml diff --git a/demo/data/packs/rollball/scene.yml b/demo/data/packs/rollball/scene.yml new file mode 100644 index 0000000..7746947 --- /dev/null +++ b/demo/data/packs/rollball/scene.yml @@ -0,0 +1,65 @@ +--- +# This currently isn't functional, it's an experiment in how this +# might be defined in a user-friendly(ish) way. + +prefabs: + wallX: + transform: + staticMesh: + pipeline: phong + shape: # TODO + rigidBody: + type: static + shape: + type: box + extents: [0.5, 2.5, 20.5] + wallZ: + transform: + staticMesh: + pipeline: phong + rigidBody: + type: static + shape: + type: box + extents: [39.0, 2.5, 0.5] + floor: + transform: + staticMesh: + pipeline: phong + shape: # TODO + rigidBody: + type: static + shape: box + extents: [20, 0.5, 20.0] + player: + transform: + rigidBody: + mass: 1 + shape: + type: sphere + extents: [0.5, 0.5, 0.5] + dynamics: + staticMesh: + pipeline: phong + shape: # TODO + collectable: + transform: + staticMesh: + shader: phong + shape: # TODO + callbacks: +scene: + entities: + - prefab: wallX + transform: + origin: [20, 0, 0] + - prefab: wallX + transform: + origin: [-20, 0, 0] + - prefab: wallZ + transform: [0, 0, -20] + - prefab: wallZ + transform: [0, 0, 20] + - prefab: floor + transform: [0, -2.5, 0] + - prefab: player \ No newline at end of file diff --git a/demo/include/rollball.hpp b/demo/include/rollball.hpp index 9c27b96..d1523de 100644 --- a/demo/include/rollball.hpp +++ b/demo/include/rollball.hpp @@ -41,7 +41,7 @@ namespace demo { private: fggl::ecs3::entity_t player = fggl::ecs3::NULL_ENTITY; - fggl::math::vec3 cameraOffset = {0.0F, 15.0F, -15.0F}; + fggl::math::vec3 cameraOffset = {-15.0F, 15.0F, 0.0F}; }; } -- GitLab