mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi
Conflicts: interface/src/Application.cpp
This commit is contained in:
commit
431bb0af1d
13 changed files with 51 additions and 23 deletions
|
@ -48,7 +48,7 @@
|
|||
#include <OctreeConstants.h>
|
||||
#include <PacketHeaders.h>
|
||||
#include <SharedUtil.h>
|
||||
#include <StdDev.h>
|
||||
#include <StDev.h>
|
||||
#include <UUID.h>
|
||||
|
||||
#include "AudioRingBuffer.h"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <NodeList.h>
|
||||
#include <PacketHeaders.h>
|
||||
#include <SharedUtil.h>
|
||||
#include <StdDev.h>
|
||||
#include <StDev.h>
|
||||
#include <UUID.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
|
|
@ -40,12 +40,12 @@
|
|||
#include <QByteArray>
|
||||
|
||||
#include <AbstractAudioInterface.h>
|
||||
#include <StdDev.h>
|
||||
#include <StDev.h>
|
||||
|
||||
#include "MixedProcessedAudioStream.h"
|
||||
#include "AudioEffectOptions.h"
|
||||
#include <AudioRingBuffer.h>
|
||||
#include <StdDev.h>
|
||||
#include <StDev.h>
|
||||
|
||||
extern "C" {
|
||||
#include <gverb.h>
|
||||
|
|
|
@ -90,6 +90,17 @@ Hair::Hair(int strands,
|
|||
}
|
||||
}
|
||||
|
||||
Hair::~Hair() {
|
||||
delete[] _hairPosition;
|
||||
delete[] _hairOriginalPosition;
|
||||
delete[] _hairLastPosition;
|
||||
delete[] _hairQuadDelta;
|
||||
delete[] _hairNormals;
|
||||
delete[] _hairColors;
|
||||
delete[] _hairIsMoveable;
|
||||
delete[] _hairConstraints;
|
||||
}
|
||||
|
||||
const float SOUND_THRESHOLD = 40.0f;
|
||||
|
||||
void Hair::simulate(float deltaTime) {
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
float radius = DEFAULT_HAIR_RADIUS,
|
||||
float linkLength = DEFAULT_HAIR_LINK_LENGTH,
|
||||
float hairThickness = DEFAULT_HAIR_THICKNESS);
|
||||
~Hair();
|
||||
void simulate(float deltaTime);
|
||||
void render();
|
||||
void setAcceleration(const glm::vec3& acceleration) { _acceleration = acceleration; }
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "SequenceNumberStats.h"
|
||||
#include "AudioStreamStats.h"
|
||||
#include "PacketHeaders.h"
|
||||
#include "StdDev.h"
|
||||
#include "StDev.h"
|
||||
#include "TimeWeightedAvg.h"
|
||||
|
||||
// This adds some number of frames to the desired jitter buffer frames target we use when we're dropping frames.
|
||||
|
|
|
@ -383,8 +383,8 @@ private:
|
|||
// NOTE: The following are pseudo client only properties. They are only used in clients which can access
|
||||
// properties of model geometry. But these properties are not serialized like other properties.
|
||||
QVector<SittingPoint> _sittingPoints;
|
||||
glm::vec3 _naturalDimensions;
|
||||
QStringList _textureNames;
|
||||
glm::vec3 _naturalDimensions;
|
||||
};
|
||||
Q_DECLARE_METATYPE(EntityItemProperties);
|
||||
QScriptValue EntityItemPropertiesToScriptValue(QScriptEngine* engine, const EntityItemProperties& properties);
|
||||
|
|
|
@ -547,11 +547,12 @@ void Octree::deleteOctalCodeFromTreeRecursion(OctreeElement* element, void* extr
|
|||
|
||||
void Octree::eraseAllOctreeElements(bool createNewRoot) {
|
||||
delete _rootElement; // this will recurse and delete all children
|
||||
_rootElement = NULL;
|
||||
|
||||
if (createNewRoot) {
|
||||
_rootElement = createNewElement();
|
||||
} else {
|
||||
_rootElement = NULL;
|
||||
}
|
||||
|
||||
_isDirty = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@ void OctreeElement::init(unsigned char * octalCode) {
|
|||
// set up the _children union
|
||||
_childBitmask = 0;
|
||||
_childrenExternal = false;
|
||||
|
||||
|
||||
|
||||
#ifdef BLENDED_UNION_CHILDREN
|
||||
_children.external = NULL;
|
||||
_singleChildrenCount++;
|
||||
|
@ -660,6 +661,11 @@ void OctreeElement::deleteAllChildren() {
|
|||
delete childAt;
|
||||
}
|
||||
}
|
||||
|
||||
if (_childrenExternal) {
|
||||
// if the children_t union represents _children.external we need to delete it here
|
||||
delete[] _children.external;
|
||||
}
|
||||
|
||||
#ifdef BLENDED_UNION_CHILDREN
|
||||
// now, reset our internal state and ANY and all population data
|
||||
|
@ -757,6 +763,8 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
|
|||
memset(_children.external, 0, sizeof(OctreeElement*) * NUMBER_OF_CHILDREN);
|
||||
_children.external[firstIndex] = previousChild;
|
||||
_children.external[childIndex] = child;
|
||||
|
||||
_childrenExternal = true;
|
||||
|
||||
_externalChildrenMemoryUsage += NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
|
||||
|
||||
|
@ -764,7 +772,10 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
|
|||
assert(!child); // we are removing a child, so this must be true!
|
||||
OctreeElement* previousFirstChild = _children.external[firstIndex];
|
||||
OctreeElement* previousSecondChild = _children.external[secondIndex];
|
||||
|
||||
delete[] _children.external;
|
||||
_childrenExternal = false;
|
||||
|
||||
_externalChildrenMemoryUsage -= NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
|
||||
if (childIndex == firstIndex) {
|
||||
_children.single = previousSecondChild;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// StdDev.cpp
|
||||
// StDev.cpp
|
||||
// libraries/shared/src
|
||||
//
|
||||
// Created by Philip Rosedale on 3/12/13.
|
||||
|
@ -11,16 +11,18 @@
|
|||
|
||||
#include <limits>
|
||||
#include <cmath>
|
||||
#include "StdDev.h"
|
||||
#include <cstring>
|
||||
|
||||
const int NUM_SAMPLES = 1000;
|
||||
#include "StDev.h"
|
||||
|
||||
StDev::StDev() {
|
||||
_data = new float[NUM_SAMPLES];
|
||||
_sampleCount = 0;
|
||||
StDev::StDev() :
|
||||
_sampleCount(0)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
void StDev::reset() {
|
||||
memset(&_data, 0, sizeof(_data));
|
||||
_sampleCount = 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// StdDev.h
|
||||
// StDev.h
|
||||
// libraries/shared/src
|
||||
//
|
||||
// Created by Philip Rosedale on 3/12/13.
|
||||
|
@ -9,8 +9,10 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_StdDev_h
|
||||
#define hifi_StdDev_h
|
||||
#ifndef hifi_StDev_h
|
||||
#define hifi_StDev_h
|
||||
|
||||
const int NUM_SAMPLES = 1000;
|
||||
|
||||
class StDev {
|
||||
public:
|
||||
|
@ -21,8 +23,8 @@ public:
|
|||
float getStDev() const;
|
||||
int getSamples() const { return _sampleCount; }
|
||||
private:
|
||||
float* _data;
|
||||
float _data[NUM_SAMPLES];
|
||||
int _sampleCount;
|
||||
};
|
||||
|
||||
#endif // hifi_StdDev_h
|
||||
#endif // hifi_StDev_h
|
|
@ -79,8 +79,8 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
uint32_t _glBufferIndex : 24, /// Client only, vbo index for this voxel if being rendered, 3 bytes
|
||||
_voxelSystemIndex : 8; /// Client only, index to the VoxelSystem rendering this voxel, 1 bytes
|
||||
uint32_t _glBufferIndex : 24; /// Client only, vbo index for this voxel if being rendered, 3 bytes
|
||||
uint32_t _voxelSystemIndex : 8; /// Client only, index to the VoxelSystem rendering this voxel, 1 bytes
|
||||
|
||||
// Support for _voxelSystemIndex, we use these static member variables to track the VoxelSystems that are
|
||||
// in use by various voxel nodes. We map the VoxelSystem pointers into an 1 byte key, this limits us to at
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <SequenceNumberStats.h>
|
||||
#include <SharedUtil.h> // for usecTimestampNow
|
||||
#include <SimpleMovingAverage.h>
|
||||
#include <StdDev.h>
|
||||
#include <StDev.h>
|
||||
|
||||
const quint64 MSEC_TO_USEC = 1000;
|
||||
const quint64 LARGE_STATS_TIME = 500; // we don't expect stats calculation to take more than this many usecs
|
||||
|
|
Loading…
Reference in a new issue