summaryrefslogtreecommitdiff
path: root/gfx/gl/bufferedLocation.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-30 13:04:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-31 00:37:24 +0100
commitfb78c88576d9fed90ee69dfa35a9fbd3179ff486 (patch)
tree3666e8c7a7ebf56b5d9e6919093c3a9c7766a750 /gfx/gl/bufferedLocation.h
parentUse uint32_t for indexes in InstanceVertices (diff)
downloadilt-fb78c88576d9fed90ee69dfa35a9fbd3179ff486.tar.bz2
ilt-fb78c88576d9fed90ee69dfa35a9fbd3179ff486.tar.xz
ilt-fb78c88576d9fed90ee69dfa35a9fbd3179ff486.zip
Use a single buffer for the location/rotation data of all renderable objects
Removes the BufferedLocation and BufferedLocationUpdater mess. Note: appears to break bogie rendering in asset factory test only, same symptom as broken network render test? (out of date buffer data)
Diffstat (limited to 'gfx/gl/bufferedLocation.h')
-rw-r--r--gfx/gl/bufferedLocation.h48
1 files changed, 0 insertions, 48 deletions
diff --git a/gfx/gl/bufferedLocation.h b/gfx/gl/bufferedLocation.h
deleted file mode 100644
index 87b957f..0000000
--- a/gfx/gl/bufferedLocation.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-
-#include "location.h"
-#include <functional>
-#include <glm/mat4x4.hpp>
-#include <glm/vec3.hpp>
-#include <utility>
-
-class BufferedLocation {
-public:
- BufferedLocation(GlobalPosition3D = {}, Rotation3D = {});
- BufferedLocation(const Location &);
- virtual ~BufferedLocation() = default;
-
- BufferedLocation & operator=(const Location &);
-
- operator const Location &() const;
-
- [[nodiscard]] GlobalPosition3D position() const;
- [[nodiscard]] Rotation3D rotation() const;
- void setPosition(GlobalPosition3D, bool update = true);
- void setRotation(Rotation3D, bool update = true);
- void setLocation(GlobalPosition3D, Rotation3D);
-
- [[nodiscard]] glm::mat4 getRotationTransform() const;
-
-private:
- virtual void updateBuffer() const = 0;
-
- Location loc;
-};
-
-class BufferedLocationUpdater : public BufferedLocation {
-public:
- template<typename... LocationArgs>
- BufferedLocationUpdater(std::function<void(const BufferedLocation *)> onUpdate, LocationArgs &&... t) :
- BufferedLocation {std::forward<LocationArgs>(t)...}, onUpdate {std::move(onUpdate)}
- {
- updateBuffer();
- }
-
- using BufferedLocation::operator=;
-
-private:
- void updateBuffer() const override;
-
- std::function<void(const BufferedLocation *)> onUpdate;
-};