mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:23:36 +02:00
remove includes, fix comment
This commit is contained in:
parent
0b8f888d9b
commit
e0ce154472
2 changed files with 3 additions and 5 deletions
|
@ -14,9 +14,7 @@
|
|||
#include <TextureCache.h>
|
||||
#include <gpu/Context.h>
|
||||
#include <EntityScriptingInterface.h>
|
||||
#include <EntityTree.h>
|
||||
#include <glm/gtx/transform.hpp>
|
||||
#include <DebugDraw.h>
|
||||
|
||||
using RenderArgsPointer = std::shared_ptr<RenderArgs>;
|
||||
|
||||
|
@ -65,13 +63,13 @@ public:
|
|||
glm::quat mirrorPropsRot = entityProperties.getRotation();
|
||||
glm::vec3 mirrorPropsDim = entityProperties.getDimensions();
|
||||
|
||||
// setup mirror from world as inverse of world from mirror transformation using inverted x and z to mirror
|
||||
// setup mirror from world as inverse of world from mirror transformation using inverted x and z for mirrored image
|
||||
glm::mat4 worldFromMirrorRot = glm::mat4_cast(mirrorPropsRot) * glm::scale(vec3(-1.f, 1.f, -1.f));
|
||||
glm::mat4 worldFromMirrorTrans = glm::translate(mirrorPropsPos);
|
||||
glm::mat4 worldFromMirror = worldFromMirrorTrans * worldFromMirrorRot;
|
||||
glm::mat4 mirrorFromWorld = glm::inverse(worldFromMirror);
|
||||
|
||||
// get mirror cam position by reflecting main cam position's z coord in mirror space
|
||||
// get mirror camera position by reflecting main camera position's z coordinate in mirror space
|
||||
glm::vec3 mainCamPosWorld = qApp->getCamera().getPosition();
|
||||
glm::vec3 mainCamPosMirror = vec3(mirrorFromWorld * vec4(mainCamPosWorld, 1.f));
|
||||
glm::vec3 mirrorCamPosMirror = vec3(mainCamPosMirror.x, mainCamPosMirror.y, -mainCamPosMirror.z);
|
||||
|
|
|
@ -35,7 +35,7 @@ class SecondaryCameraJobConfig : public render::Task::Config { // Exposes second
|
|||
Q_PROPERTY(float vFoV MEMBER vFoV NOTIFY dirty) // Secondary camera's vertical field of view. In degrees.
|
||||
Q_PROPERTY(float nearClipPlaneDistance MEMBER nearClipPlaneDistance NOTIFY dirty) // Secondary camera's near clip plane distance. In meters.
|
||||
Q_PROPERTY(float farClipPlaneDistance MEMBER farClipPlaneDistance NOTIFY dirty) // Secondary camera's far clip plane distance. In meters.
|
||||
Q_PROPERTY(bool mirrorProjection MEMBER mirrorProjection NOTIFY dirty) // Flag to apply oblique near-plane clipping using perspective projection from attached mirror entity
|
||||
Q_PROPERTY(bool mirrorProjection MEMBER mirrorProjection NOTIFY dirty) // Flag to use attached mirror entity to build frustum for the mirror and set mirrored camera position/orientation.
|
||||
public:
|
||||
QUuid attachedEntityId;
|
||||
glm::vec3 position;
|
||||
|
|
Loading…
Reference in a new issue