From d7388ee954d9ea7acea346aad4af57764e20dd04 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 23 Jan 2021 14:51:57 +0000 Subject: Allow physical objects to share meshes and textures --- game/physical.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'game/physical.h') diff --git a/game/physical.h b/game/physical.h index ff9d316..ad2207d 100644 --- a/game/physical.h +++ b/game/physical.h @@ -1,14 +1,16 @@ #ifndef PHYSICAL_H #define PHYSICAL_H -#include "gfx/models/mesh.h" -#include "gfx/models/texture.h" #include #include +#include #include class Camera; class Shader; +class Mesh; +class Texture; +template class Cache; class Physical { public: @@ -24,8 +26,13 @@ public: protected: Transform location; - Mesh mesh; - Texture texture; + + std::shared_ptr mesh; + std::shared_ptr texture; + +private: + static Cache cachedMesh; + static Cache cachedTexture; }; #endif -- cgit v1.2.3