mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:19:05 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into cruft_removal
This commit is contained in:
commit
a89c5b568f
54 changed files with 73 additions and 62 deletions
|
@ -39,4 +39,4 @@ add_subdirectory(domain-server)
|
||||||
add_subdirectory(interface)
|
add_subdirectory(interface)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
add_subdirectory(voxel-edit)
|
add_subdirectory(voxel-edit)
|
||||||
add_subdirectory(SvoViewer)
|
add_subdirectory(svo-viewer)
|
||||||
|
|
|
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
|
||||||
set(ROOT_DIR ..)
|
set(ROOT_DIR ..)
|
||||||
set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
|
set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
|
||||||
|
|
||||||
set(TARGET_NAME SvoViewer)
|
set(TARGET_NAME svo-viewer)
|
||||||
project(${TARGET_NAME})
|
project(${TARGET_NAME})
|
||||||
|
|
||||||
# setup for find modules
|
# setup for find modules
|
||||||
|
@ -42,9 +42,9 @@ endif (WIN32)
|
||||||
include(${MACRO_DIR}/IncludeGLM.cmake)
|
include(${MACRO_DIR}/IncludeGLM.cmake)
|
||||||
include_glm(${TARGET_NAME} ${ROOT_DIR})
|
include_glm(${TARGET_NAME} ${ROOT_DIR})
|
||||||
|
|
||||||
# create the ${TARGET_NAME}Config.h file based on GL_HEADERS above
|
# create the ${TARGET_NAME}-config.h file based on GL_HEADERS above
|
||||||
configure_file(${TARGET_NAME}Config.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}Config.h)
|
configure_file(${TARGET_NAME}-config.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}-config.h)
|
||||||
configure_file(${TARGET_NAME}Version.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}Version.h)
|
configure_file(${TARGET_NAME}-version.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}-version.h)
|
||||||
|
|
||||||
# grab the implementation and header files from src dirs
|
# grab the implementation and header files from src dirs
|
||||||
file(GLOB APPLICATION_SRCS src/*.c src/*.cpp src/*.h)
|
file(GLOB APPLICATION_SRCS src/*.c src/*.cpp src/*.h)
|
||||||
|
@ -81,7 +81,7 @@ if (APPLE)
|
||||||
# configure CMake to use a custom Info.plist
|
# configure CMake to use a custom Info.plist
|
||||||
SET_TARGET_PROPERTIES( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in )
|
SET_TARGET_PROPERTIES( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in )
|
||||||
|
|
||||||
set(MACOSX_BUNDLE_BUNDLE_NAME SvoViewer)
|
set(MACOSX_BUNDLE_BUNDLE_NAME svo-viewer)
|
||||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER io.highfidelity.${TARGET_NAME})
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER io.highfidelity.${TARGET_NAME})
|
||||||
|
|
||||||
# set how the icon shows up in the Info.plist file
|
# set how the icon shows up in the Info.plist file
|
|
@ -4,7 +4,7 @@
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include <glm/gtx/quaternion.hpp>
|
#include <glm/gtx/quaternion.hpp>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <glm/gtc/matrix_transform.hpp>
|
|
@ -5,7 +5,7 @@
|
||||||
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include "svoviewer.h"
|
#include "svoviewer.h"
|
||||||
|
|
|
@ -80,7 +80,7 @@ void SvoViewer::InitializePointRenderSystem()
|
||||||
_pointVerticesCount = args.count;
|
_pointVerticesCount = args.count;
|
||||||
|
|
||||||
// create the data store.
|
// create the data store.
|
||||||
int size = _nodeCount * sizeof(glm::vec3);
|
//int size = _nodeCount * sizeof(glm::vec3);
|
||||||
glBindBuffer( GL_ARRAY_BUFFER, _pointVtxBuffer);
|
glBindBuffer( GL_ARRAY_BUFFER, _pointVtxBuffer);
|
||||||
glBufferData(GL_ARRAY_BUFFER, _nodeCount * 3, args.buffer, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, _nodeCount * 3, args.buffer, GL_STATIC_DRAW);
|
||||||
//glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
|
//glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||||
|
@ -92,7 +92,7 @@ void SvoViewer::InitializePointRenderSystem()
|
||||||
_renderFlags.ptRenderDirty = false;
|
_renderFlags.ptRenderDirty = false;
|
||||||
_ptRenderInitialized = true;
|
_ptRenderInitialized = true;
|
||||||
float elapsed = (float)(usecTimestampNow() - fstart) / 1000.f;
|
float elapsed = (float)(usecTimestampNow() - fstart) / 1000.f;
|
||||||
qDebug("Point render intialization took %f time for %d nodes\n", elapsed, _nodeCount);
|
qDebug("Point render intialization took %f time for %ld nodes\n", elapsed, _nodeCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SvoViewer::RenderTreeSystemAsPoints()
|
void SvoViewer::RenderTreeSystemAsPoints()
|
||||||
|
@ -326,19 +326,16 @@ void SvoViewer::InitializeVoxelRenderSystem()
|
||||||
|
|
||||||
GLchar shaderLog[1000];
|
GLchar shaderLog[1000];
|
||||||
GLsizei shaderLogLength;
|
GLsizei shaderLogLength;
|
||||||
GLint compiled;
|
//GLint compiled;
|
||||||
// TODO: this was Matt's original windows code, it doesn't compile on mac, due to type mismatches
|
glCompileShaderARB((GLhandleARB)_vertexShader);
|
||||||
#ifdef WIN32
|
|
||||||
glCompileShaderARB(_vertexShader);
|
|
||||||
glGetShaderInfoLog(_vertexShader, 1000, &shaderLogLength, shaderLog);
|
glGetShaderInfoLog(_vertexShader, 1000, &shaderLogLength, shaderLog);
|
||||||
if (shaderLog[0] != 0) qDebug("Shaderlog v :\n %s\n", shaderLog);
|
if (shaderLog[0] != 0) qDebug("Shaderlog v :\n %s\n", shaderLog);
|
||||||
glCompileShaderARB(_geometryShader);
|
glCompileShaderARB((GLhandleARB)_geometryShader);
|
||||||
glGetShaderInfoLog(_geometryShader, 1000, &shaderLogLength, shaderLog);
|
glGetShaderInfoLog(_geometryShader, 1000, &shaderLogLength, shaderLog);
|
||||||
if (shaderLog[0] != 0) qDebug("Shaderlog g :\n %s\n", shaderLog);
|
if (shaderLog[0] != 0) qDebug("Shaderlog g :\n %s\n", shaderLog);
|
||||||
glCompileShaderARB(_pixelShader);
|
glCompileShaderARB((GLhandleARB)_pixelShader);
|
||||||
glGetShaderInfoLog(_pixelShader, 51000, &shaderLogLength, shaderLog);
|
glGetShaderInfoLog(_pixelShader, 51000, &shaderLogLength, shaderLog);
|
||||||
if (shaderLog[0] != 0) qDebug("Shaderlog p :\n %s\n", shaderLog);
|
if (shaderLog[0] != 0) qDebug("Shaderlog p :\n %s\n", shaderLog);
|
||||||
#endif //def WIN32
|
|
||||||
|
|
||||||
_linkProgram = glCreateProgram();
|
_linkProgram = glCreateProgram();
|
||||||
glAttachShader(_linkProgram, _vertexShader);
|
glAttachShader(_linkProgram, _vertexShader);
|
||||||
|
@ -621,7 +618,7 @@ void SvoViewer::InitializeVoxelOptRenderSystem()
|
||||||
// Set up the segments. Find the number of leaves at each subtree.
|
// Set up the segments. Find the number of leaves at each subtree.
|
||||||
OctreeElement * rootNode = _systemTree.getRoot();
|
OctreeElement * rootNode = _systemTree.getRoot();
|
||||||
OctreeElement* node0fromRoot = rootNode->getChildAtIndex(0); // ALL the interesting data for our test SVO is in this node! HACK!!
|
OctreeElement* node0fromRoot = rootNode->getChildAtIndex(0); // ALL the interesting data for our test SVO is in this node! HACK!!
|
||||||
int rootNumChildren = rootNode->getChildCount();
|
//int rootNumChildren = rootNode->getChildCount();
|
||||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++)
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++)
|
||||||
{
|
{
|
||||||
OctreeElement* childNode1stOrder = node0fromRoot->getChildAtIndex(i);
|
OctreeElement* childNode1stOrder = node0fromRoot->getChildAtIndex(i);
|
||||||
|
@ -632,7 +629,7 @@ void SvoViewer::InitializeVoxelOptRenderSystem()
|
||||||
OctreeElement* childNode2ndOrder = childNode1stOrder->getChildAtIndex(j);
|
OctreeElement* childNode2ndOrder = childNode1stOrder->getChildAtIndex(j);
|
||||||
if (childNode2ndOrder == NULL) continue;
|
if (childNode2ndOrder == NULL) continue;
|
||||||
|
|
||||||
int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
//int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
||||||
// Figure out how populated this child is.
|
// Figure out how populated this child is.
|
||||||
FindNumLeavesData data;
|
FindNumLeavesData data;
|
||||||
data.numLeaves = 0;
|
data.numLeaves = 0;
|
||||||
|
@ -713,15 +710,22 @@ void SvoViewer::RenderTreeSystemAsOptVoxels()
|
||||||
if (isVisibleBV(&_segmentBoundingVolumes[i], &_myCamera, &_viewFrustum)) // Add aggressive LOD check here.
|
if (isVisibleBV(&_segmentBoundingVolumes[i], &_myCamera, &_viewFrustum)) // Add aggressive LOD check here.
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vboOVerticesIds[i]);
|
glBindBuffer(GL_ARRAY_BUFFER, _vboOVerticesIds[i]);
|
||||||
glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
// NOTE: mac compiler doesn't support offsetof() for non-POD types, which apparently glm::vec3 is
|
||||||
|
//glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
||||||
|
glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)0);
|
||||||
glEnableVertexAttribArray(ATTRIB_POSITION);
|
glEnableVertexAttribArray(ATTRIB_POSITION);
|
||||||
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
// NOTE: mac compiler doesn't support offsetof() for non-POD types, which apparently glm::vec3 is
|
||||||
|
//glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
||||||
|
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(Vertex), (void*)sizeof(glm::vec3));
|
||||||
glEnableVertexAttribArray(ATTRIB_COLOR);
|
glEnableVertexAttribArray(ATTRIB_COLOR);
|
||||||
|
|
||||||
//glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
//glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
|
||||||
|
// NOTE: mac compiler doesn't support offsetof() for non-POD types, which apparently glm::vec3 is
|
||||||
|
//glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
||||||
|
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (void*)sizeof(glm::vec3));
|
||||||
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _vboOIndicesIds[i]);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _vboOIndicesIds[i]);
|
||||||
|
|
|
@ -190,7 +190,7 @@ void SvoViewer::InitializeVoxelOpt2RenderSystem()
|
||||||
// Set up the segments. Find the number of leaves at each subtree.
|
// Set up the segments. Find the number of leaves at each subtree.
|
||||||
OctreeElement * rootNode = _systemTree.getRoot();
|
OctreeElement * rootNode = _systemTree.getRoot();
|
||||||
OctreeElement* node0fromRoot = rootNode->getChildAtIndex(0); // ALL the interesting data for our test SVO is in this node! HACK!!
|
OctreeElement* node0fromRoot = rootNode->getChildAtIndex(0); // ALL the interesting data for our test SVO is in this node! HACK!!
|
||||||
int rootNumChildren = rootNode->getChildCount();
|
//int rootNumChildren = rootNode->getChildCount();
|
||||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++)
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++)
|
||||||
{
|
{
|
||||||
OctreeElement* childNode1stOrder = node0fromRoot->getChildAtIndex(i);
|
OctreeElement* childNode1stOrder = node0fromRoot->getChildAtIndex(i);
|
||||||
|
@ -201,7 +201,7 @@ void SvoViewer::InitializeVoxelOpt2RenderSystem()
|
||||||
OctreeElement* childNode2ndOrder = childNode1stOrder->getChildAtIndex(j);
|
OctreeElement* childNode2ndOrder = childNode1stOrder->getChildAtIndex(j);
|
||||||
if (childNode2ndOrder == NULL) continue;
|
if (childNode2ndOrder == NULL) continue;
|
||||||
|
|
||||||
int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
//int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
||||||
// Figure out how populated this child is.
|
// Figure out how populated this child is.
|
||||||
FindNumLeavesData data;
|
FindNumLeavesData data;
|
||||||
data.numLeaves = 0;
|
data.numLeaves = 0;
|
||||||
|
@ -296,15 +296,24 @@ void SvoViewer::RenderTreeSystemAsOpt2Voxels()
|
||||||
if (_displayOnlyPartition == i || _displayOnlyPartition == NO_PARTITION )
|
if (_displayOnlyPartition == i || _displayOnlyPartition == NO_PARTITION )
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vboOVerticesIds[i]);
|
glBindBuffer(GL_ARRAY_BUFFER, _vboOVerticesIds[i]);
|
||||||
glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
|
||||||
|
// NOTE: mac compiler doesn't support offsetof() for non-POD types, which apparently glm::vec3 is
|
||||||
|
//glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
||||||
|
glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)0);
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_POSITION);
|
glEnableVertexAttribArray(ATTRIB_POSITION);
|
||||||
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
// NOTE: mac compiler doesn't support offsetof() for non-POD types, which apparently glm::vec3 is
|
||||||
|
//glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
||||||
|
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(Vertex), (void*)sizeof(glm::vec3));
|
||||||
glEnableVertexAttribArray(ATTRIB_COLOR);
|
glEnableVertexAttribArray(ATTRIB_COLOR);
|
||||||
|
|
||||||
//glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
//glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (void*)offsetof(Vertex,position));
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
|
||||||
|
// NOTE: mac compiler doesn't support offsetof() for non-POD types, which apparently glm::vec3 is
|
||||||
|
//glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (void*)offsetof(Vertex,color));
|
||||||
|
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (void*)sizeof(glm::vec3));
|
||||||
|
|
||||||
for (int j = 0; j < NUM_CUBE_FACES; j++)
|
for (int j = 0; j < NUM_CUBE_FACES; j++)
|
||||||
{
|
{
|
||||||
|
@ -328,7 +337,7 @@ void SvoViewer::UpdateOpt2BVFaceVisibility()
|
||||||
{
|
{
|
||||||
if (_currentShaderModel != RENDER_OPT_CULLED_POLYS || _voxelOptRenderInitialized != true ) return;
|
if (_currentShaderModel != RENDER_OPT_CULLED_POLYS || _voxelOptRenderInitialized != true ) return;
|
||||||
|
|
||||||
float faceParamVals[NUM_CUBE_FACES];
|
//float faceParamVals[NUM_CUBE_FACES];
|
||||||
glm::vec3 pos = _myCamera.getPosition();
|
glm::vec3 pos = _myCamera.getPosition();
|
||||||
|
|
||||||
for (int i = 0; i < _numSegments; i++)
|
for (int i = 0; i < _numSegments; i++)
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -5,13 +5,14 @@
|
||||||
// Created by Andrzej Kapolka on 4/24/13.
|
// Created by Andrzej Kapolka on 4/24/13.
|
||||||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||||
|
|
||||||
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QPaintEngine>
|
#include <QPaintEngine>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
|
||||||
#include "TextRenderer.h"
|
#include "TextRenderer.h"
|
||||||
|
|
||||||
// the width/height of the cached glyph textures
|
// the width/height of the cached glyph textures
|
|
@ -9,13 +9,14 @@
|
||||||
#ifndef __interface__TextRenderer__
|
#ifndef __interface__TextRenderer__
|
||||||
#define __interface__TextRenderer__
|
#define __interface__TextRenderer__
|
||||||
|
|
||||||
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
|
||||||
|
|
||||||
// a special "character" that renders as a solid block
|
// a special "character" that renders as a solid block
|
||||||
const char SOLID_BLOCK_CHAR = 127;
|
const char SOLID_BLOCK_CHAR = 127;
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include <QtWidgets/QMainWindow>
|
#include <QtWidgets/QMainWindow>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
|
@ -4,7 +4,7 @@
|
||||||
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include "svoviewer.h"
|
#include "svoviewer.h"
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
|
@ -31,13 +31,17 @@ SvoViewer * _globalSvoViewerObj; // Hack :: var to store global pointer since th
|
||||||
SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
||||||
: QApplication(argc, argv),
|
: QApplication(argc, argv),
|
||||||
_window(new QMainWindow(desktop())),
|
_window(new QMainWindow(desktop())),
|
||||||
_glWidget(new GLCanvas()),
|
|
||||||
_width(1280),
|
_width(1280),
|
||||||
_height(720),
|
_height(720),
|
||||||
_pixelCount(1280*720),
|
_pixelCount(1280*720),
|
||||||
_frameCount(0),
|
_glWidget(new GLCanvas()),
|
||||||
|
_nodeCount(0),
|
||||||
_leafCount(0),
|
_leafCount(0),
|
||||||
_nodeCount(0),
|
_pitch(0),
|
||||||
|
_yaw(0),
|
||||||
|
_roll(0),
|
||||||
|
_displayOnlyPartition(NO_PARTITION),
|
||||||
|
_frameCount(0),
|
||||||
_fps(0.0),
|
_fps(0.0),
|
||||||
_lastTimeFpsUpdated(0),
|
_lastTimeFpsUpdated(0),
|
||||||
_lastTimeFrameUpdated(0),
|
_lastTimeFrameUpdated(0),
|
||||||
|
@ -48,29 +52,26 @@ SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
||||||
_vertexShader(0),
|
_vertexShader(0),
|
||||||
_pixelShader(0),
|
_pixelShader(0),
|
||||||
_geometryShader(0),
|
_geometryShader(0),
|
||||||
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
|
||||||
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
|
||||||
_boundaryLevelAdjust(0),
|
|
||||||
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
|
|
||||||
_fieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES),
|
|
||||||
_useVoxelTextures(false),
|
|
||||||
_pointVertices(NULL),
|
_pointVertices(NULL),
|
||||||
|
_pointColors(NULL),
|
||||||
_pointVerticesCount(0),
|
_pointVerticesCount(0),
|
||||||
|
_numSegments(0),
|
||||||
|
_useBoundingVolumes(true),
|
||||||
|
_numElemsDrawn(0),
|
||||||
|
_totalPossibleElems(0),
|
||||||
|
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
|
||||||
|
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
||||||
|
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
||||||
|
_boundaryLevelAdjust(0),
|
||||||
//_vboShaderData(NULL),
|
//_vboShaderData(NULL),
|
||||||
_mousePressed(false),
|
_fieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES)
|
||||||
_pitch(0),
|
|
||||||
_yaw(0),
|
|
||||||
_roll(0),
|
|
||||||
_numSegments(0),
|
|
||||||
_displayOnlyPartition(NO_PARTITION),
|
|
||||||
_totalPossibleElems(0),
|
|
||||||
_numElemsDrawn(0),
|
|
||||||
_useBoundingVolumes(true)
|
|
||||||
{
|
{
|
||||||
gettimeofday(&_applicationStartupTime, NULL);
|
gettimeofday(&_applicationStartupTime, NULL);
|
||||||
_appStartTickCount = usecTimestampNow();
|
_appStartTickCount = usecTimestampNow();
|
||||||
|
|
||||||
_globalSvoViewerObj = this;
|
_globalSvoViewerObj = this;
|
||||||
|
_mousePressed = false;
|
||||||
|
_useVoxelTextures = false;
|
||||||
|
|
||||||
//ui.setupUi(this);
|
//ui.setupUi(this);
|
||||||
_window->setWindowTitle("SvoViewer");
|
_window->setWindowTitle("SvoViewer");
|
||||||
|
@ -89,7 +90,6 @@ SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
||||||
QString shaderMode;
|
QString shaderMode;
|
||||||
|
|
||||||
QStringList argumentList = arguments();
|
QStringList argumentList = arguments();
|
||||||
int argumentIndex = 0;
|
|
||||||
|
|
||||||
// check if this domain server should use no authentication or a custom hostname for authentication
|
// check if this domain server should use no authentication or a custom hostname for authentication
|
||||||
const QString FILE_NAME = "--file";
|
const QString FILE_NAME = "--file";
|
||||||
|
@ -211,8 +211,8 @@ void SvoViewer::init() {
|
||||||
|
|
||||||
void SvoViewer::initializeGL()
|
void SvoViewer::initializeGL()
|
||||||
{
|
{
|
||||||
int argc = 0;
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
int argc = 0;
|
||||||
glutInit(&argc, 0);
|
glutInit(&argc, 0);
|
||||||
#endif
|
#endif
|
||||||
init();
|
init();
|
||||||
|
@ -585,13 +585,9 @@ void SvoViewer::keyReleaseEvent(QKeyEvent* event) {}
|
||||||
|
|
||||||
void SvoViewer::mouseMoveEvent(QMouseEvent* event)
|
void SvoViewer::mouseMoveEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
int deltaX = event->x() - _mouseX;
|
|
||||||
int deltaY = event->y() - _mouseY;
|
|
||||||
_mouseX = event->x();
|
_mouseX = event->x();
|
||||||
_mouseY = event->y();
|
_mouseY = event->y();
|
||||||
|
loadViewFrustum(_myCamera, _viewFrustum);
|
||||||
|
|
||||||
loadViewFrustum(_myCamera, _viewFrustum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SvoViewer::mousePressEvent(QMouseEvent* event)
|
void SvoViewer::mousePressEvent(QMouseEvent* event)
|
||||||
|
@ -639,8 +635,8 @@ bool SvoViewer::isVisibleBV(AABoundingVolume * volume, Camera * camera, ViewFrus
|
||||||
//if (pos.z >= volume->getBound(2,AABF_HIGH)) return false;
|
//if (pos.z >= volume->getBound(2,AABF_HIGH)) return false;
|
||||||
// Project all the points into screen space.
|
// Project all the points into screen space.
|
||||||
AA2DBoundingVolume twoDBounds;
|
AA2DBoundingVolume twoDBounds;
|
||||||
float xvals[2] = {9999.0, -1.0};
|
//float xvals[2] = {9999.0, -1.0};
|
||||||
float yvals[2] = {9999.0, -1.0};
|
//float yvals[2] = {9999.0, -1.0};
|
||||||
//project all bv points into screen space.
|
//project all bv points into screen space.
|
||||||
GLdouble scr[3];
|
GLdouble scr[3];
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
|
@ -660,8 +656,8 @@ bool SvoViewer::isVisibleBV(AABoundingVolume * volume, Camera * camera, ViewFrus
|
||||||
float SvoViewer::visibleAngleSubtended(AABoundingVolume * volume, Camera * camera, ViewFrustum * frustum)
|
float SvoViewer::visibleAngleSubtended(AABoundingVolume * volume, Camera * camera, ViewFrustum * frustum)
|
||||||
{
|
{
|
||||||
AA2DBoundingVolume twoDBounds;
|
AA2DBoundingVolume twoDBounds;
|
||||||
float xvals[2] = {9999.0, -1.0};
|
//float xvals[2] = {9999.0, -1.0};
|
||||||
float yvals[2] = {9999.0, -1.0};
|
//float yvals[2] = {9999.0, -1.0};
|
||||||
//project all bv points into screen space.
|
//project all bv points into screen space.
|
||||||
GLdouble scr[3];
|
GLdouble scr[3];
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SvoViewerConfig.h"
|
#include "svo-viewer-config.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
Loading…
Reference in a new issue