diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-23 21:31:41 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-23 21:31:41 +0100 |
commit | 687afb09ada73fb4aee932242a3b7ee492e63cb0 (patch) | |
tree | e8c654edf5b0927238c89d8c861afe9bed995c8c /game/vehicles/railVehicle.h | |
parent | Add BufferedLocation (diff) | |
download | ilt-687afb09ada73fb4aee932242a3b7ee492e63cb0.tar.bz2 ilt-687afb09ada73fb4aee932242a3b7ee492e63cb0.tar.xz ilt-687afb09ada73fb4aee932242a3b7ee492e63cb0.zip |
Handle rendering of RailVehicles through RailVehicleClass instancing
Trains no longer need rendering as their parts are all RVC assets and that just works now.
This commit creates some irritating duplication in RVC wrt body/2 bogies all of which are stored
separately, but function in exactly the same way.
This breaks RV shadows as we have no instancing shadow shaders yet.
Diffstat (limited to 'game/vehicles/railVehicle.h')
-rw-r--r-- | game/vehicles/railVehicle.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/game/vehicles/railVehicle.h b/game/vehicles/railVehicle.h index bbf4df9..247bf66 100644 --- a/game/vehicles/railVehicle.h +++ b/game/vehicles/railVehicle.h @@ -1,11 +1,10 @@ #pragma once -#include "gfx/renderable.h" +#include "gfx/gl/bufferedLocation.h" #include "railVehicleClass.h" #include <array> #include <game/selectable.h> #include <glm/glm.hpp> -#include <location.hpp> #include <memory> #include <utility> @@ -14,19 +13,16 @@ class ShadowMapper; class Ray; class Train; -class RailVehicle : public Renderable, Selectable { +class RailVehicle : Selectable { public: explicit RailVehicle(RailVehicleClassPtr rvc); void move(const Train *, float & trailBy); - void render(const SceneShader & shader) const override; - void shadows(const ShadowMapper & shadowMapper) const override; [[nodiscard]] bool intersectRay(const Ray &, glm::vec2 *, float *) const override; - Location location; - RailVehicleClassPtr rvClass; - std::array<Location, 2> bogies; + BufferedLocation location; + std::array<BufferedLocation, 2> bogies; }; using RailVehiclePtr = std::unique_ptr<RailVehicle>; |