mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-03 23:44:06 +02:00
Fix orientation aligned with Y
This commit is contained in:
parent
c794ae8da2
commit
3445b7fd2c
1 changed files with 2 additions and 2 deletions
|
@ -27,9 +27,9 @@ 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_RIGHT, IDENTITY_UP, IDENTITY_FRONT));
|
||||
orientation = glm::quat(glm::mat3(-IDENTITY_RIGHT, IDENTITY_FRONT, -IDENTITY_UP));
|
||||
} else if (direction == -IDENTITY_UP) {
|
||||
orientation = glm::quat(glm::mat3(-IDENTITY_RIGHT, -IDENTITY_UP, IDENTITY_FRONT));
|
||||
orientation = glm::quat(glm::mat3(IDENTITY_RIGHT, IDENTITY_FRONT, IDENTITY_UP));
|
||||
} else {
|
||||
auto side = glm::normalize(glm::cross(direction, IDENTITY_UP));
|
||||
auto up = glm::normalize(glm::cross(side, direction));
|
||||
|
|
Loading…
Reference in a new issue