Skip to content

Commit

Permalink
Adapt to camera in World.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Geertiebear committed Mar 21, 2017
1 parent e732cc6 commit cf4c4ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/Game.cpp
Expand Up @@ -44,7 +44,7 @@ void Game::initRenderers() {
World& worldReference = static_cast<glPortal::World&>(world);
radix::Renderer& rendererReference = *renderer.get();
gameRenderer =
std::make_unique<GameRenderer>(worldReference, rendererReference, camera.get(), &dtime);
std::make_unique<GameRenderer>(worldReference, rendererReference, world.camera.get(), &dtime);
uiRenderer =
std::make_unique<UiRenderer>(worldReference, rendererReference);
}
Expand Down
6 changes: 3 additions & 3 deletions source/WorldHelper.cpp
Expand Up @@ -13,8 +13,8 @@ using namespace radix;
namespace glPortal {

void WorldHelper::shootPortal(int button, World &world) {
Vector3f cameraDir = Math::toDirection(world.camera.getOrientation());
btVector3 btFrom = world.camera.getPosition();
Vector3f cameraDir = Math::toDirection(world.camera->getOrientation());
btVector3 btFrom = world.camera->getPosition();
btVector3 btTo = btFrom + cameraDir*10000;
btCollisionWorld::ClosestRayResultCallback res(btFrom, btTo);

Expand All @@ -35,7 +35,7 @@ void WorldHelper::shootPortal(int button, World &world) {
Portal &portal = pEnt.getComponent<Portal>();
portal.openSince = world.getTime();
portal.maskTex.diffuse = TextureLoader::getTexture("portalmask.png");
portal.placeOnWall(world.camera.getPosition(), ipos, res.m_hitNormalWorld);
portal.placeOnWall(world.camera->getPosition(), ipos, res.m_hitNormalWorld);
LightSource &pLight = pEnt.getComponent<LightSource>();

if (button == 1) {
Expand Down

3 comments on commit cf4c4ff

@hhirsch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhirsch
Copy link
Member

@hhirsch hhirsch commented on cf4c4ff Mar 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Geertiebear Hah. I have just merged glportal master into this though so I don't know the difference but the console branch compiles https://travis-ci.org/GlPortal/glPortal/builds/213611999

@Geertiebear
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh what the hell...
Maybe radix is on different versions?

Please sign in to comment.