Make ProjectionComponent an actual component rather than using inheritance

This commit is contained in:
Alexander Bock
2016-06-29 23:27:01 +02:00
parent 5a5ffd76bb
commit 6f05ed3b98
7 changed files with 169 additions and 59 deletions

View File

@@ -196,7 +196,7 @@ void RenderablePlane::render(const RenderData& data) {
SceneGraphNode* textureNode = OsEng.renderEngine().scene()->sceneGraphNode(_nodeName)->parent();
if (textureNode != nullptr){
RenderablePlanetProjection* t = static_cast<RenderablePlanetProjection*>(textureNode->renderable());
_texture = std::unique_ptr<ghoul::opengl::Texture>(t->baseTexture());
_texture = std::unique_ptr<ghoul::opengl::Texture>(&(t->baseTexture()));
float h = _texture->height();
float w = _texture->width();
float scale = h / w;