summaryrefslogtreecommitdiff
path: root/game/physical.h
blob: 5fdc253d82a4a00376f5ea13e7387b042c45b7c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef PHYSICAL_H
#define PHYSICAL_H

#include <gfx/gl/transform.h>
#include <gfx/renderable.h>
#include <glm/glm.hpp>
#include <memory>
#include <string>

class Shader;
class Mesh;
class Texture;
template<typename Obj> class Cache;

class Physical : public Renderable {
public:
	Physical(glm::vec3 where, const std::string & m, const std::string & t);

	void render(const Shader & shader) const override;

	[[nodiscard]] const auto &
	getLocation() const
	{
		return location;
	}

protected:
	Transform location;

	std::shared_ptr<Mesh> mesh;
	std::shared_ptr<Texture> texture;

private:
	static Cache<Mesh> cachedMesh;
};

#endif