mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 16:18:37 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into actions
This commit is contained in:
commit
42f94307d5
11 changed files with 38 additions and 34 deletions
|
@ -12,7 +12,7 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
Script.include('lineRider.js')
|
Script.include('lineRider.js')
|
||||||
var MAX_POINTS_PER_LINE = 30;
|
var MAX_POINTS_PER_LINE = 80;
|
||||||
|
|
||||||
|
|
||||||
var colorPalette = [{
|
var colorPalette = [{
|
||||||
|
|
|
@ -336,7 +336,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
_enableProcessOctreeThread(true),
|
_enableProcessOctreeThread(true),
|
||||||
_octreeProcessor(),
|
_octreeProcessor(),
|
||||||
_nodeBoundsDisplay(this),
|
_nodeBoundsDisplay(this),
|
||||||
_applicationOverlay(),
|
|
||||||
_runningScriptsWidget(NULL),
|
_runningScriptsWidget(NULL),
|
||||||
_runningScriptsWidgetWasVisible(false),
|
_runningScriptsWidgetWasVisible(false),
|
||||||
_trayIcon(new QSystemTrayIcon(_window)),
|
_trayIcon(new QSystemTrayIcon(_window)),
|
||||||
|
@ -347,7 +346,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
_notifiedPacketVersionMismatchThisDomain(false),
|
_notifiedPacketVersionMismatchThisDomain(false),
|
||||||
_domainConnectionRefusals(QList<QString>()),
|
_domainConnectionRefusals(QList<QString>()),
|
||||||
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
|
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
|
||||||
_lastFaceTrackerUpdate(0)
|
_lastFaceTrackerUpdate(0),
|
||||||
|
_applicationOverlay()
|
||||||
{
|
{
|
||||||
setInstance(this);
|
setInstance(this);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
|
@ -14,7 +14,18 @@
|
||||||
|
|
||||||
#include "DeviceTracker.h"
|
#include "DeviceTracker.h"
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <glm/gtc/quaternion.hpp>
|
#include <glm/gtc/quaternion.hpp>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <glm/gtc/matrix_transform.hpp>
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
||||||
|
|
||||||
remapTextures();
|
remapTextures();
|
||||||
{
|
{
|
||||||
float alpha = getLocalRenderAlpha();
|
// float alpha = getLocalRenderAlpha();
|
||||||
|
|
||||||
if (!_model || _needsModelReload) {
|
if (!_model || _needsModelReload) {
|
||||||
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
||||||
|
|
|
@ -213,7 +213,7 @@ uint8_t RenderablePolyVoxEntityItem::getVoxel(int x, int y, int z) {
|
||||||
// if _voxelSurfaceStyle is SURFACE_EDGED_CUBIC, we maintain an extra layer of
|
// if _voxelSurfaceStyle is SURFACE_EDGED_CUBIC, we maintain an extra layer of
|
||||||
// voxels all around the requested voxel space. Having the empty voxels around
|
// voxels all around the requested voxel space. Having the empty voxels around
|
||||||
// the edges changes how the surface extractor behaves.
|
// the edges changes how the surface extractor behaves.
|
||||||
|
|
||||||
if (_voxelSurfaceStyle == SURFACE_EDGED_CUBIC) {
|
if (_voxelSurfaceStyle == SURFACE_EDGED_CUBIC) {
|
||||||
return _volData->getVoxelAt(x + 1, y + 1, z + 1);
|
return _volData->getVoxelAt(x + 1, y + 1, z + 1);
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ void RenderablePolyVoxEntityItem::updateOnCount(int x, int y, int z, uint8_t toV
|
||||||
if (!inUserBounds(_volData, _voxelSurfaceStyle, x, y, z)) {
|
if (!inUserBounds(_volData, _voxelSurfaceStyle, x, y, z)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t uVoxelValue = getVoxel(x, y, z);
|
uint8_t uVoxelValue = getVoxel(x, y, z);
|
||||||
if (toValue != 0) {
|
if (toValue != 0) {
|
||||||
if (uVoxelValue == 0) {
|
if (uVoxelValue == 0) {
|
||||||
|
@ -347,8 +347,8 @@ void RenderablePolyVoxEntityItem::getModel() {
|
||||||
sizeof(PolyVox::PositionMaterialNormal),
|
sizeof(PolyVox::PositionMaterialNormal),
|
||||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// auto normalAttrib = mesh->getAttributeBuffer(gpu::Stream::NORMAL);
|
// auto normalAttrib = mesh->getAttributeBuffer(gpu::Stream::NORMAL);
|
||||||
// for (auto normal = normalAttrib.begin<glm::vec3>(); normal != normalAttrib.end<glm::vec3>(); normal++) {
|
// for (auto normal = normalAttrib.begin<glm::vec3>(); normal != normalAttrib.end<glm::vec3>(); normal++) {
|
||||||
// (*normal) = -(*normal);
|
// (*normal) = -(*normal);
|
||||||
|
@ -363,7 +363,7 @@ void RenderablePolyVoxEntityItem::getModel() {
|
||||||
// gpu::Element(gpu::VEC2, gpu::FLOAT, gpu::RAW)));
|
// gpu::Element(gpu::VEC2, gpu::FLOAT, gpu::RAW)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef WANT_DEBUG
|
#ifdef WANT_DEBUG
|
||||||
qDebug() << "---- vecIndices.size() =" << vecIndices.size();
|
qDebug() << "---- vecIndices.size() =" << vecIndices.size();
|
||||||
qDebug() << "---- vecVertices.size() =" << vecVertices.size();
|
qDebug() << "---- vecVertices.size() =" << vecVertices.size();
|
||||||
|
@ -379,7 +379,7 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
if (_needsModelReload) {
|
if (_needsModelReload) {
|
||||||
getModel();
|
getModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform transform;
|
Transform transform;
|
||||||
transform.setTranslation(getPosition() - getRegistrationPoint() * getDimensions());
|
transform.setTranslation(getPosition() - getRegistrationPoint() * getDimensions());
|
||||||
transform.setRotation(getRotation());
|
transform.setRotation(getRotation());
|
||||||
|
@ -398,7 +398,7 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
mesh->getVertexBuffer()._stride);
|
mesh->getVertexBuffer()._stride);
|
||||||
batch.setIndexBuffer(gpu::UINT32, mesh->getIndexBuffer()._buffer, 0);
|
batch.setIndexBuffer(gpu::UINT32, mesh->getIndexBuffer()._buffer, 0);
|
||||||
batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
|
batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
|
||||||
|
|
||||||
RenderableDebugableEntityItem::render(this, args);
|
RenderableDebugableEntityItem::render(this, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,14 +448,13 @@ bool RenderablePolyVoxEntityItem::findDetailedRayIntersection(const glm::vec3& o
|
||||||
glm::vec3 normDirection = glm::normalize(direction);
|
glm::vec3 normDirection = glm::normalize(direction);
|
||||||
|
|
||||||
// the PolyVox ray intersection code requires a near and far point.
|
// the PolyVox ray intersection code requires a near and far point.
|
||||||
glm::vec3 scale = getDimensions() / _voxelVolumeSize; // meters / voxel-units
|
// set ray cast length to long enough to cover all of the voxel space
|
||||||
// set ray cast length to long enough to cover all of the voxel space
|
|
||||||
float distanceToEntity = glm::distance(origin, getPosition());
|
float distanceToEntity = glm::distance(origin, getPosition());
|
||||||
float largestDimension = glm::max(getDimensions().x, getDimensions().y, getDimensions().z) * 2.0f;
|
float largestDimension = glm::max(getDimensions().x, getDimensions().y, getDimensions().z) * 2.0f;
|
||||||
glm::vec3 farPoint = origin + normDirection * (distanceToEntity + largestDimension);
|
glm::vec3 farPoint = origin + normDirection * (distanceToEntity + largestDimension);
|
||||||
glm::vec4 originInVoxel = wtvMatrix * glm::vec4(origin, 1.0f);
|
glm::vec4 originInVoxel = wtvMatrix * glm::vec4(origin, 1.0f);
|
||||||
glm::vec4 farInVoxel = wtvMatrix * glm::vec4(farPoint, 1.0f);
|
glm::vec4 farInVoxel = wtvMatrix * glm::vec4(farPoint, 1.0f);
|
||||||
|
|
||||||
PolyVox::Vector3DFloat startPoint(originInVoxel.x, originInVoxel.y, originInVoxel.z);
|
PolyVox::Vector3DFloat startPoint(originInVoxel.x, originInVoxel.y, originInVoxel.z);
|
||||||
PolyVox::Vector3DFloat endPoint(farInVoxel.x, farInVoxel.y, farInVoxel.z);
|
PolyVox::Vector3DFloat endPoint(farInVoxel.x, farInVoxel.y, farInVoxel.z);
|
||||||
|
|
||||||
|
@ -479,7 +478,7 @@ bool RenderablePolyVoxEntityItem::findDetailedRayIntersection(const glm::vec3& o
|
||||||
}
|
}
|
||||||
|
|
||||||
result -= glm::vec4(0.5f, 0.5f, 0.5f, 0.0f);
|
result -= glm::vec4(0.5f, 0.5f, 0.5f, 0.0f);
|
||||||
|
|
||||||
glm::vec4 intersectedWorldPosition = voxelToWorldMatrix() * result;
|
glm::vec4 intersectedWorldPosition = voxelToWorldMatrix() * result;
|
||||||
|
|
||||||
distance = glm::distance(glm::vec3(intersectedWorldPosition), origin);
|
distance = glm::distance(glm::vec3(intersectedWorldPosition), origin);
|
||||||
|
@ -556,9 +555,9 @@ void RenderablePolyVoxEntityItem::decompressVolumeData() {
|
||||||
<< voxelXSize << voxelYSize << voxelZSize;
|
<< voxelXSize << voxelYSize << voxelZSize;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rawSize = voxelXSize * voxelYSize * voxelZSize;
|
int rawSize = voxelXSize * voxelYSize * voxelZSize;
|
||||||
|
|
||||||
QByteArray compressedData;
|
QByteArray compressedData;
|
||||||
reader >> compressedData;
|
reader >> compressedData;
|
||||||
QByteArray uncompressedData = qUncompress(compressedData);
|
QByteArray uncompressedData = qUncompress(compressedData);
|
||||||
|
@ -635,9 +634,6 @@ void RenderablePolyVoxEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||||
float offL = -0.5f;
|
float offL = -0.5f;
|
||||||
float offH = 0.5f;
|
float offH = 0.5f;
|
||||||
|
|
||||||
// float offL = 0.0f;
|
|
||||||
// float offH = 1.0f;
|
|
||||||
|
|
||||||
glm::vec3 p000 = glm::vec3(wToM * glm::vec4(x + offL, y + offL, z + offL, 1.0f));
|
glm::vec3 p000 = glm::vec3(wToM * glm::vec4(x + offL, y + offL, z + offL, 1.0f));
|
||||||
glm::vec3 p001 = glm::vec3(wToM * glm::vec4(x + offL, y + offL, z + offH, 1.0f));
|
glm::vec3 p001 = glm::vec3(wToM * glm::vec4(x + offL, y + offL, z + offH, 1.0f));
|
||||||
glm::vec3 p010 = glm::vec3(wToM * glm::vec4(x + offL, y + offH, z + offL, 1.0f));
|
glm::vec3 p010 = glm::vec3(wToM * glm::vec4(x + offL, y + offH, z + offL, 1.0f));
|
||||||
|
|
|
@ -191,8 +191,8 @@ void RenderableWebEntityItem::render(RenderArgs* args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderableWebEntityItem::setSourceUrl(const QString& value) {
|
void RenderableWebEntityItem::setSourceUrl(const QString& value) {
|
||||||
qDebug() << "Setting web entity source URL to " << value;
|
|
||||||
if (_sourceUrl != value) {
|
if (_sourceUrl != value) {
|
||||||
|
qDebug() << "Setting web entity source URL to " << value;
|
||||||
_sourceUrl = value;
|
_sourceUrl = value;
|
||||||
if (_webSurface) {
|
if (_webSurface) {
|
||||||
AbstractViewStateInterface::instance()->postLambdaEvent([this] {
|
AbstractViewStateInterface::instance()->postLambdaEvent([this] {
|
||||||
|
|
|
@ -86,6 +86,7 @@ bool LineEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
|
|
||||||
void LineEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
|
void LineEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
|
||||||
QVector<glm::vec3> sanitizedPoints;
|
QVector<glm::vec3> sanitizedPoints;
|
||||||
|
int invalidPoints = 0;
|
||||||
for (int i = 0; i < points.size(); i++) {
|
for (int i = 0; i < points.size(); i++) {
|
||||||
glm::vec3 point = points.at(i);
|
glm::vec3 point = points.at(i);
|
||||||
// Make sure all of our points are valid numbers.
|
// Make sure all of our points are valid numbers.
|
||||||
|
@ -93,9 +94,12 @@ void LineEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
|
||||||
if (point.x > 0 && point.y > 0 && point.z > 0){
|
if (point.x > 0 && point.y > 0 && point.z > 0){
|
||||||
sanitizedPoints << point;
|
sanitizedPoints << point;
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "INVALID POINT";
|
++invalidPoints;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (invalidPoints > 0) {
|
||||||
|
qDebug() << "Line with" << invalidPoints << "INVALID POINTS";
|
||||||
|
}
|
||||||
_points = sanitizedPoints;
|
_points = sanitizedPoints;
|
||||||
_pointsChanged = true;
|
_pointsChanged = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -605,9 +605,6 @@ const int NUM_BYTES_STUN_HEADER = 20;
|
||||||
|
|
||||||
void LimitedNodeList::sendSTUNRequest() {
|
void LimitedNodeList::sendSTUNRequest() {
|
||||||
|
|
||||||
static quint64 lastTimeStamp = usecTimestampNow();
|
|
||||||
lastTimeStamp = usecTimestampNow();
|
|
||||||
|
|
||||||
const int NUM_INITIAL_STUN_REQUESTS_BEFORE_FAIL = 10;
|
const int NUM_INITIAL_STUN_REQUESTS_BEFORE_FAIL = 10;
|
||||||
|
|
||||||
if (!_hasCompletedInitialSTUN) {
|
if (!_hasCompletedInitialSTUN) {
|
||||||
|
|
|
@ -78,8 +78,8 @@ Model::Model(QObject* parent) :
|
||||||
_showTrueJointTransforms(true),
|
_showTrueJointTransforms(true),
|
||||||
_lodDistance(0.0f),
|
_lodDistance(0.0f),
|
||||||
_pupilDilation(0.0f),
|
_pupilDilation(0.0f),
|
||||||
_isVisible(true),
|
|
||||||
_url("http://invalid.com"),
|
_url("http://invalid.com"),
|
||||||
|
_isVisible(true),
|
||||||
_blendNumber(0),
|
_blendNumber(0),
|
||||||
_appliedBlendNumber(0),
|
_appliedBlendNumber(0),
|
||||||
_calculatedMeshPartBoxesValid(false),
|
_calculatedMeshPartBoxesValid(false),
|
||||||
|
@ -913,8 +913,6 @@ bool Model::addToScene(std::shared_ptr<render::Scene> scene, render::PendingChan
|
||||||
|
|
||||||
bool somethingAdded = false;
|
bool somethingAdded = false;
|
||||||
|
|
||||||
qDebug() << "Model::addToScene : " << this->getURL().toString();
|
|
||||||
|
|
||||||
// allow the attachments to add to scene
|
// allow the attachments to add to scene
|
||||||
foreach (Model* attachment, _attachments) {
|
foreach (Model* attachment, _attachments) {
|
||||||
bool attachementSomethingAdded = attachment->addToScene(scene, pendingChanges);
|
bool attachementSomethingAdded = attachment->addToScene(scene, pendingChanges);
|
||||||
|
@ -954,7 +952,6 @@ void Model::removeFromScene(std::shared_ptr<render::Scene> scene, render::Pendin
|
||||||
}
|
}
|
||||||
_renderItems.clear();
|
_renderItems.clear();
|
||||||
_readyWhenAdded = false;
|
_readyWhenAdded = false;
|
||||||
qDebug() << "Model::removeFromScene : " << this->getURL().toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Model::render(RenderArgs* renderArgs, float alpha) {
|
bool Model::render(RenderArgs* renderArgs, float alpha) {
|
||||||
|
@ -2118,8 +2115,8 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran
|
||||||
}
|
}
|
||||||
|
|
||||||
Locations* locations = nullptr;
|
Locations* locations = nullptr;
|
||||||
pickPrograms(batch, mode, translucent, alphaThreshold, hasLightmap, hasTangents, hasSpecular, isSkinned, wireframe,
|
pickPrograms(batch, mode, translucentMesh, alphaThreshold, hasLightmap, hasTangents, hasSpecular, isSkinned, wireframe,
|
||||||
args, locations);
|
args, locations);
|
||||||
|
|
||||||
updateVisibleJointStates();
|
updateVisibleJointStates();
|
||||||
|
|
||||||
|
|
|
@ -312,8 +312,7 @@ protected:
|
||||||
float getLimbLength(int jointIndex) const;
|
float getLimbLength(int jointIndex) const;
|
||||||
|
|
||||||
/// Allow sub classes to force invalidating the bboxes
|
/// Allow sub classes to force invalidating the bboxes
|
||||||
void invalidCalculatedMeshBoxes() {
|
void invalidCalculatedMeshBoxes() {
|
||||||
qDebug() << "invalidCalculatedMeshBoxes()";
|
|
||||||
_calculatedMeshBoxesValid = false;
|
_calculatedMeshBoxesValid = false;
|
||||||
_calculatedMeshPartBoxesValid = false;
|
_calculatedMeshPartBoxesValid = false;
|
||||||
_calculatedMeshTrianglesValid = false;
|
_calculatedMeshTrianglesValid = false;
|
||||||
|
|
|
@ -174,7 +174,7 @@ void render::renderItems(const SceneContextPointer& sceneContext, const RenderCo
|
||||||
auto& scene = sceneContext->_scene;
|
auto& scene = sceneContext->_scene;
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
// render
|
// render
|
||||||
if ((maxDrawnItems < 0) || (maxDrawnItems > inItems.size())) {
|
if ((maxDrawnItems < 0) || (maxDrawnItems > (int) inItems.size())) {
|
||||||
for (auto itemDetails : inItems) {
|
for (auto itemDetails : inItems) {
|
||||||
auto item = scene->getItem(itemDetails.id);
|
auto item = scene->getItem(itemDetails.id);
|
||||||
item.render(args);
|
item.render(args);
|
||||||
|
|
Loading…
Reference in a new issue