mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:18:52 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into temp0
This commit is contained in:
commit
6cb1cbdee9
3 changed files with 12 additions and 23 deletions
|
@ -99,26 +99,17 @@ EntityItemProperties::EntityItemProperties() :
|
||||||
_cutoffChanged(false),
|
_cutoffChanged(false),
|
||||||
|
|
||||||
_defaultSettings(true),
|
_defaultSettings(true),
|
||||||
_sittingPoints(NULL),
|
|
||||||
_naturalDimensions(1.0f, 1.0f, 1.0f)
|
_naturalDimensions(1.0f, 1.0f, 1.0f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemProperties::~EntityItemProperties() {
|
EntityItemProperties::~EntityItemProperties() {
|
||||||
if (_sittingPoints) {
|
|
||||||
delete _sittingPoints;
|
|
||||||
_sittingPoints = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItemProperties::setSittingPoints(const QVector<SittingPoint>& sittingPoints) {
|
void EntityItemProperties::setSittingPoints(const QVector<SittingPoint>& sittingPoints) {
|
||||||
if (!_sittingPoints) {
|
_sittingPoints.clear();
|
||||||
_sittingPoints = new QVector<SittingPoint>;
|
|
||||||
}
|
|
||||||
_sittingPoints->clear();
|
|
||||||
|
|
||||||
foreach (SittingPoint sitPoint, sittingPoints) {
|
foreach (SittingPoint sitPoint, sittingPoints) {
|
||||||
_sittingPoints->append(sitPoint);
|
_sittingPoints.append(sitPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,18 +213,14 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine) cons
|
||||||
|
|
||||||
// Sitting properties support
|
// Sitting properties support
|
||||||
QScriptValue sittingPoints = engine->newObject();
|
QScriptValue sittingPoints = engine->newObject();
|
||||||
if (_sittingPoints) {
|
for (int i = 0; i < _sittingPoints.size(); ++i) {
|
||||||
for (int i = 0; i < _sittingPoints->size(); ++i) {
|
QScriptValue sittingPoint = engine->newObject();
|
||||||
QScriptValue sittingPoint = engine->newObject();
|
sittingPoint.setProperty("name", _sittingPoints.at(i).name);
|
||||||
sittingPoint.setProperty("name", _sittingPoints->at(i).name);
|
sittingPoint.setProperty("position", vec3toScriptValue(engine, _sittingPoints.at(i).position));
|
||||||
sittingPoint.setProperty("position", vec3toScriptValue(engine, _sittingPoints->at(i).position));
|
sittingPoint.setProperty("rotation", quatToScriptValue(engine, _sittingPoints.at(i).rotation));
|
||||||
sittingPoint.setProperty("rotation", quatToScriptValue(engine, _sittingPoints->at(i).rotation));
|
sittingPoints.setProperty(i, sittingPoint);
|
||||||
sittingPoints.setProperty(i, sittingPoint);
|
|
||||||
}
|
|
||||||
sittingPoints.setProperty("length", _sittingPoints->size());
|
|
||||||
} else {
|
|
||||||
sittingPoints.setProperty("length", 0);
|
|
||||||
}
|
}
|
||||||
|
sittingPoints.setProperty("length", _sittingPoints.size());
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(sittingPoints, sittingPoints); // gettable, but not settable
|
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(sittingPoints, sittingPoints); // gettable, but not settable
|
||||||
|
|
||||||
AABox aaBox = getAABoxInMeters();
|
AABox aaBox = getAABoxInMeters();
|
||||||
|
|
|
@ -362,7 +362,7 @@ private:
|
||||||
|
|
||||||
// NOTE: The following are pseudo client only properties. They are only used in clients which can access
|
// 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.
|
// properties of model geometry. But these properties are not serialized like other properties.
|
||||||
QVector<SittingPoint>* _sittingPoints;
|
QVector<SittingPoint> _sittingPoints;
|
||||||
glm::vec3 _naturalDimensions;
|
glm::vec3 _naturalDimensions;
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(EntityItemProperties);
|
Q_DECLARE_METATYPE(EntityItemProperties);
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#define getpid _getpid
|
#define getpid _getpid
|
||||||
#define getppid _getpid // hack to build
|
#define getppid _getpid // hack to build
|
||||||
#define pid_t int // hack to build
|
#define pid_t int // hack to build
|
||||||
|
#else
|
||||||
|
#include <unistd.h> // for getpid() on linux
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
Loading…
Reference in a new issue