mirror of
https://github.com/lubosz/overte.git
synced 2025-04-13 00:43:06 +02:00
Cleanup and PR comments
This commit is contained in:
parent
4b5c71e16d
commit
ccc4a59992
7 changed files with 23 additions and 22 deletions
|
@ -103,7 +103,7 @@ else()
|
|||
add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM})
|
||||
endif()
|
||||
|
||||
add_dependency_external_projects(glm bullet LibOVR)
|
||||
add_dependency_external_projects(glm bullet)
|
||||
|
||||
# set up the external glm library
|
||||
find_package(GLM REQUIRED)
|
||||
|
@ -120,11 +120,6 @@ endif()
|
|||
|
||||
target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES})
|
||||
|
||||
find_package(LibOVR REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${LIBOVR_INCLUDE_DIRS})
|
||||
#target_link_libraries(${TARGET_NAME} ${LIBOVR_LIBRARIES})
|
||||
|
||||
|
||||
# link required hifi libraries
|
||||
link_hifi_libraries(shared octree environment gpu model render fbx networking entities avatars
|
||||
audio audio-client animation script-engine physics
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.8 MiB |
|
@ -1034,7 +1034,7 @@ void Application::paintGL() {
|
|||
|
||||
if (displayPlugin->isStereo()) {
|
||||
PROFILE_RANGE(__FUNCTION__ "/stereoRender");
|
||||
QRect r(QPoint(0, 0), QSize(size.width() / 2, size.height()));
|
||||
QRect currentViewport(QPoint(0, 0), QSize(size.width() / 2, size.height()));
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
for_each_eye([&](Eye eye){
|
||||
// Load the view frustum, used by meshes
|
||||
|
@ -1046,14 +1046,14 @@ void Application::paintGL() {
|
|||
eyeCamera.setTransform(displayPlugin->getModelview(eye, _myCamera.getTransform()));
|
||||
}
|
||||
eyeCamera.setProjection(displayPlugin->getProjection(eye, _myCamera.getProjection()));
|
||||
renderArgs._viewport = gpu::Vec4i(r.x(), r.y(), r.width(), r.height());
|
||||
renderArgs._viewport = toGlm(currentViewport);
|
||||
doInBatch(&renderArgs, [&](gpu::Batch& batch) {
|
||||
batch.setViewportTransform(renderArgs._viewport);
|
||||
batch.setStateScissorRect(renderArgs._viewport);
|
||||
});
|
||||
displaySide(&renderArgs, eyeCamera);
|
||||
}, [&] {
|
||||
r.moveLeft(r.width());
|
||||
currentViewport.moveLeft(currentViewport.width());
|
||||
});
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
} else {
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
#include <QGLWidget>
|
||||
#include <QTimer>
|
||||
|
||||
class QOpenGLContext;
|
||||
|
||||
/// customized canvas that simply forwards requests/events to the singleton application
|
||||
class GLCanvas : public QGLWidget {
|
||||
Q_OBJECT
|
||||
|
|
|
@ -313,27 +313,31 @@ bool isSimilarPosition(const glm::vec3& positionA, const glm::vec3& positionB, f
|
|||
return (positionDistance <= similarEnough);
|
||||
}
|
||||
|
||||
glm::uvec2 toGlm(const QSize & size) {
|
||||
glm::uvec2 toGlm(const QSize& size) {
|
||||
return glm::uvec2(size.width(), size.height());
|
||||
}
|
||||
|
||||
glm::ivec2 toGlm(const QPoint & pt) {
|
||||
glm::ivec2 toGlm(const QPoint& pt) {
|
||||
return glm::ivec2(pt.x(), pt.y());
|
||||
}
|
||||
|
||||
glm::vec2 toGlm(const QPointF & pt) {
|
||||
glm::vec2 toGlm(const QPointF& pt) {
|
||||
return glm::vec2(pt.x(), pt.y());
|
||||
}
|
||||
|
||||
glm::vec3 toGlm(const xColor & color) {
|
||||
glm::vec3 toGlm(const xColor& color) {
|
||||
static const float MAX_COLOR = 255.0f;
|
||||
return glm::vec3(color.red, color.green, color.blue) / MAX_COLOR;
|
||||
}
|
||||
|
||||
glm::vec4 toGlm(const QColor & color) {
|
||||
glm::vec4 toGlm(const QColor& color) {
|
||||
return glm::vec4(color.redF(), color.greenF(), color.blueF(), color.alphaF());
|
||||
}
|
||||
|
||||
ivec4 toGlm(const QRect& rect) {
|
||||
return ivec4(rect.x(), rect.y(), rect.width(), rect.height());
|
||||
}
|
||||
|
||||
QMatrix4x4 fromGlm(const glm::mat4 & m) {
|
||||
return QMatrix4x4(&m[0][0]).transposed();
|
||||
}
|
||||
|
|
|
@ -18,9 +18,12 @@
|
|||
#include <glm/gtc/quaternion.hpp>
|
||||
|
||||
// Bring the most commonly used GLM types into the default namespace
|
||||
using glm::ivec3;
|
||||
using glm::ivec2;
|
||||
using glm::ivec3;
|
||||
using glm::ivec4;
|
||||
using glm::uvec2;
|
||||
using glm::uvec3;
|
||||
using glm::uvec4;
|
||||
using glm::mat3;
|
||||
using glm::mat4;
|
||||
using glm::vec2;
|
||||
|
@ -115,11 +118,12 @@ bool isSimilarOrientation(const glm::quat& orientionA, const glm::quat& orientio
|
|||
const float POSITION_SIMILAR_ENOUGH = 0.1f; // 0.1 meter
|
||||
bool isSimilarPosition(const glm::vec3& positionA, const glm::vec3& positionB, float similarEnough = POSITION_SIMILAR_ENOUGH);
|
||||
|
||||
glm::uvec2 toGlm(const QSize & size);
|
||||
glm::ivec2 toGlm(const QPoint & pt);
|
||||
glm::vec2 toGlm(const QPointF & pt);
|
||||
glm::vec3 toGlm(const xColor & color);
|
||||
glm::vec4 toGlm(const QColor & color);
|
||||
uvec2 toGlm(const QSize& size);
|
||||
ivec2 toGlm(const QPoint& pt);
|
||||
vec2 toGlm(const QPointF& pt);
|
||||
vec3 toGlm(const xColor& color);
|
||||
vec4 toGlm(const QColor& color);
|
||||
ivec4 toGlm(const QRect& rect);
|
||||
|
||||
QSize fromGlm(const glm::ivec2 & v);
|
||||
QMatrix4x4 fromGlm(const glm::mat4 & m);
|
||||
|
|
Loading…
Reference in a new issue