mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
- applying of new qApp accessing method.
- Some magic constant replacements with Helper "glm::vec3(matrix[3])" -> "extractTranslation(matrix)"
This commit is contained in:
parent
4ab5e0af84
commit
ad5a6fac62
2 changed files with 5 additions and 5 deletions
|
@ -1345,11 +1345,11 @@ void MyAvatar::renderBody(RenderArgs* renderArgs, ViewFrustum* renderFrustum, fl
|
|||
glm::mat4 headPose = qApp->getActiveDisplayPlugin()->getHeadPose();
|
||||
glm::mat4 leftEyePose = qApp->getActiveDisplayPlugin()->getEyeToHeadTransform(Eye::Left);
|
||||
leftEyePose = leftEyePose * headPose;
|
||||
glm::vec3 leftEyePosition = glm::vec3(leftEyePose[3]);
|
||||
glm::vec3 leftEyePosition = extractTranslation(leftEyePose);
|
||||
glm::mat4 rightEyePose = qApp->getActiveDisplayPlugin()->getEyeToHeadTransform(Eye::Right);
|
||||
rightEyePose = rightEyePose * headPose;
|
||||
glm::vec3 rightEyePosition = glm::vec3(rightEyePose[3]);
|
||||
glm::vec3 headPosition = glm::vec3(headPose[3]);
|
||||
glm::vec3 rightEyePosition = extractTranslation(rightEyePose);
|
||||
glm::vec3 headPosition = extractTranslation(headPose);
|
||||
|
||||
getHead()->renderLookAts(renderArgs,
|
||||
cameraPosition + getOrientation() * (leftEyePosition - headPosition),
|
||||
|
|
|
@ -70,14 +70,14 @@ glm::mat4 HMDScriptingInterface::getWorldHMDMatrix() const {
|
|||
}
|
||||
|
||||
glm::vec3 HMDScriptingInterface::getPosition() const {
|
||||
if (Application::getInstance()->getActiveDisplayPlugin()->isHmd()) {
|
||||
if (qApp->getActiveDisplayPlugin()->isHmd()) {
|
||||
return extractTranslation(getWorldHMDMatrix());
|
||||
}
|
||||
return glm::vec3();
|
||||
}
|
||||
|
||||
glm::quat HMDScriptingInterface::getOrientation() const {
|
||||
if (Application::getInstance()->getActiveDisplayPlugin()->isHmd()) {
|
||||
if (qApp->getActiveDisplayPlugin()->isHmd()) {
|
||||
return glm::normalize(glm::quat_cast(getWorldHMDMatrix()));
|
||||
}
|
||||
return glm::quat();
|
||||
|
|
Loading…
Reference in a new issue