mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Fix orientation of shadow frustum
This commit is contained in:
parent
986af50b71
commit
d6e5e2de81
1 changed files with 2 additions and 2 deletions
|
@ -25,11 +25,11 @@ void LightStage::Shadow::setKeylightFrustum(ViewFrustum* viewFrustum, float near
|
|||
const auto& direction = glm::normalize(_light->getDirection());
|
||||
glm::quat orientation;
|
||||
if (direction == IDENTITY_UP) {
|
||||
orientation = glm::quat(glm::mat3(IDENTITY_UP, -IDENTITY_FRONT, IDENTITY_RIGHT));
|
||||
orientation = glm::quat(glm::mat3(IDENTITY_RIGHT, IDENTITY_UP, IDENTITY_FRONT));
|
||||
} else {
|
||||
auto side = glm::normalize(glm::cross(direction, IDENTITY_UP));
|
||||
auto up = glm::normalize(glm::cross(side, direction));
|
||||
orientation = glm::quat(glm::mat3(direction, up, side));
|
||||
orientation = glm::quat_cast(glm::mat3(side, up, -direction));
|
||||
}
|
||||
_frustum->setOrientation(orientation);
|
||||
|
||||
|
|
Loading…
Reference in a new issue