Slightly moved player direction light to not be drawn over player sprite.

This commit is contained in:
Felix Ableitner 2013-09-17 22:46:00 +02:00
parent dcf69c8e07
commit 779cc36c57

View file

@ -360,7 +360,10 @@ Game::render() {
// Update light // Update light
mPlayerAreaLight->SetCenter(mPlayer->getPosition().toVec2f()); mPlayerAreaLight->SetCenter(mPlayer->getPosition().toVec2f());
mPlayerDirectionLight->SetCenter(mPlayer->getPosition().toVec2f()); // Avoid light light drawing partially onto player sprite.
Vector2f playerLightPosition = mPlayer->getPosition() +
thor::rotatedVector(Vector2f(0, - 13), mPlayer->getDirection());
mPlayerDirectionLight->SetCenter(playerLightPosition.toVec2f());
mPlayerDirectionLight->SetDirectionAngle(degreeToRadian(90 - mPlayer->getDirection())); mPlayerDirectionLight->SetDirectionAngle(degreeToRadian(90 - mPlayer->getDirection()));
mLightSystem.SetView(mWorldView); mLightSystem.SetView(mWorldView);