From 687afb09ada73fb4aee932242a3b7ee492e63cb0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 23 Apr 2023 21:31:41 +0100 Subject: 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. --- game/vehicles/railVehicle.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'game/vehicles/railVehicle.h') 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 #include #include -#include #include #include @@ -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 bogies; + BufferedLocation location; + std::array bogies; }; using RailVehiclePtr = std::unique_ptr; -- cgit v1.2.3