Slightly moved player direction light to not be drawn over player sprite.
This commit is contained in:
parent
dcf69c8e07
commit
779cc36c57
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Reference in a new issue