summaryrefslogtreecommitdiff
path: root/game/scenary/plant.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-22 19:06:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-22 19:06:42 +0100
commitd1f79b4c438ebf0822741e103b2cb06bdee4514e (patch)
treea4d574d12cd81d5e33886ce7ca961f7dbe872fcf /game/scenary/plant.cpp
parentRename lots of shader files (diff)
parentKeep the instance unused vector sorted and binary search it (diff)
downloadilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.bz2
ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.xz
ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.zip
Merge branch 'instancing'
Diffstat (limited to 'game/scenary/plant.cpp')
-rw-r--r--game/scenary/plant.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/game/scenary/plant.cpp b/game/scenary/plant.cpp
index 2b01bee..678d4a7 100644
--- a/game/scenary/plant.cpp
+++ b/game/scenary/plant.cpp
@@ -1,13 +1,7 @@
#include "plant.h"
-void
-Plant::render(const SceneShader & shader) const
+Plant::Plant(std::shared_ptr<const Foliage> type, Location position) :
+ type {std::move(type)},
+ location {this->type->instances.acquire(glm::translate(position.pos) * rotate_ypr(position.rot))}
{
- type->render(shader, position);
-}
-
-void
-Plant::shadows(const ShadowMapper & mapper) const
-{
- type->shadows(mapper, position);
}