Merge branch 'master' into feature/hand-controller-web-entity-integration

This commit is contained in:
Anthony J. Thibault 2016-08-22 14:13:17 -07:00
commit d015c5cfb5
151 changed files with 1375 additions and 945 deletions

View file

@ -66,6 +66,9 @@ else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-strict-aliasing -Wno-unused-parameter")
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -Woverloaded-virtual -Wdouble-promotion")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.1") # gcc 5.1 and on have suggest-override
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
endif ()
endif ()
endif(WIN32)

View file

@ -52,10 +52,10 @@ public:
float getLastReceivedAudioLoudness() const { return _lastReceivedAudioLoudness; }
QUuid getSessionUUID() const;
virtual void aboutToFinish();
virtual void aboutToFinish() override;
public slots:
void run();
void run() override;
void playAvatarSound(SharedSoundPointer avatarSound) { setAvatarSound(avatarSound); }
private slots:

View file

@ -24,27 +24,27 @@ public:
AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
virtual ~AssignmentAction();
virtual void removeFromSimulation(EntitySimulationPointer simulation) const;
virtual EntityItemWeakPointer getOwnerEntity() const { return _ownerEntity; }
virtual void setOwnerEntity(const EntityItemPointer ownerEntity) { _ownerEntity = ownerEntity; }
virtual bool updateArguments(QVariantMap arguments);
virtual QVariantMap getArguments();
virtual void removeFromSimulation(EntitySimulationPointer simulation) const override;
virtual EntityItemWeakPointer getOwnerEntity() const override { return _ownerEntity; }
virtual void setOwnerEntity(const EntityItemPointer ownerEntity) override { _ownerEntity = ownerEntity; }
virtual bool updateArguments(QVariantMap arguments) override;
virtual QVariantMap getArguments() override;
virtual QByteArray serialize() const;
virtual void deserialize(QByteArray serializedArguments);
virtual QByteArray serialize() const override;
virtual void deserialize(QByteArray serializedArguments) override;
private:
QByteArray _data;
protected:
virtual glm::vec3 getPosition();
virtual void setPosition(glm::vec3 position);
virtual glm::quat getRotation();
virtual void setRotation(glm::quat rotation);
virtual glm::vec3 getLinearVelocity();
virtual void setLinearVelocity(glm::vec3 linearVelocity);
virtual glm::vec3 getAngularVelocity();
virtual void setAngularVelocity(glm::vec3 angularVelocity);
virtual glm::vec3 getPosition() override;
virtual void setPosition(glm::vec3 position) override;
virtual glm::quat getRotation() override;
virtual void setRotation(glm::quat rotation) override;
virtual glm::vec3 getLinearVelocity() override;
virtual void setLinearVelocity(glm::vec3 linearVelocity) override;
virtual glm::vec3 getAngularVelocity() override;
virtual void setAngularVelocity(glm::vec3 angularVelocity) override;
bool _active;
EntityItemWeakPointer _ownerEntity;

View file

@ -22,8 +22,8 @@ public:
virtual EntityActionPointer factory(EntityActionType type,
const QUuid& id,
EntityItemPointer ownerEntity,
QVariantMap arguments);
virtual EntityActionPointer factoryBA(EntityItemPointer ownerEntity, QByteArray data);
QVariantMap arguments) override;
virtual EntityActionPointer factoryBA(EntityItemPointer ownerEntity, QByteArray data) override;
};
#endif // hifi_AssignmentActionFactory_h

View file

@ -26,7 +26,7 @@ public:
AssetServer(ReceivedMessage& message);
public slots:
void run();
void run() override;
private slots:
void completeSetup();
@ -35,9 +35,9 @@ private slots:
void handleAssetGet(QSharedPointer<ReceivedMessage> packet, SharedNodePointer senderNode);
void handleAssetUpload(QSharedPointer<ReceivedMessage> packetList, SharedNodePointer senderNode);
void handleAssetMappingOperation(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);
void sendStatsPacket();
void sendStatsPacket() override;
private:
using Mappings = QVariantHash;

View file

@ -27,7 +27,7 @@ class SendAssetTask : public QRunnable {
public:
SendAssetTask(QSharedPointer<ReceivedMessage> message, const SharedNodePointer& sendToNode, const QDir& resourcesDir);
void run();
void run() override;
private:
QSharedPointer<ReceivedMessage> _message;

View file

@ -27,9 +27,9 @@ class Node;
class UploadAssetTask : public QRunnable {
public:
UploadAssetTask(QSharedPointer<ReceivedMessage> message, QSharedPointer<Node> senderNode, const QDir& resourcesDir);
void run();
void run() override;
private:
QSharedPointer<ReceivedMessage> _receivedMessage;
QSharedPointer<Node> _senderNode;

View file

@ -35,9 +35,9 @@ public:
public slots:
/// threaded run of assignment
void run();
void run() override;
void sendStatsPacket();
void sendStatsPacket() override;
static const InboundAudioStream::Settings& getStreamSettings() { return _streamSettings; }

View file

@ -49,17 +49,17 @@ public:
// removes an AudioHRTF object for a given stream
void removeHRTFForStream(const QUuid& nodeID, const QUuid& streamID = QUuid());
int parseData(ReceivedMessage& message);
int parseData(ReceivedMessage& message) override;
void checkBuffersBeforeFrameSend();
void removeDeadInjectedStreams();
QJsonObject getAudioStreamStats();
void sendAudioStreamStatsPackets(const SharedNodePointer& destinationNode);
void incrementOutgoingMixedAudioSequenceNumber() { _outgoingMixedAudioSequenceNumber++; }
quint16 getOutgoingSequenceNumber() const { return _outgoingMixedAudioSequenceNumber; }

View file

@ -25,7 +25,7 @@ private:
AvatarAudioStream(const AvatarAudioStream&);
AvatarAudioStream& operator= (const AvatarAudioStream&);
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples);
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) override;
};
#endif // hifi_AvatarAudioStream_h

View file

@ -27,11 +27,11 @@ public:
~AvatarMixer();
public slots:
/// runs the avatar mixer
void run();
void run() override;
void nodeKilled(SharedNodePointer killedNode);
void sendStatsPacket();
void sendStatsPacket() override;
private slots:
void handleAvatarDataPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);
@ -45,14 +45,14 @@ private slots:
private:
void broadcastAvatarData();
void parseDomainServerSettings(const QJsonObject& domainSettings);
QThread _broadcastThread;
p_high_resolution_clock::time_point _lastFrameTimestamp;
float _trailingSleepRatio { 1.0f };
float _performanceThrottlingRatio { 0.0f };
int _sumListeners { 0 };
int _numStatFrames { 0 };
int _sumIdentityPackets { 0 };

View file

@ -25,7 +25,8 @@ class AssignmentParentFinder : public SpatialParentFinder {
public:
AssignmentParentFinder(EntityTreePointer tree) : _tree(tree) { }
virtual ~AssignmentParentFinder() { }
virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, SpatialParentTree* entityTree = nullptr) const;
virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success,
SpatialParentTree* entityTree = nullptr) const override;
protected:
EntityTreePointer _tree;

View file

@ -18,7 +18,7 @@
class EntityNodeData : public OctreeQueryNode {
public:
virtual PacketType getMyPacketType() const { return PacketType::EntityData; }
virtual PacketType getMyPacketType() const override { return PacketType::EntityData; }
quint64 getLastDeletedEntitiesSentAt() const { return _lastDeletedEntitiesSentAt; }
void setLastDeletedEntitiesSentAt(quint64 sentAt) { _lastDeletedEntitiesSentAt = sentAt; }

View file

@ -24,9 +24,9 @@ public:
MessagesMixer(ReceivedMessage& message);
public slots:
void run();
void run() override;
void nodeKilled(SharedNodePointer killedNode);
void sendStatsPacket();
void sendStatsPacket() override;
private slots:
void handleMessages(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);

View file

@ -74,15 +74,15 @@ public:
NodeToSenderStatsMap getSingleSenderStats() { QReadLocker locker(&_senderStatsLock); return _singleSenderStats; }
virtual void terminating() { _shuttingDown = true; ReceivedPacketProcessor::terminating(); }
virtual void terminating() override { _shuttingDown = true; ReceivedPacketProcessor::terminating(); }
protected:
virtual void processPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
virtual void processPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) override;
virtual unsigned long getMaxWait() const;
virtual void preProcess();
virtual void midProcess();
virtual unsigned long getMaxWait() const override;
virtual void preProcess() override;
virtual void midProcess() override;
private:
int sendNackPackets();

View file

@ -47,7 +47,7 @@ public:
protected:
/// Implements generic processing behavior for this thread.
virtual bool process();
virtual bool process() override;
private:
int handlePacketSend(SharedNodePointer node, OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent, bool dontSuppressDuplicate = false);

View file

@ -1063,6 +1063,12 @@ void OctreeServer::readConfiguration() {
_wantBackup = !noBackup;
qDebug() << "wantBackup=" << _wantBackup;
if (!readOptionString("backupDirectoryPath", settingsSectionObject, _backupDirectoryPath)) {
_backupDirectoryPath = "";
}
qDebug() << "backupDirectoryPath=" << _backupDirectoryPath;
readOptionBool(QString("persistFileDownload"), settingsSectionObject, _persistFileDownload);
qDebug() << "persistFileDownload=" << _persistFileDownload;
@ -1160,25 +1166,25 @@ void OctreeServer::domainSettingsRequestComplete() {
// If persist filename does not exist, let's see if there is one beside the application binary
// If there is, let's copy it over to our target persist directory
QDir persistPath { _persistFilePath };
QString absoluteFilePath = persistPath.absolutePath();
QString persistAbsoluteFilePath = persistPath.absolutePath();
if (persistPath.isRelative()) {
// if the domain settings passed us a relative path, make an absolute path that is relative to the
// default data directory
absoluteFilePath = QDir(ServerPathUtils::getDataFilePath("entities/")).absoluteFilePath(_persistFilePath);
persistAbsoluteFilePath = QDir(ServerPathUtils::getDataFilePath("entities/")).absoluteFilePath(_persistFilePath);
}
static const QString ENTITY_PERSIST_EXTENSION = ".json.gz";
// force the persist file to end with .json.gz
if (!absoluteFilePath.endsWith(ENTITY_PERSIST_EXTENSION, Qt::CaseInsensitive)) {
absoluteFilePath += ENTITY_PERSIST_EXTENSION;
if (!persistAbsoluteFilePath.endsWith(ENTITY_PERSIST_EXTENSION, Qt::CaseInsensitive)) {
persistAbsoluteFilePath += ENTITY_PERSIST_EXTENSION;
} else {
// make sure the casing of .json.gz is correct
absoluteFilePath.replace(ENTITY_PERSIST_EXTENSION, ENTITY_PERSIST_EXTENSION, Qt::CaseInsensitive);
persistAbsoluteFilePath.replace(ENTITY_PERSIST_EXTENSION, ENTITY_PERSIST_EXTENSION, Qt::CaseInsensitive);
}
if (!QFile::exists(absoluteFilePath)) {
if (!QFile::exists(persistAbsoluteFilePath)) {
qDebug() << "Persist file does not exist, checking for existence of persist file next to application";
static const QString OLD_DEFAULT_PERSIST_FILENAME = "resources/models.json.gz";
@ -1204,7 +1210,7 @@ void OctreeServer::domainSettingsRequestComplete() {
pathToCopyFrom = oldDefaultPersistPath;
}
QDir persistFileDirectory { QDir::cleanPath(absoluteFilePath + "/..") };
QDir persistFileDirectory { QDir::cleanPath(persistAbsoluteFilePath + "/..") };
if (!persistFileDirectory.exists()) {
qDebug() << "Creating data directory " << persistFileDirectory.absolutePath();
@ -1212,16 +1218,46 @@ void OctreeServer::domainSettingsRequestComplete() {
}
if (shouldCopy) {
qDebug() << "Old persist file found, copying from " << pathToCopyFrom << " to " << absoluteFilePath;
qDebug() << "Old persist file found, copying from " << pathToCopyFrom << " to " << persistAbsoluteFilePath;
QFile::copy(pathToCopyFrom, absoluteFilePath);
QFile::copy(pathToCopyFrom, persistAbsoluteFilePath);
} else {
qDebug() << "No existing persist file found";
}
}
auto persistFileDirectory = QFileInfo(persistAbsoluteFilePath).absolutePath();
if (_backupDirectoryPath.isEmpty()) {
// Use the persist file's directory to store backups
_backupDirectoryPath = persistFileDirectory;
} else {
// The backup directory has been set.
// If relative, make it relative to the entities directory in the application data directory
// If absolute, no resolution is necessary
QDir backupDirectory { _backupDirectoryPath };
QString absoluteBackupDirectory;
if (backupDirectory.isRelative()) {
absoluteBackupDirectory = QDir(ServerPathUtils::getDataFilePath("entities/")).absoluteFilePath(_backupDirectoryPath);
absoluteBackupDirectory = QDir(absoluteBackupDirectory).absolutePath();
} else {
absoluteBackupDirectory = backupDirectory.absolutePath();
}
backupDirectory = QDir(absoluteBackupDirectory);
if (!backupDirectory.exists()) {
if (backupDirectory.mkpath(".")) {
qDebug() << "Created backup directory";
} else {
qDebug() << "ERROR creating backup directory, using persist file directory";
_backupDirectoryPath = persistFileDirectory;
}
} else {
_backupDirectoryPath = absoluteBackupDirectory;
}
}
qDebug() << "Backups will be stored in: " << _backupDirectoryPath;
// now set up PersistThread
_persistThread = new OctreePersistThread(_tree, absoluteFilePath, _persistInterval,
_persistThread = new OctreePersistThread(_tree, persistAbsoluteFilePath, _backupDirectoryPath, _persistInterval,
_wantBackup, _settings, _debugTimestampNow, _persistAsFileType);
_persistThread->initialize(true);
}

View file

@ -120,16 +120,16 @@ public:
static int howManyThreadsDidHandlePacketSend(quint64 since = 0);
static int howManyThreadsDidCallWriteDatagram(quint64 since = 0);
bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler);
bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) override;
virtual void aboutToFinish();
virtual void aboutToFinish() override;
public slots:
/// runs the octree server assignment
void run();
void run() override;
virtual void nodeAdded(SharedNodePointer node);
virtual void nodeKilled(SharedNodePointer node);
void sendStatsPacket();
void sendStatsPacket() override;
private slots:
void domainSettingsRequestComplete();
@ -172,6 +172,7 @@ protected:
QString _persistFilePath;
QString _persistAsFileType;
QString _backupDirectoryPath;
int _packetsPerClientPerInterval;
int _packetsTotalPerInterval;
OctreePointer _tree; // this IS a reaveraging tree

View file

@ -1108,6 +1108,14 @@
"default": "models.json.gz",
"advanced": true
},
{
"name": "backupDirectoryPath",
"label": "Entities Backup Directory Path",
"help": "The path to the directory to store backups in.<br/>If this path is relative it will be relative to the application data directory.",
"placeholder": "",
"default": "",
"advanced": true
},
{
"name": "persistInterval",
"label": "Save Check Interval",

View file

@ -509,9 +509,7 @@ bool DomainGatekeeper::verifyUserSignature(const QString& username,
}
} else {
if (!senderSockAddr.isNull()) {
qDebug() << "Insufficient data to decrypt username signature - denying connection.";
sendConnectionDeniedPacket("Insufficient data", senderSockAddr,
DomainHandler::ConnectionRefusedReason::LoginError);
qDebug() << "Insufficient data to decrypt username signature - delaying connection.";
}
}

View file

@ -50,8 +50,8 @@ public:
static int const EXIT_CODE_REBOOT;
bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false);
bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false);
bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false) override;
bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false) override;
public slots:
/// Called by NodeList to inform us a node has been added

View file

@ -22,7 +22,11 @@
},
{ "from": "OculusTouch.LT", "to": "Standard.LT" },
{ "from": "OculusTouch.LS", "to": "Standard.LS" },
{ "from": "OculusTouch.LeftGrip", "to": "Standard.LeftGrip" },
{ "from": "OculusTouch.LeftGrip", "to": "Standard.LTClick",
"peek": true,
"filters": [ { "type": "hysteresis", "min": 0.85, "max": 0.9 } ]
},
{ "from": "OculusTouch.LeftGrip", "to": "Standard.LT" },
{ "from": "OculusTouch.LeftHand", "to": "Standard.LeftHand" },
{ "from": "OculusTouch.RY", "to": "Standard.RY",
@ -38,7 +42,11 @@
},
{ "from": "OculusTouch.RT", "to": "Standard.RT" },
{ "from": "OculusTouch.RS", "to": "Standard.RS" },
{ "from": "OculusTouch.RightGrip", "to": "Standard.RightGrip" },
{ "from": "OculusTouch.RightGrip", "to": "Standard.LTClick",
"peek": true,
"filters": [ { "type": "hysteresis", "min": 0.85, "max": 0.9 } ]
},
{ "from": "OculusTouch.RightGrip", "to": "Standard.RT" },
{ "from": "OculusTouch.RightHand", "to": "Standard.RightHand" },
{ "from": "OculusTouch.LeftApplicationMenu", "to": "Standard.Back" },
@ -59,4 +67,3 @@
]
}

View file

@ -11,7 +11,7 @@
[
{ "type": "deadZone", "min": 0.15 },
"constrainToInteger",
{ "type": "pulse", "interval": 0.5 },
{ "type": "pulse", "interval": 0.25 },
{ "type": "scale", "scale": 22.5 }
]
},

View file

@ -4,8 +4,8 @@
{ "from": "Vive.LY", "when": "Vive.LSY", "filters": ["invert"], "to": "Standard.LY" },
{ "from": "Vive.LX", "when": "Vive.LSX", "to": "Standard.LX" },
{
"from": "Vive.LT", "to": "Standard.LT",
"filters": [
"from": "Vive.LT", "to": "Standard.LT",
"filters": [
{ "type": "deadZone", "min": 0.05 }
]
},
@ -18,8 +18,8 @@
{ "from": "Vive.RY", "when": "Vive.RSY", "filters": ["invert"], "to": "Standard.RY" },
{ "from": "Vive.RX", "when": "Vive.RSX", "to": "Standard.RX" },
{
"from": "Vive.RT", "to": "Standard.RT",
"filters": [
"from": "Vive.RT", "to": "Standard.RT",
"filters": [
{ "type": "deadZone", "min": 0.05 }
]
},
@ -37,4 +37,4 @@
{ "from": "Vive.LeftHand", "to": "Standard.LeftHand" },
{ "from": "Vive.RightHand", "to": "Standard.RightHand" }
]
}
}

View file

@ -48,7 +48,7 @@ Item {
}
}
MenuItem {
InfoItem {
id: mainTextContainer
anchors {
top: parent.top

View file

@ -78,7 +78,7 @@ Item {
placeholderText: "Choose your own"
}
MenuItem {
InfoItem {
id: termsContainer
anchors {
top: textField.bottom

View file

@ -44,7 +44,7 @@ Item {
}
}
MenuItem {
InfoItem {
id: mainTextContainer
anchors {
top: parent.top

View file

@ -1,5 +1,5 @@
//
// MenuItem.qml
// InfoItem.qml
//
// Created by Clement on 7/18/16
// Copyright 2016 High Fidelity, Inc.

View file

@ -1091,10 +1091,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
static int SEND_STATS_INTERVAL_MS = 10000;
static int NEARBY_AVATAR_RADIUS_METERS = 10;
static glm::vec3 lastAvatarPosition = getMyAvatar()->getPosition();
static glm::mat4 lastHMDHeadPose = getHMDSensorPose();
static controller::Pose lastLeftHandPose = getMyAvatar()->getLeftHandPose();
static controller::Pose lastRightHandPose = getMyAvatar()->getRightHandPose();
// Periodically send fps as a user activity event
QTimer* sendStatsTimer = new QTimer(this);
sendStatsTimer->setInterval(SEND_STATS_INTERVAL_MS);
connect(sendStatsTimer, &QTimer::timeout, this, [this]() {
QJsonObject properties = {};
MemoryInfo memInfo;
if (getMemoryInfo(memInfo)) {
@ -1136,6 +1142,31 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
properties["throttled"] = _displayPlugin ? _displayPlugin->isThrottled() : false;
glm::vec3 avatarPosition = getMyAvatar()->getPosition();
properties["avatar_has_moved"] = lastAvatarPosition != avatarPosition;
lastAvatarPosition = avatarPosition;
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
auto entityActivityTracking = entityScriptingInterface->getActivityTracking();
entityScriptingInterface->resetActivityTracking();
properties["added_entity_cnt"] = entityActivityTracking.addedEntityCount;
properties["deleted_entity_cnt"] = entityActivityTracking.deletedEntityCount;
properties["edited_entity_cnt"] = entityActivityTracking.editedEntityCount;
auto hmdHeadPose = getHMDSensorPose();
properties["hmd_head_pose_changed"] = isHMDMode() && (hmdHeadPose != lastHMDHeadPose);
lastHMDHeadPose = hmdHeadPose;
auto leftHandPose = getMyAvatar()->getLeftHandPose();
auto rightHandPose = getMyAvatar()->getRightHandPose();
// controller::Pose considers two poses to be different if either are invalid. In our case, we actually
// want to consider the pose to be unchanged if it was invalid and still is invalid, so we check that first.
properties["hand_pose_changed"] =
((leftHandPose.valid || lastLeftHandPose.valid) && (leftHandPose != lastLeftHandPose))
|| ((rightHandPose.valid || lastRightHandPose.valid) && (rightHandPose != lastRightHandPose));
lastLeftHandPose = leftHandPose;
lastRightHandPose = rightHandPose;
UserActivityLogger::getInstance().logAction("stats", properties);
});
sendStatsTimer->start();
@ -1190,6 +1221,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
_defaultSkybox->setCubemap(_defaultSkyboxTexture);
_defaultSkybox->setColor({ 1.0, 1.0, 1.0 });
EntityItem::setEntitiesShouldFadeFunction([this]() {
SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
return entityServerNode && !isPhysicsEnabled();
});
// After all of the constructor is completed, then set firstRun to false.
Setting::Handle<bool> firstRun{ Settings::firstRun, true };
firstRun.set(false);
@ -4273,6 +4309,21 @@ namespace render {
auto backgroundMode = skyStage->getBackgroundMode();
switch (backgroundMode) {
case model::SunSkyStage::SKY_DEFAULT: {
static const glm::vec3 DEFAULT_SKYBOX_COLOR{ 255.0f / 255.0f, 220.0f / 255.0f, 194.0f / 255.0f };
static const float DEFAULT_SKYBOX_INTENSITY{ 0.2f };
static const float DEFAULT_SKYBOX_AMBIENT_INTENSITY{ 2.0f };
static const glm::vec3 DEFAULT_SKYBOX_DIRECTION{ 0.0f, 0.0f, -1.0f };
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
auto sceneKeyLight = scene->getKeyLight();
scene->setSunModelEnable(false);
sceneKeyLight->setColor(DEFAULT_SKYBOX_COLOR);
sceneKeyLight->setIntensity(DEFAULT_SKYBOX_INTENSITY);
sceneKeyLight->setAmbientIntensity(DEFAULT_SKYBOX_AMBIENT_INTENSITY);
sceneKeyLight->setDirection(DEFAULT_SKYBOX_DIRECTION);
// fall through: render a skybox, if available
}
case model::SunSkyStage::SKY_BOX: {
auto skybox = skyStage->getSkybox();
if (skybox) {
@ -4280,33 +4331,22 @@ namespace render {
skybox->render(batch, args->getViewFrustum());
break;
}
// fall through: render defaults, if available
}
// Fall through: if no skybox is available, render the SKY_DOME
case model::SunSkyStage::SKY_DOME: {
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
static const glm::vec3 DEFAULT_SKYBOX_COLOR { 255.0f / 255.0f, 220.0f / 255.0f, 194.0f / 255.0f };
static const float DEFAULT_SKYBOX_INTENSITY { 0.2f };
static const float DEFAULT_SKYBOX_AMBIENT_INTENSITY { 2.0f };
static const glm::vec3 DEFAULT_SKYBOX_DIRECTION { 0.0f, 0.0f, -1.0f };
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
auto sceneKeyLight = scene->getKeyLight();
scene->setSunModelEnable(false);
sceneKeyLight->setColor(DEFAULT_SKYBOX_COLOR);
sceneKeyLight->setIntensity(DEFAULT_SKYBOX_INTENSITY);
sceneKeyLight->setAmbientIntensity(DEFAULT_SKYBOX_AMBIENT_INTENSITY);
sceneKeyLight->setDirection(DEFAULT_SKYBOX_DIRECTION);
auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
qApp->getDefaultSkybox()->render(batch, args->getViewFrustum());
}
case model::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE: {
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
auto sceneKeyLight = scene->getKeyLight();
auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
// do not set the ambient sphere - it peaks too high, and causes flashing when turning
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
}
// fall through: render defaults, if available
}
break;
case model::SunSkyStage::SKY_DEFAULT_TEXTURE:
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
qApp->getDefaultSkybox()->render(batch, args->getViewFrustum());
}
case model::SunSkyStage::NO_BACKGROUND:
default:
// this line intentionally left blank
@ -4523,7 +4563,7 @@ void Application::clearDomainOctreeDetails() {
auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DOME);
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT);
_recentlyClearedDomain = true;
}

View file

@ -48,7 +48,7 @@ signals:
protected:
void rollFileIfNecessary(QFile& file, bool notifyListenersIfRolled = true);
virtual bool processQueueItems(const Queue& messages);
virtual bool processQueueItems(const Queue& messages) override;
private:
const FileLogger& _logger;

View file

@ -21,9 +21,9 @@ public:
virtual EntityActionPointer factory(EntityActionType type,
const QUuid& id,
EntityItemPointer ownerEntity,
QVariantMap arguments);
QVariantMap arguments) override;
virtual EntityActionPointer factoryBA(EntityItemPointer ownerEntity,
QByteArray data);
QByteArray data) override;
};
#endif // hifi_InterfaceActionFactory_h

View file

@ -21,7 +21,8 @@ class InterfaceParentFinder : public SpatialParentFinder {
public:
InterfaceParentFinder() { }
virtual ~InterfaceParentFinder() { }
virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, SpatialParentTree* entityTree = nullptr) const;
virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success,
SpatialParentTree* entityTree = nullptr) const override;
};
#endif // hifi_InterfaceParentFinder_h

View file

@ -24,23 +24,23 @@ class QPushButton;
class ModelSelector : public QDialog {
Q_OBJECT
public:
ModelSelector();
QFileInfo getFileInfo() const;
FSTReader::ModelType getModelType() const;
public slots:
virtual void accept();
virtual void accept() override;
private slots:
void browse();
private:
QFileInfo _modelFile;
QPushButton* _browseButton;
QComboBox* _modelType;
};
#endif // hifi_ModelSelector_h
#endif // hifi_ModelSelector_h

View file

@ -26,7 +26,7 @@ public:
};
protected:
void highlightBlock(const QString& text);
void highlightBlock(const QString& text) override;
void highlightKeywords(const QString& text);
void formatComments(const QString& text);
void formatQuotedText(const QString& text);

View file

@ -82,12 +82,12 @@ public:
void setDeltaRoll(float roll) { _deltaRoll = roll; }
float getDeltaRoll() const { return _deltaRoll; }
virtual void setFinalYaw(float finalYaw);
virtual void setFinalPitch(float finalPitch);
virtual void setFinalRoll(float finalRoll);
virtual float getFinalPitch() const;
virtual float getFinalYaw() const;
virtual float getFinalRoll() const;
virtual void setFinalYaw(float finalYaw) override;
virtual void setFinalPitch(float finalPitch) override;
virtual void setFinalRoll(float finalRoll) override;
virtual float getFinalPitch() const override;
virtual float getFinalYaw() const override;
virtual float getFinalRoll() const override;
void relax(float deltaTime);

View file

@ -516,13 +516,23 @@ glm::mat4 MyAvatar::getSensorToWorldMatrix() const {
return _sensorToWorldMatrixCache.get();
}
// As far as I know no HMD system supports a play area of a kilometer in radius.
static const float MAX_HMD_ORIGIN_DISTANCE = 1000.0f;
// Pass a recent sample of the HMD to the avatar.
// This can also update the avatar's position to follow the HMD
// as it moves through the world.
void MyAvatar::updateFromHMDSensorMatrix(const glm::mat4& hmdSensorMatrix) {
// update the sensorMatrices based on the new hmd pose
_hmdSensorMatrix = hmdSensorMatrix;
_hmdSensorPosition = extractTranslation(hmdSensorMatrix);
auto newHmdSensorPosition = extractTranslation(hmdSensorMatrix);
if (newHmdSensorPosition != _hmdSensorPosition &&
glm::length(newHmdSensorPosition) > MAX_HMD_ORIGIN_DISTANCE) {
qWarning() << "Invalid HMD sensor position " << newHmdSensorPosition;
// Ignore unreasonable HMD sensor data
return;
}
_hmdSensorPosition = newHmdSensorPosition;
_hmdSensorOrientation = glm::quat_cast(hmdSensorMatrix);
_hmdSensorFacing = getFacingDir2D(_hmdSensorOrientation);
}

View file

@ -27,26 +27,26 @@
class DdeFaceTracker : public FaceTracker, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY
public:
virtual void init();
virtual void reset();
virtual void update(float deltaTime);
virtual bool isActive() const;
virtual bool isTracking() const;
public:
virtual void init() override;
virtual void reset() override;
virtual void update(float deltaTime) override;
virtual bool isActive() const override;
virtual bool isTracking() const override;
float getLeftBlink() const { return getBlendshapeCoefficient(_leftBlinkIndex); }
float getRightBlink() const { return getBlendshapeCoefficient(_rightBlinkIndex); }
float getLeftEyeOpen() const { return getBlendshapeCoefficient(_leftEyeOpenIndex); }
float getRightEyeOpen() const { return getBlendshapeCoefficient(_rightEyeOpenIndex); }
float getBrowDownLeft() const { return getBlendshapeCoefficient(_browDownLeftIndex); }
float getBrowDownRight() const { return getBlendshapeCoefficient(_browDownRightIndex); }
float getBrowUpCenter() const { return getBlendshapeCoefficient(_browUpCenterIndex); }
float getBrowUpLeft() const { return getBlendshapeCoefficient(_browUpLeftIndex); }
float getBrowUpRight() const { return getBlendshapeCoefficient(_browUpRightIndex); }
float getMouthSize() const { return getBlendshapeCoefficient(_jawOpenIndex); }
float getMouthSmileLeft() const { return getBlendshapeCoefficient(_mouthSmileLeftIndex); }
float getMouthSmileRight() const { return getBlendshapeCoefficient(_mouthSmileRightIndex); }
@ -55,7 +55,7 @@ public:
void setEyeClosingThreshold(float eyeClosingThreshold);
public slots:
void setEnabled(bool enabled);
void setEnabled(bool enabled) override;
void calibrate();
private slots:
@ -77,18 +77,18 @@ private:
QHostAddress _host;
quint16 _serverPort;
quint16 _controlPort;
float getBlendshapeCoefficient(int index) const;
void decodePacket(const QByteArray& buffer);
// sockets
QUdpSocket _udpSocket;
quint64 _lastReceiveTimestamp;
bool _reset;
glm::vec3 _referenceTranslation;
glm::quat _referenceRotation;
int _leftBlinkIndex;
int _rightBlinkIndex;
int _leftEyeDownIndex;
@ -103,10 +103,10 @@ private:
int _browUpCenterIndex;
int _browUpLeftIndex;
int _browUpRightIndex;
int _mouthSmileLeftIndex;
int _mouthSmileRightIndex;
int _jawOpenIndex;
QVector<float> _coefficients;

View file

@ -34,12 +34,12 @@ class Faceshift : public FaceTracker, public Dependency {
public:
#ifdef HAVE_FACESHIFT
// If we don't have faceshift, use the base class' methods
virtual void init();
virtual void update(float deltaTime);
virtual void reset();
virtual void init() override;
virtual void update(float deltaTime) override;
virtual void reset() override;
virtual bool isActive() const;
virtual bool isTracking() const;
virtual bool isActive() const override;
virtual bool isTracking() const override;
#endif
bool isConnectedOrConnecting() const;
@ -49,7 +49,7 @@ public:
// these pitch/yaw angles are in degrees
float getEyeGazeLeftPitch() const { return _eyeGazeLeftPitch; }
float getEyeGazeLeftYaw() const { return _eyeGazeLeftYaw; }
float getEyeGazeRightPitch() const { return _eyeGazeRightPitch; }
float getEyeGazeRightYaw() const { return _eyeGazeRightYaw; }
@ -67,10 +67,10 @@ public:
float getMouthSize() const { return getBlendshapeCoefficient(_jawOpenIndex); }
float getMouthSmileLeft() const { return getBlendshapeCoefficient(_mouthSmileLeftIndex); }
float getMouthSmileRight() const { return getBlendshapeCoefficient(_mouthSmileRightIndex); }
QString getHostname() { return _hostname.get(); }
void setHostname(const QString& hostname);
void updateFakeCoefficients(float leftBlink,
float rightBlink,
float browUp,
@ -79,76 +79,76 @@ public:
float mouth3,
float mouth4,
QVector<float>& coefficients) const;
signals:
void connectionStateChanged();
public slots:
void setEnabled(bool enabled);
void setEnabled(bool enabled) override;
private slots:
void connectSocket();
void noteConnected();
void noteError(QAbstractSocket::SocketError error);
void readPendingDatagrams();
void readFromSocket();
void readFromSocket();
void noteDisconnected();
private:
Faceshift();
virtual ~Faceshift() {}
void send(const std::string& message);
void receive(const QByteArray& buffer);
QTcpSocket _tcpSocket;
QUdpSocket _udpSocket;
#ifdef HAVE_FACESHIFT
fs::fsBinaryStream _stream;
#endif
bool _tcpEnabled = true;
int _tcpRetryCount = 0;
bool _tracking = false;
quint64 _lastReceiveTimestamp = 0;
quint64 _lastMessageReceived = 0;
float _averageFrameTime = STARTING_FACESHIFT_FRAME_TIME;
glm::vec3 _headAngularVelocity = glm::vec3(0.0f);
glm::vec3 _headLinearVelocity = glm::vec3(0.0f);
glm::vec3 _lastHeadTranslation = glm::vec3(0.0f);
glm::vec3 _filteredHeadTranslation = glm::vec3(0.0f);
// degrees
float _eyeGazeLeftPitch = 0.0f;
float _eyeGazeLeftYaw = 0.0f;
float _eyeGazeRightPitch = 0.0f;
float _eyeGazeRightYaw = 0.0f;
// degrees
float _longTermAverageEyePitch = 0.0f;
float _longTermAverageEyeYaw = 0.0f;
bool _longTermAverageInitialized = false;
Setting::Handle<QString> _hostname;
// see http://support.faceshift.com/support/articles/35129-export-of-blendshapes
int _leftBlinkIndex = 0;
int _rightBlinkIndex = 1;
int _leftEyeOpenIndex = 8;
int _rightEyeOpenIndex = 9;
// Brows
int _browDownLeftIndex = 14;
int _browDownRightIndex = 15;
int _browUpCenterIndex = 16;
int _browUpLeftIndex = 17;
int _browUpRightIndex = 18;
int _mouthSmileLeftIndex = 28;
int _mouthSmileRightIndex = 29;
int _jawOpenIndex = 21;
};

View file

@ -33,7 +33,7 @@ public:
bool isActive() const { return _active; }
virtual void update();
virtual void update() override;
protected:
Leapmotion();

View file

@ -33,16 +33,16 @@ class InputController : public controller::InputController {
public:
InputController(int deviceTrackerId, int subTrackerId, QObject* parent = NULL);
virtual void update();
virtual Key getKey() const;
virtual void update() override;
virtual Key getKey() const override;
public slots:
virtual bool isActive() const { return _isActive; }
virtual glm::vec3 getAbsTranslation() const { return _eventCache.absTranslation; }
virtual glm::quat getAbsRotation() const { return _eventCache.absRotation; }
virtual glm::vec3 getLocTranslation() const { return _eventCache.locTranslation; }
virtual glm::quat getLocRotation() const { return _eventCache.locRotation; }
virtual bool isActive() const override { return _isActive; }
virtual glm::vec3 getAbsTranslation() const override { return _eventCache.absTranslation; }
virtual glm::quat getAbsRotation() const override { return _eventCache.absRotation; }
virtual glm::vec3 getLocTranslation() const override { return _eventCache.locTranslation; }
virtual glm::quat getLocRotation() const override { return _eventCache.locRotation; }
private:

View file

@ -66,7 +66,7 @@ signals:
void closed();
protected:
virtual bool eventFilter(QObject* sender, QEvent* event);
virtual bool eventFilter(QObject* sender, QEvent* event) override;
private slots:
void hasClosed();

View file

@ -36,13 +36,13 @@ public:
AudioStatsDisplay(QFormLayout* form, QString text, unsigned colorRGBA);
void updatedDisplay(QString str);
void paint();
private:
QString _strBuf;
QLabel* _label;
QString _text;
unsigned _colorRGBA;
};
//dialog
@ -51,9 +51,9 @@ class AudioStatsDialog : public QDialog {
public:
AudioStatsDialog(QWidget* parent);
~AudioStatsDialog();
void paintEvent(QPaintEvent*);
void paintEvent(QPaintEvent*) override;
private:
// audio stats methods for rendering
QVector<QString> _audioMixerStats;
@ -61,48 +61,47 @@ private:
QVector<QString> _upstreamMixerStats;
QVector<QString> _downstreamStats;
QVector<QString> _upstreamInjectedStats;
int _audioMixerID;
int _upstreamClientID;
int _upstreamMixerID;
int _downstreamID;
int _upstreamInjectedID;
QVector<QVector<AudioStatsDisplay*>> _audioDisplayChannels;
int addChannel(QFormLayout* form, QVector<QString>& stats, const unsigned color);
void updateStats(QVector<QString>& stats, const int channelID);
void renderStats();
void clearAllChannels();
void renderAudioStreamStats(const AudioStreamStats* streamStats, QVector<QString>* audioStreamstats, bool isDownstreamStats);
const AudioIOStats* _stats;
QFormLayout* _form;
bool _isEnabled;
bool _shouldShowInjectedStreams;
signals:
void closed();
public slots:
void reject();
void reject() override;
void updateTimerTimeout();
protected:
// Emits a 'closed' signal when this dialog is closed.
void closeEvent(QCloseEvent*);
void closeEvent(QCloseEvent*) override;
private:
QTimer* averageUpdateTimer = new QTimer(this);
};

View file

@ -57,7 +57,7 @@ public:
BandwidthDialog(QWidget* parent);
~BandwidthDialog();
void paintEvent(QPaintEvent*);
void paintEvent(QPaintEvent*) override;
private:
BandwidthChannelDisplay* _audioChannelDisplay;
@ -77,14 +77,14 @@ signals:
public slots:
void reject();
void reject() override;
void updateTimerTimeout();
protected:
// Emits a 'closed' signal when this dialog is closed.
void closeEvent(QCloseEvent*);
void closeEvent(QCloseEvent*) override;
private:
QTimer* averageUpdateTimer = new QTimer(this);

View file

@ -21,19 +21,19 @@ class CachesSizeDialog : public QDialog {
public:
// Sets up the UI
CachesSizeDialog(QWidget* parent);
signals:
void closed();
public slots:
void reject();
void reject() override;
void confirmClicked(bool checked);
void resetClicked(bool checked);
protected:
// Emits a 'closed' signal when this dialog is closed.
void closeEvent(QCloseEvent* event);
void closeEvent(QCloseEvent* event) override;
private:
QDoubleSpinBox* _animations = nullptr;
QDoubleSpinBox* _geometries = nullptr;
@ -42,4 +42,4 @@ private:
QDoubleSpinBox* _textures = nullptr;
};
#endif // hifi_CachesSizeDialog_h
#endif // hifi_CachesSizeDialog_h

View file

@ -18,9 +18,9 @@ class DataWebPage : public QWebPage {
public:
DataWebPage(QObject* parent = 0);
protected:
void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID);
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, QWebPage::NavigationType type);
virtual QString userAgentForUrl(const QUrl& url) const;
void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID) override;
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, QWebPage::NavigationType type) override;
virtual QString userAgentForUrl(const QUrl& url) const override;
};
#endif // hifi_DataWebPage_h

View file

@ -29,18 +29,18 @@ public:
QScreen* getLastApplicationScreen() const { return _previousScreen; }
bool hasHMDScreen() const { return _hmdScreenNumber >= -1; }
void watchWindow(QWindow* window);
signals:
void closed();
public slots:
void reject();
void reject() override;
void screenCountChanged(int newCount);
protected:
virtual void closeEvent(QCloseEvent*); // Emits a 'closed' signal when this dialog is closed.
virtual void showEvent(QShowEvent* event);
virtual void hideEvent(QHideEvent* event);
virtual void closeEvent(QCloseEvent*) override; // Emits a 'closed' signal when this dialog is closed.
virtual void showEvent(QShowEvent* event) override;
virtual void hideEvent(QHideEvent* event) override;
private:
void centerCursorOnWidget(QWidget* widget);
@ -59,7 +59,7 @@ private:
QScreen* _previousDialogScreen{ nullptr };
QString _hmdPluginName;
QString _defaultPluginName;
QHash<QWindow*, HMDWindowWatcher*> _windowWatchers;
friend class HMDWindowWatcher;
};
@ -75,7 +75,7 @@ public:
public slots:
void windowScreenChanged(QScreen* screen);
void windowGeometryChanged(int arg);
private:
QWindow* _window;
HMDToolsDialog* _hmdTools;

View file

@ -40,9 +40,9 @@ public slots:
protected:
void setAndSelectCommand(const QString& command);
virtual bool eventFilter(QObject* sender, QEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void showEvent(QShowEvent* event);
virtual bool eventFilter(QObject* sender, QEvent* event) override;
virtual void mouseReleaseEvent(QMouseEvent* event) override;
virtual void showEvent(QShowEvent* event) override;
protected slots:
void scrollToBottom();

View file

@ -24,12 +24,12 @@ class LodToolsDialog : public QDialog {
public:
// Sets up the UI
LodToolsDialog(QWidget* parent);
signals:
void closed();
public slots:
void reject();
void reject() override;
void sizeScaleValueChanged(int value);
void resetClicked(bool checked);
void reloadSliders();
@ -38,7 +38,7 @@ public slots:
protected:
// Emits a 'closed' signal when this dialog is closed.
void closeEvent(QCloseEvent* event);
void closeEvent(QCloseEvent* event) override;
private:
QSlider* _lodSize;

View file

@ -30,7 +30,7 @@ public:
QString keyword;
protected:
void highlightBlock(const QString &text);
void highlightBlock(const QString &text) override;
private:
QTextCharFormat keywordFormat;
@ -54,8 +54,8 @@ private slots:
void handleSearchTextChanged(const QString);
protected:
void resizeEvent(QResizeEvent*);
void showEvent(QShowEvent*);
void resizeEvent(QResizeEvent*) override;
void showEvent(QShowEvent*) override;
private:
QPushButton* _searchButton;

View file

@ -33,15 +33,15 @@ signals:
void closed();
public slots:
void reject();
void reject() override;
void moreless(const QString& link);
protected:
// State <- data model held by BandwidthMeter
void paintEvent(QPaintEvent*);
void paintEvent(QPaintEvent*) override;
// Emits a 'closed' signal when this dialog is closed.
void closeEvent(QCloseEvent*);
void closeEvent(QCloseEvent*) override;
int AddStatItem(const char* caption, unsigned colorRGBA = DEFAULT_COLOR);
void RemoveStatItem(int item);

View file

@ -24,7 +24,7 @@ public:
int lineNumberAreaWidth();
protected:
void resizeEvent(QResizeEvent* event);
void resizeEvent(QResizeEvent* event) override;
private slots:
void updateLineNumberAreaWidth(int blockCount);

View file

@ -35,8 +35,8 @@ signals:
void windowActivated();
protected:
void closeEvent(QCloseEvent* event);
virtual bool event(QEvent* event);
void closeEvent(QCloseEvent* event) override;
virtual bool event(QEvent* event) override;
private:
Ui::ScriptEditorWindow* _ScriptEditorWindowUI;

View file

@ -20,10 +20,10 @@ class ScriptLineNumberArea : public QWidget {
public:
ScriptLineNumberArea(ScriptEditBox* scriptEditBox);
QSize sizeHint() const;
QSize sizeHint() const override;
protected:
void paintEvent(QPaintEvent* event);
void paintEvent(QPaintEvent* event) override;
private:
ScriptEditBox* _scriptEditBox;

View file

@ -21,8 +21,8 @@ public:
explicit ScriptsTableWidget(QWidget* parent);
protected:
virtual void paintEvent(QPaintEvent* event);
virtual void keyPressEvent(QKeyEvent* event);
virtual void paintEvent(QPaintEvent* event) override;
virtual void keyPressEvent(QKeyEvent* event) override;
};
#endif // hifi__ScriptsTableWidget_h

View file

@ -23,6 +23,7 @@ Line3DOverlay::Line3DOverlay() :
Line3DOverlay::Line3DOverlay(const Line3DOverlay* line3DOverlay) :
Base3DOverlay(line3DOverlay),
_start(line3DOverlay->_start),
_end(line3DOverlay->_end),
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
{
@ -31,6 +32,40 @@ Line3DOverlay::Line3DOverlay(const Line3DOverlay* line3DOverlay) :
Line3DOverlay::~Line3DOverlay() {
}
glm::vec3 Line3DOverlay::getStart() const {
bool success;
glm::vec3 worldStart = localToWorld(_start, _parentID, _parentJointIndex, success);
if (!success) {
qDebug() << "Line3DOverlay::getStart failed";
}
return worldStart;
}
glm::vec3 Line3DOverlay::getEnd() const {
bool success;
glm::vec3 worldEnd = localToWorld(_end, _parentID, _parentJointIndex, success);
if (!success) {
qDebug() << "Line3DOverlay::getEnd failed";
}
return worldEnd;
}
void Line3DOverlay::setStart(const glm::vec3& start) {
bool success;
_start = worldToLocal(start, _parentID, _parentJointIndex, success);
if (!success) {
qDebug() << "Line3DOverlay::setStart failed";
}
}
void Line3DOverlay::setEnd(const glm::vec3& end) {
bool success;
_end = worldToLocal(end, _parentID, _parentJointIndex, success);
if (!success) {
qDebug() << "Line3DOverlay::setEnd failed";
}
}
AABox Line3DOverlay::getBounds() const {
auto extents = Extents{};
extents.addPoint(_start);
@ -76,8 +111,8 @@ const render::ShapeKey Line3DOverlay::getShapeKey() {
return builder.build();
}
void Line3DOverlay::setProperties(const QVariantMap& properties) {
Base3DOverlay::setProperties(properties);
void Line3DOverlay::setProperties(const QVariantMap& originalProperties) {
QVariantMap properties = originalProperties;
auto start = properties["start"];
// if "start" property was not there, check to see if they included aliases: startPoint
@ -87,6 +122,7 @@ void Line3DOverlay::setProperties(const QVariantMap& properties) {
if (start.isValid()) {
setStart(vec3FromVariant(start));
}
properties.remove("start"); // so that Base3DOverlay doesn't respond to it
auto end = properties["end"];
// if "end" property was not there, check to see if they included aliases: endPoint
@ -109,14 +145,16 @@ void Line3DOverlay::setProperties(const QVariantMap& properties) {
if (glowWidth.isValid()) {
setGlow(glowWidth.toFloat());
}
Base3DOverlay::setProperties(properties);
}
QVariant Line3DOverlay::getProperty(const QString& property) {
if (property == "start" || property == "startPoint" || property == "p1") {
return vec3toVariant(_start);
return vec3toVariant(getStart());
}
if (property == "end" || property == "endPoint" || property == "p2") {
return vec3toVariant(_end);
return vec3toVariant(getEnd());
}
return Base3DOverlay::getProperty(property);
@ -125,3 +163,8 @@ QVariant Line3DOverlay::getProperty(const QString& property) {
Line3DOverlay* Line3DOverlay::createClone() const {
return new Line3DOverlay(this);
}
void Line3DOverlay::locationChanged(bool tellPhysics) {
// do nothing
}

View file

@ -28,14 +28,15 @@ public:
virtual AABox getBounds() const override;
// getters
const glm::vec3& getStart() const { return _start; }
const glm::vec3& getEnd() const { return _end; }
glm::vec3 getStart() const;
glm::vec3 getEnd() const;
const float& getGlow() const { return _glow; }
const float& getGlowWidth() const { return _glowWidth; }
// setters
void setStart(const glm::vec3& start) { _start = start; }
void setEnd(const glm::vec3& end) { _end = end; }
void setStart(const glm::vec3& start);
void setEnd(const glm::vec3& end);
void setGlow(const float& glow) { _glow = glow; }
void setGlowWidth(const float& glowWidth) { _glowWidth = glowWidth; }
@ -44,6 +45,8 @@ public:
virtual Line3DOverlay* createClone() const override;
virtual void locationChanged(bool tellPhysics = true) override;
protected:
glm::vec3 _start;
glm::vec3 _end;

View file

@ -20,15 +20,15 @@ class LocalModelsOverlay : public Volume3DOverlay {
Q_OBJECT
public:
static QString const TYPE;
virtual QString getType() const { return TYPE; }
virtual QString getType() const override { return TYPE; }
LocalModelsOverlay(EntityTreeRenderer* entityTreeRenderer);
LocalModelsOverlay(const LocalModelsOverlay* localModelsOverlay);
virtual void update(float deltatime);
virtual void render(RenderArgs* args);
virtual LocalModelsOverlay* createClone() const;
virtual void update(float deltatime) override;
virtual void render(RenderArgs* args) override;
virtual LocalModelsOverlay* createClone() const override;
private:
EntityTreeRenderer* _entityTreeRenderer;

View file

@ -62,7 +62,7 @@ public:
void setProperties(const QVariantMap& properties);
QVariant getProperty(const QString& property);
virtual void applyTransformTo(Transform& transform, bool force = false);
virtual void applyTransformTo(Transform& transform, bool force = false) override;
private:
Transform _anchorTransform;

View file

@ -14,14 +14,13 @@
class RectangleOverlay : public QmlOverlay {
public:
static QString const TYPE;
virtual QString getType() const { return TYPE; }
virtual QString getType() const override { return TYPE; }
static QUrl const URL;
RectangleOverlay();
RectangleOverlay(const RectangleOverlay* RectangleOverlay);
virtual RectangleOverlay* createClone() const;
virtual RectangleOverlay* createClone() const override;
};
#endif // hifi_RectangleOverlay_h

View file

@ -34,9 +34,9 @@ public:
Q_INVOKABLE AnimationPointer getAnimation(const QUrl& url);
protected:
virtual QSharedPointer<Resource> createResource(const QUrl& url, const QSharedPointer<Resource>& fallback,
const void* extra);
const void* extra) override;
private:
explicit AnimationCache(QObject* parent = NULL);
virtual ~AnimationCache() { }
@ -82,7 +82,7 @@ class AnimationReader : public QObject, public QRunnable {
public:
AnimationReader(const QUrl& url, const QByteArray& data);
virtual void run();
virtual void run() override;
signals:
void onSuccess(FBXGeometry::Pointer geometry);

View file

@ -86,7 +86,7 @@ public:
using Mutex = std::mutex;
using Lock = std::unique_lock<Mutex>;
class AudioOutputIODevice : public QIODevice {
public:
AudioOutputIODevice(MixedProcessedAudioStream& receivedAudioStream, AudioClient* audio) :
@ -94,8 +94,8 @@ public:
void start() { open(QIODevice::ReadOnly); }
void stop() { close(); }
qint64 readData(char * data, qint64 maxSize);
qint64 writeData(const char * data, qint64 maxSize) { return 0; }
qint64 readData(char * data, qint64 maxSize) override;
qint64 writeData(const char * data, qint64 maxSize) override { return 0; }
int getRecentUnfulfilledReads() { int unfulfilledReads = _unfulfilledReads; _unfulfilledReads = 0; return unfulfilledReads; }
private:
MixedProcessedAudioStream& _receivedAudioStream;
@ -136,7 +136,7 @@ public:
void setPositionGetter(AudioPositionGetter positionGetter) { _positionGetter = positionGetter; }
void setOrientationGetter(AudioOrientationGetter orientationGetter) { _orientationGetter = orientationGetter; }
QVector<AudioInjector*>& getActiveLocalAudioInjectors() { return _activeLocalAudioInjectors; }
static const float CALLBACK_ACCELERATOR_RATIO;
@ -163,7 +163,7 @@ public slots:
void audioMixerKilled();
void toggleMute();
virtual void setIsStereoInput(bool stereo);
virtual void setIsStereoInput(bool stereo) override;
void toggleAudioNoiseReduction() { _isNoiseGateEnabled = !_isNoiseGateEnabled; }
@ -175,7 +175,7 @@ public slots:
int setOutputBufferSize(int numFrames, bool persist = true);
virtual bool outputLocalInjector(bool isStereo, AudioInjector* injector);
virtual bool outputLocalInjector(bool isStereo, AudioInjector* injector) override;
bool switchInputToAudioDevice(const QString& inputDeviceName);
bool switchOutputToAudioDevice(const QString& outputDeviceName);
@ -215,7 +215,7 @@ protected:
AudioClient();
~AudioClient();
virtual void customDeleter() {
virtual void customDeleter() override {
deleteLater();
}
@ -316,7 +316,7 @@ private:
void checkDevices();
bool _hasReceivedFirstPacket = false;
QVector<AudioInjector*> _activeLocalAudioInjectors;
CodecPluginPointer _codec;

View file

@ -20,27 +20,27 @@ class AudioInjectorLocalBuffer : public QIODevice {
Q_OBJECT
public:
AudioInjectorLocalBuffer(const QByteArray& rawAudioArray, QObject* parent);
void stop();
bool seek(qint64 pos);
qint64 readData(char* data, qint64 maxSize);
qint64 writeData(const char* data, qint64 maxSize) { return 0; }
bool seek(qint64 pos) override;
qint64 readData(char* data, qint64 maxSize) override;
qint64 writeData(const char* data, qint64 maxSize) override { return 0; }
void setShouldLoop(bool shouldLoop) { _shouldLoop = shouldLoop; }
void setCurrentOffset(int currentOffset) { _currentOffset = currentOffset; }
void setVolume(float volume) { _volume = glm::clamp(volume, 0.0f, 1.0f); }
private:
qint64 recursiveReadFromFront(char* data, qint64 maxSize);
QByteArray _rawAudioArray;
bool _shouldLoop;
bool _isStopped;
int _currentOffset;
float _volume;
};
#endif // hifi_AudioInjectorLocalBuffer_h
#endif // hifi_AudioInjectorLocalBuffer_h

View file

@ -567,7 +567,7 @@ class LimiterMono : public LimiterImpl {
public:
LimiterMono(int sampleRate) : LimiterImpl(sampleRate) {}
void process(float* input, int16_t* output, int numFrames);
void process(float* input, int16_t* output, int numFrames) override;
};
template<int N>
@ -619,7 +619,7 @@ public:
LimiterStereo(int sampleRate) : LimiterImpl(sampleRate) {}
// interleaved stereo input/output
void process(float* input, int16_t* output, int numFrames);
void process(float* input, int16_t* output, int numFrames) override;
};
template<int N>

View file

@ -22,7 +22,7 @@ public:
MixedProcessedAudioStream(int numFrameSamples, int numFramesCapacity, const InboundAudioStream::Settings& settings);
signals:
void addedSilence(int silentSamplesPerChannel);
void addedLastFrameRepeatedWithFade(int samplesPerChannel);
void addedStereoSamples(const QByteArray& samples);
@ -33,9 +33,9 @@ public:
void outputFormatChanged(int outputFormatChannelCountTimesSampleRate);
protected:
int writeDroppableSilentSamples(int silentSamples);
int writeLastFrameRepeatedWithFade(int samples);
int parseAudioData(PacketType type, const QByteArray& packetAfterStreamProperties);
int writeDroppableSilentSamples(int silentSamples) override;
int writeLastFrameRepeatedWithFade(int samples) override;
int parseAudioData(PacketType type, const QByteArray& packetAfterStreamProperties) override;
private:
int networkToDeviceSamples(int networkSamples);

View file

@ -32,9 +32,9 @@ public:
const QUuid DEFAULT_STREAM_IDENTIFIER = QUuid();
virtual const QUuid& getStreamIdentifier() const { return DEFAULT_STREAM_IDENTIFIER; }
virtual void resetStats();
virtual void resetStats() override;
virtual AudioStreamStats getAudioStreamStats() const;
virtual AudioStreamStats getAudioStreamStats() const override;
void updateLastPopOutputLoudnessAndTrailingLoudness();
float getLastPopOutputTrailingLoudness() const { return _lastPopOutputTrailingLoudness; }
@ -46,7 +46,7 @@ public:
PositionalAudioStream::Type getType() const { return _type; }
const glm::vec3& getPosition() const { return _position; }
const glm::quat& getOrientation() const { return _orientation; }
protected:
// disallow copying of PositionalAudioStream objects

View file

@ -23,12 +23,12 @@ class SoundCache : public ResourceCache, public Dependency {
public:
Q_INVOKABLE SharedSoundPointer getSound(const QUrl& url);
protected:
virtual QSharedPointer<Resource> createResource(const QUrl& url, const QSharedPointer<Resource>& fallback,
const void* extra);
const void* extra) override;
private:
SoundCache(QObject* parent = NULL);
};
#endif // hifi_SoundCache_h
#endif // hifi_SoundCache_h

View file

@ -24,11 +24,11 @@ public:
: Endpoint(Input::INVALID_INPUT), _callable(callable) {
}
virtual float peek() const {
virtual float peek() const override {
return (float)const_cast<JSEndpoint*>(this)->_callable.call().toNumber();
}
virtual void apply(float newValue, const Pointer& source) {
virtual void apply(float newValue, const Pointer& source) override {
_callable.call(QJSValueList({ QJSValue(newValue) }));
}

View file

@ -305,7 +305,7 @@ void HmdDisplayPlugin::updateFrameData() {
{
vec2 xdir = glm::normalize(vec2(intersectionPosition.x, -intersectionPosition.z));
yawPitch.x = glm::atan(xdir.x, xdir.y);
yawPitch.y = (acosf(intersectionPosition.y) * -1.0f) + M_PI_2;
yawPitch.y = (acosf(intersectionPosition.y) * -1.0f) + (float)M_PI_2;
}
vec2 halfFov = CompositorHelper::VIRTUAL_UI_TARGET_FOV / 2.0f;

View file

@ -35,7 +35,7 @@ public:
/// Initializes the manager.
HTTPManager(const QHostAddress& listenAddress, quint16 port, const QString& documentRoot, HTTPRequestHandler* requestHandler = NULL, QObject* parent = 0);
bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false);
bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false) override;
private slots:
void isTcpServerListening();
@ -46,7 +46,7 @@ private:
protected:
/// Accepts all pending connections
virtual void incomingConnection(qintptr socketDescriptor);
virtual void incomingConnection(qintptr socketDescriptor) override;
virtual bool requestHandledByRequestHandler(HTTPConnection* connection, const QUrl& url);
QHostAddress _listenAddress;

View file

@ -346,15 +346,13 @@ void EntityTreeRenderer::applyZonePropertiesToScene(std::shared_ptr<ZoneEntityIt
auto sceneStage = scene->getStage();
auto skyStage = scene->getSkyStage();
auto sceneKeyLight = sceneStage->getKeyLight();
auto sceneLocation = sceneStage->getLocation();
auto sceneTime = sceneStage->getTime();
// Skybox and procedural skybox data
auto skybox = std::dynamic_pointer_cast<ProceduralSkybox>(skyStage->getSkybox());
static QString userData;
// If there is no zone, use the default background
if (!zone) {
userData = QString();
_zoneUserData = QString();
skybox->clear();
_pendingSkyboxTexture = false;
@ -363,50 +361,33 @@ void EntityTreeRenderer::applyZonePropertiesToScene(std::shared_ptr<ZoneEntityIt
_pendingAmbientTexture = false;
_ambientTexture.clear();
if (_hasPreviousZone) {
sceneKeyLight->resetAmbientSphere();
sceneKeyLight->setAmbientMap(nullptr);
sceneKeyLight->setColor(_previousKeyLightColor);
sceneKeyLight->setIntensity(_previousKeyLightIntensity);
sceneKeyLight->setAmbientIntensity(_previousKeyLightAmbientIntensity);
sceneKeyLight->setDirection(_previousKeyLightDirection);
sceneStage->setSunModelEnable(_previousStageSunModelEnabled);
sceneStage->setLocation(_previousStageLongitude, _previousStageLatitude,
_previousStageAltitude);
sceneTime->setHour(_previousStageHour);
sceneTime->setDay(_previousStageDay);
sceneKeyLight->resetAmbientSphere();
sceneKeyLight->setAmbientMap(nullptr);
_hasPreviousZone = false;
}
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DOME); // let the application background through
return; // Early exit
}
if (!_hasPreviousZone) {
_previousKeyLightColor = sceneKeyLight->getColor();
_previousKeyLightIntensity = sceneKeyLight->getIntensity();
_previousKeyLightAmbientIntensity = sceneKeyLight->getAmbientIntensity();
_previousKeyLightDirection = sceneKeyLight->getDirection();
_previousStageSunModelEnabled = sceneStage->isSunModelEnabled();
_previousStageLongitude = sceneLocation->getLongitude();
_previousStageLatitude = sceneLocation->getLatitude();
_previousStageAltitude = sceneLocation->getAltitude();
_previousStageHour = sceneTime->getHour();
_previousStageDay = sceneTime->getDay();
_hasPreviousZone = true;
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT);
return;
}
// Set the keylight
sceneKeyLight->setColor(ColorUtils::toVec3(zone->getKeyLightProperties().getColor()));
sceneKeyLight->setIntensity(zone->getKeyLightProperties().getIntensity());
sceneKeyLight->setAmbientIntensity(zone->getKeyLightProperties().getAmbientIntensity());
sceneKeyLight->setDirection(zone->getKeyLightProperties().getDirection());
sceneStage->setSunModelEnable(zone->getStageProperties().getSunModelEnabled());
sceneStage->setLocation(zone->getStageProperties().getLongitude(), zone->getStageProperties().getLatitude(),
zone->getStageProperties().getAltitude());
sceneTime->setHour(zone->getStageProperties().calculateHour());
sceneTime->setDay(zone->getStageProperties().calculateDay());
// Set the stage
bool isSunModelEnabled = zone->getStageProperties().getSunModelEnabled();
sceneStage->setSunModelEnable(isSunModelEnabled);
if (isSunModelEnabled) {
sceneStage->setLocation(zone->getStageProperties().getLongitude(),
zone->getStageProperties().getLatitude(),
zone->getStageProperties().getAltitude());
auto sceneTime = sceneStage->getTime();
sceneTime->setHour(zone->getStageProperties().calculateHour());
sceneTime->setDay(zone->getStageProperties().calculateDay());
}
// Set the ambient texture
bool isAmbientTextureSet = false;
if (zone->getKeyLightProperties().getAmbientURL().isEmpty()) {
_pendingAmbientTexture = false;
@ -429,12 +410,13 @@ void EntityTreeRenderer::applyZonePropertiesToScene(std::shared_ptr<ZoneEntityIt
}
}
// Set the skybox texture
switch (zone->getBackgroundMode()) {
case BACKGROUND_MODE_SKYBOX: {
skybox->setColor(zone->getSkyboxProperties().getColorVec3());
if (userData != zone->getUserData()) {
userData = zone->getUserData();
skybox->parse(userData);
if (_zoneUserData != zone->getUserData()) {
_zoneUserData = zone->getUserData();
skybox->parse(_zoneUserData);
}
if (zone->getSkyboxProperties().getURL().isEmpty()) {
skybox->setCubemap(nullptr);
@ -471,14 +453,18 @@ void EntityTreeRenderer::applyZonePropertiesToScene(std::shared_ptr<ZoneEntityIt
case BACKGROUND_MODE_INHERIT:
default:
// Clear the skybox to release its textures
userData = QString();
_zoneUserData = QString();
skybox->clear();
_skyboxTexture.clear();
_pendingSkyboxTexture = false;
// Let the application background through
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DOME);
if (isAmbientTextureSet) {
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT_TEXTURE);
} else {
skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE);
}
break;
}

View file

@ -45,10 +45,10 @@ public:
AbstractScriptingServicesInterface* scriptingServices);
virtual ~EntityTreeRenderer();
virtual char getMyNodeType() const { return NodeType::EntityServer; }
virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; }
virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; }
virtual void setTree(OctreePointer newTree);
virtual char getMyNodeType() const override { return NodeType::EntityServer; }
virtual PacketType getMyQueryMessageType() const override { return PacketType::EntityQuery; }
virtual PacketType getExpectedPacketType() const override { return PacketType::EntityData; }
virtual void setTree(OctreePointer newTree) override;
// Returns the priority at which an entity should be loaded. Higher values indicate higher priority.
float getEntityLoadingPriority(const EntityItem& item) const { return _calculateEntityLoadingPriorityFunc(item); }
@ -61,29 +61,29 @@ public:
void processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode);
virtual void init();
virtual void init() override;
virtual const FBXGeometry* getGeometryForEntity(EntityItemPointer entityItem) override;
virtual ModelPointer getModelForEntityItem(EntityItemPointer entityItem) override;
virtual const FBXGeometry* getCollisionGeometryForEntity(EntityItemPointer entityItem) override;
virtual const FBXGeometry* getGeometryForEntity(EntityItemPointer entityItem);
virtual ModelPointer getModelForEntityItem(EntityItemPointer entityItem);
virtual const FBXGeometry* getCollisionGeometryForEntity(EntityItemPointer entityItem);
/// clears the tree
virtual void clear();
virtual void clear() override;
/// reloads the entity scripts, calling unload and preload
void reloadEntityScripts();
/// if a renderable entity item needs a model, we will allocate it for them
Q_INVOKABLE ModelPointer allocateModel(const QString& url, const QString& collisionUrl, float loadingPriority = 0.0f);
/// if a renderable entity item needs to update the URL of a model, we will handle that for the entity
Q_INVOKABLE ModelPointer updateModel(ModelPointer original, const QString& newUrl, const QString& collisionUrl);
/// if a renderable entity item is done with a model, it should return it to us
void releaseModel(ModelPointer model);
void deleteReleasedModels();
// event handles which may generate entity related events
void mouseReleaseEvent(QMouseEvent* event);
void mousePressEvent(QMouseEvent* event);
@ -129,7 +129,7 @@ public slots:
void setDontDoPrecisionPicking(bool value) { _dontDoPrecisionPicking = value; }
protected:
virtual OctreePointer createTree() {
virtual OctreePointer createTree() override {
EntityTreePointer newTree = EntityTreePointer(new EntityTree(true));
newTree->createRootElement();
return newTree;
@ -181,15 +181,16 @@ private:
AbstractScriptingServicesInterface* _scriptingServices;
bool _displayModelBounds;
bool _dontDoPrecisionPicking;
bool _shuttingDown { false };
QMultiMap<QUrl, EntityItemID> _waitingOnPreload;
bool _hasPreviousZone { false };
std::shared_ptr<ZoneEntityItem> _bestZone;
float _bestZoneVolume;
QString _zoneUserData;
quint64 _lastZoneCheck { 0 };
const quint64 ZONE_CHECK_INTERVAL = USECS_PER_MSEC * 100; // ~10hz
const float ZONE_CHECK_DISTANCE = 0.001f;
@ -204,7 +205,7 @@ private:
float _previousStageAltitude;
float _previousStageHour;
int _previousStageDay;
QHash<EntityItemID, EntityItemPointer> _entitiesInScene;
// For Scene.shouldRenderEntities
QList<EntityItemID> _entityIDsLastInScene;

View file

@ -16,9 +16,9 @@ class AddEntityOperator : public RecurseOctreeOperator {
public:
AddEntityOperator(EntityTreePointer tree, EntityItemPointer newEntity);
virtual bool preRecursion(OctreeElementPointer element);
virtual bool postRecursion(OctreeElementPointer element);
virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex);
virtual bool preRecursion(OctreeElementPointer element) override;
virtual bool postRecursion(OctreeElementPointer element) override;
virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex) override;
private:
EntityTreePointer _tree;
EntityItemPointer _newEntity;

View file

@ -34,30 +34,33 @@ public:
void associateWithAnimationLoop(AnimationLoop* animationLoop) { _animationLoop = animationLoop; }
// EntityItemProperty related helpers
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties,
QScriptEngine* engine, bool skipDefaults,
EntityItemProperties& defaultEntityProperties) const override;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
virtual void debugDump() const override;
virtual void listChangedProperties(QList<QString>& out) override;
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
OctreeElement::AppendState& appendState) const override;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes);
virtual void markAllChanged();
virtual EntityPropertyFlags getChangedProperties() const;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags,
const unsigned char*& dataAt, int& processedBytes) override;
virtual void markAllChanged() override;
virtual EntityPropertyFlags getChangedProperties() const override;
// EntityItem related helpers
// methods for getting/setting all properties of an entity
virtual void getProperties(EntityItemProperties& propertiesOut) const;
virtual void getProperties(EntityItemProperties& propertiesOut) const override;
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties);
virtual bool setProperties(const EntityItemProperties& properties) override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
@ -65,12 +68,12 @@ public:
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
DEFINE_PROPERTY_REF(PROP_ANIMATION_URL, URL, url, QString, "");
DEFINE_PROPERTY(PROP_ANIMATION_FPS, FPS, fps, float, 30.0f);

View file

@ -36,8 +36,8 @@ public:
~DeleteEntityOperator();
void addEntityIDToDeleteList(const EntityItemID& searchEntityID);
virtual bool preRecursion(OctreeElementPointer element);
virtual bool postRecursion(OctreeElementPointer element);
virtual bool preRecursion(OctreeElementPointer element) override;
virtual bool postRecursion(OctreeElementPointer element) override;
const RemovedEntities& getEntities() const { return _entitiesToDelete; }
private:

View file

@ -42,8 +42,8 @@ public:
void queueEraseEntityMessage(const EntityItemID& entityItemID);
// My server type is the model server
virtual char getMyNodeType() const { return NodeType::EntityServer; }
virtual void adjustEditPacketForClockSkew(PacketType type, QByteArray& buffer, qint64 clockSkew);
virtual char getMyNodeType() const override { return NodeType::EntityServer; }
virtual void adjustEditPacketForClockSkew(PacketType type, QByteArray& buffer, qint64 clockSkew) override;
public slots:
void processEntityEditNackPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);

View file

@ -35,6 +35,7 @@
int EntityItem::_maxActionsDataSize = 800;
quint64 EntityItem::_rememberDeletedActionTime = 20 * USECS_PER_SECOND;
std::function<bool()> EntityItem::_entitiesShouldFadeFunction = [](){ return true; };
EntityItem::EntityItem(const EntityItemID& entityItemID) :
SpatiallyNestable(NestableType::Entity, entityItemID),

View file

@ -55,7 +55,7 @@ namespace render {
}
#define DONT_ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() = 0;
#define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() { };
#define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() override { };
#define debugTime(T, N) qPrintable(QString("%1 [ %2 ago]").arg(T, 16, 10).arg(formatUsecTime(N - T), 15))
#define debugTimeOnly(T) qPrintable(QString("%1").arg(T, 16, 10))
@ -434,6 +434,8 @@ public:
QUuid getOwningAvatarID() const { return _owningAvatarID; }
void setOwningAvatarID(const QUuid& owningAvatarID) { _owningAvatarID = owningAvatarID; }
static void setEntitiesShouldFadeFunction(std::function<bool()> func) { _entitiesShouldFadeFunction = func; }
static std::function<bool()> getEntitiesShouldFadeFunction() { return _entitiesShouldFadeFunction; }
virtual bool isTransparent() { return _isFading ? Interpolate::calculateFadeRatio(_fadeStartTime) < 1.0f : false; }
virtual bool wantsHandControllerPointerEvents() const { return false; }
@ -571,7 +573,8 @@ protected:
quint64 _lastUpdatedAccelerationTimestamp { 0 };
quint64 _fadeStartTime { usecTimestampNow() };
bool _isFading { true };
static std::function<bool()> _entitiesShouldFadeFunction;
bool _isFading { _entitiesShouldFadeFunction() };
};
#endif // hifi_EntityItem_h

View file

@ -40,6 +40,12 @@ void EntityScriptingInterface::queueEntityMessage(PacketType packetType,
getEntityPacketSender()->queueEditEntityMessage(packetType, _entityTree, entityID, properties);
}
void EntityScriptingInterface::resetActivityTracking() {
_activityTracking.addedEntityCount = 0;
_activityTracking.deletedEntityCount = 0;
_activityTracking.editedEntityCount = 0;
}
bool EntityScriptingInterface::canAdjustLocks() {
auto nodeList = DependencyManager::get<NodeList>();
return nodeList->isAllowedEditor();
@ -162,6 +168,8 @@ EntityItemProperties convertLocationFromScriptSemantics(const EntityItemProperti
QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties, bool clientOnly) {
_activityTracking.addedEntityCount++;
EntityItemProperties propertiesWithSimID = convertLocationFromScriptSemantics(properties);
propertiesWithSimID.setDimensionsInitialized(properties.dimensionsChanged());
@ -232,6 +240,8 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QString& modelUrl, const QString& shapeType,
bool dynamic, const glm::vec3& position, const glm::vec3& gravity) {
_activityTracking.addedEntityCount++;
EntityItemProperties properties;
properties.setType(EntityTypes::Model);
properties.setName(name);
@ -295,6 +305,8 @@ EntityItemProperties EntityScriptingInterface::getEntityProperties(QUuid identit
}
QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& scriptSideProperties) {
_activityTracking.editedEntityCount++;
EntityItemProperties properties = scriptSideProperties;
auto dimensions = properties.getDimensions();
@ -438,6 +450,8 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
}
void EntityScriptingInterface::deleteEntity(QUuid id) {
_activityTracking.deletedEntityCount++;
EntityItemID entityID(id);
bool shouldDelete = true;

View file

@ -67,14 +67,24 @@ class EntityScriptingInterface : public OctreeScriptingInterface, public Depende
public:
EntityScriptingInterface(bool bidOnSimulationOwnership);
class ActivityTracking {
public:
int addedEntityCount { 0 };
int deletedEntityCount { 0 };
int editedEntityCount { 0 };
};
EntityEditPacketSender* getEntityPacketSender() const { return (EntityEditPacketSender*)getPacketSender(); }
virtual NodeType_t getServerNodeType() const { return NodeType::EntityServer; }
virtual OctreeEditPacketSender* createPacketSender() { return new EntityEditPacketSender(); }
virtual NodeType_t getServerNodeType() const override { return NodeType::EntityServer; }
virtual OctreeEditPacketSender* createPacketSender() override { return new EntityEditPacketSender(); }
void setEntityTree(EntityTreePointer modelTree);
EntityTreePointer getEntityTree() { return _entityTree; }
void setEntitiesScriptEngine(EntitiesScriptEngineProvider* engine);
float calculateCost(float mass, float oldVelocity, float newVelocity);
void resetActivityTracking();
ActivityTracking getActivityTracking() const { return _activityTracking; }
public slots:
// returns true if the DomainServer will allow this Node/Avatar to make changes
@ -240,12 +250,13 @@ private:
std::recursive_mutex _entitiesScriptEngineLock;
EntitiesScriptEngineProvider* _entitiesScriptEngine { nullptr };
bool _bidOnSimulationOwnership { false };
float _currentAvatarEnergy = { FLT_MAX };
float getCurrentAvatarEnergy() { return _currentAvatarEnergy; }
void setCurrentAvatarEnergy(float energy);
ActivityTracking _activityTracking;
float costMultiplier = { 0.01f };
float getCostMultiplier();
void setCostMultiplier(float value);

View file

@ -1304,8 +1304,8 @@ void EntityTree::debugDumpMap() {
class ContentsDimensionOperator : public RecurseOctreeOperator {
public:
virtual bool preRecursion(OctreeElementPointer element);
virtual bool postRecursion(OctreeElementPointer element) { return true; }
virtual bool preRecursion(OctreeElementPointer element) override;
virtual bool postRecursion(OctreeElementPointer element) override { return true; }
glm::vec3 getDimensions() const { return _contentExtents.size(); }
float getLargestDimension() const { return _contentExtents.largestDimension(); }
private:
@ -1332,8 +1332,8 @@ float EntityTree::getContentsLargestDimension() {
class DebugOperator : public RecurseOctreeOperator {
public:
virtual bool preRecursion(OctreeElementPointer element);
virtual bool postRecursion(OctreeElementPointer element) { return true; }
virtual bool preRecursion(OctreeElementPointer element) override;
virtual bool postRecursion(OctreeElementPointer element) override { return true; }
};
bool DebugOperator::preRecursion(OctreeElementPointer element) {
@ -1350,8 +1350,8 @@ void EntityTree::dumpTree() {
class PruneOperator : public RecurseOctreeOperator {
public:
virtual bool preRecursion(OctreeElementPointer element) { return true; }
virtual bool postRecursion(OctreeElementPointer element);
virtual bool preRecursion(OctreeElementPointer element) override { return true; }
virtual bool postRecursion(OctreeElementPointer element) override;
};
bool PruneOperator::postRecursion(OctreeElementPointer element) {

View file

@ -80,7 +80,7 @@ class EntityTreeElement : public OctreeElement, ReadWriteLockable {
EntityTreeElement(unsigned char* octalCode = NULL);
virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL);
virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL) override;
public:
virtual ~EntityTreeElement();
@ -93,67 +93,69 @@ public:
// methods you can and should override to implement your tree functionality
/// Adds a child to the current element. Override this if there is additional child initialization your class needs.
virtual OctreeElementPointer addChildAtIndex(int index);
virtual OctreeElementPointer addChildAtIndex(int index) override;
/// Override this to implement LOD averaging on changes to the tree.
virtual void calculateAverageFromChildren();
virtual void calculateAverageFromChildren() override;
/// Override this to implement LOD collapsing and identical child pruning on changes to the tree.
virtual bool collapseChildren();
virtual bool collapseChildren() override;
/// Should this element be considered to have content in it. This will be used in collision and ray casting methods.
/// By default we assume that only leaves are actual content, but some octrees may have different semantics.
virtual bool hasContent() const { return hasEntities(); }
virtual bool hasContent() const override { return hasEntities(); }
/// Should this element be considered to have detailed content in it. Specifically should it be rendered.
/// By default we assume that only leaves have detailed content, but some octrees may have different semantics.
virtual bool hasDetailedContent() const { return hasEntities(); }
virtual bool hasDetailedContent() const override { return hasEntities(); }
/// Override this to break up large octree elements when an edit operation is performed on a smaller octree element.
/// For example, if the octrees represent solid cubes and a delete of a smaller octree element is done then the
/// meaningful split would be to break the larger cube into smaller cubes of the same color/texture.
virtual void splitChildren() { }
virtual void splitChildren() override { }
/// Override to indicate that this element requires a split before editing lower elements in the octree
virtual bool requiresSplit() const { return false; }
virtual bool requiresSplit() const override { return false; }
virtual void debugExtraEncodeData(EncodeBitstreamParams& params) const;
virtual void initializeExtraEncodeData(EncodeBitstreamParams& params);
virtual bool shouldIncludeChildData(int childIndex, EncodeBitstreamParams& params) const;
virtual bool shouldRecurseChildTree(int childIndex, EncodeBitstreamParams& params) const;
virtual void updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const;
virtual void elementEncodeComplete(EncodeBitstreamParams& params) const;
virtual void debugExtraEncodeData(EncodeBitstreamParams& params) const override;
virtual void initializeExtraEncodeData(EncodeBitstreamParams& params) override;
virtual bool shouldIncludeChildData(int childIndex, EncodeBitstreamParams& params) const override;
virtual bool shouldRecurseChildTree(int childIndex, EncodeBitstreamParams& params) const override;
virtual void updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const override;
virtual void elementEncodeComplete(EncodeBitstreamParams& params) const override;
bool alreadyFullyEncoded(EncodeBitstreamParams& params) const;
/// Override to serialize the state of this element. This is used for persistance and for transmission across the network.
virtual OctreeElement::AppendState appendElementData(OctreePacketData* packetData, EncodeBitstreamParams& params) const;
virtual OctreeElement::AppendState appendElementData(OctreePacketData* packetData,
EncodeBitstreamParams& params) const override;
/// Override to deserialize the state of this element. This is used for loading from a persisted file or from reading
/// from the network.
virtual int readElementDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args);
virtual int readElementDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args) override;
/// Override to indicate that the item is currently rendered in the rendering engine. By default we assume that if
/// the element should be rendered, then your rendering engine is rendering. But some rendering engines my have cases
/// where an element is not actually rendering all should render elements. If the isRendered() state doesn't match the
/// shouldRender() state, the tree will remark elements as changed even in cases there the elements have not changed.
virtual bool isRendered() const { return getShouldRender(); }
virtual bool deleteApproved() const { return !hasEntities(); }
virtual bool isRendered() const override { return getShouldRender(); }
virtual bool deleteApproved() const override { return !hasEntities(); }
virtual bool canRayIntersect() const { return hasEntities(); }
virtual bool canRayIntersect() const override { return hasEntities(); }
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& node, float& distance,
BoxFace& face, glm::vec3& surfaceNormal, const QVector<EntityItemID>& entityIdsToInclude,
BoxFace& face, glm::vec3& surfaceNormal, const QVector<EntityItemID>& entityIdsToInclude,
const QVector<EntityItemID>& entityIdsToDiscard,
void** intersectedObject = NULL, bool precisionPicking = false);
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal, const QVector<EntityItemID>& entityIdsToInclude,
const QVector<EntityItemID>& entityIdsToDiscard,
void** intersectedObject, bool precisionPicking, float distanceToElementCube);
virtual bool findSpherePenetration(const glm::vec3& center, float radius,
glm::vec3& penetration, void** penetratedObject) const;
glm::vec3& penetration, void** penetratedObject) const override;
template <typename F>
@ -232,7 +234,7 @@ public:
}
protected:
virtual void init(unsigned char * octalCode);
virtual void init(unsigned char * octalCode) override;
EntityTreePointer _myTree;
EntityItems _entityItems;
};

View file

@ -30,9 +30,9 @@ public:
EntityTreeHeadlessViewer();
virtual ~EntityTreeHeadlessViewer();
virtual char getMyNodeType() const { return NodeType::EntityServer; }
virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; }
virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; }
virtual char getMyNodeType() const override { return NodeType::EntityServer; }
virtual PacketType getMyQueryMessageType() const override { return PacketType::EntityQuery; }
virtual PacketType getExpectedPacketType() const override { return PacketType::EntityData; }
void update();
@ -40,10 +40,10 @@ public:
void processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode);
virtual void init();
virtual void init() override;
protected:
virtual OctreePointer createTree() {
virtual OctreePointer createTree() override {
EntityTreePointer newTree = EntityTreePointer(new EntityTree(true));
newTree->createRootElement();
return newTree;

View file

@ -30,57 +30,57 @@ class ReadBitstreamToTreeParams;
class KeyLightPropertyGroup : public PropertyGroup {
public:
// EntityItemProperty related helpers
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties,
QScriptEngine* engine, bool skipDefaults,
EntityItemProperties& defaultEntityProperties) const override;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
virtual void debugDump() const override;
virtual void listChangedProperties(QList<QString>& out) override;
virtual bool appendToEditPacket(OctreePacketData* packetData,
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes);
virtual void markAllChanged();
virtual EntityPropertyFlags getChangedProperties() const;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags,
const unsigned char*& dataAt, int& processedBytes) override;
virtual void markAllChanged() override;
virtual EntityPropertyFlags getChangedProperties() const override;
// EntityItem related helpers
// methods for getting/setting all properties of an entity
virtual void getProperties(EntityItemProperties& propertiesOut) const;
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties);
virtual void getProperties(EntityItemProperties& propertiesOut) const override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties) override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
static const xColor DEFAULT_KEYLIGHT_COLOR;
static const float DEFAULT_KEYLIGHT_INTENSITY;
static const float DEFAULT_KEYLIGHT_AMBIENT_INTENSITY;
static const glm::vec3 DEFAULT_KEYLIGHT_DIRECTION;
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_COLOR, Color, color, xColor, DEFAULT_KEYLIGHT_COLOR);
DEFINE_PROPERTY(PROP_KEYLIGHT_INTENSITY, Intensity, intensity, float, DEFAULT_KEYLIGHT_INTENSITY);
DEFINE_PROPERTY(PROP_KEYLIGHT_AMBIENT_INTENSITY, AmbientIntensity, ambientIntensity, float, DEFAULT_KEYLIGHT_AMBIENT_INTENSITY);
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_DIRECTION, Direction, direction, glm::vec3, DEFAULT_KEYLIGHT_DIRECTION);
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_AMBIENT_URL, AmbientURL, ambientURL, QString, "");
protected:
};
#endif // hifi_KeyLightPropertyGroup_h

View file

@ -25,30 +25,30 @@ public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
LightEntityItem(const EntityItemID& entityItemID);
ALLOW_INSTANTIATION // This class can be instantiated
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
virtual void setDimensions(const glm::vec3& value);
virtual void setDimensions(const glm::vec3& value) override;
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
const rgbColor& getColor() const { return _color; }
xColor getXColor() const {

View file

@ -12,35 +12,35 @@
#ifndef hifi_LineEntityItem_h
#define hifi_LineEntityItem_h
#include "EntityItem.h"
#include "EntityItem.h"
class LineEntityItem : public EntityItem {
public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
LineEntityItem(const EntityItemID& entityItemID);
ALLOW_INSTANTIATION // This class can be instantiated
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
const rgbColor& getColor() const { return _color; }
xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; }
@ -51,25 +51,26 @@ class LineEntityItem : public EntityItem {
_color[GREEN_INDEX] = value.green;
_color[BLUE_INDEX] = value.blue;
}
void setLineWidth(float lineWidth){ _lineWidth = lineWidth; }
float getLineWidth() const{ return _lineWidth; }
bool setLinePoints(const QVector<glm::vec3>& points);
bool appendPoint(const glm::vec3& point);
const QVector<glm::vec3>& getLinePoints() const{ return _points; }
virtual ShapeType getShapeType() const { return SHAPE_TYPE_NONE; }
virtual ShapeType getShapeType() const override { return SHAPE_TYPE_NONE; }
// never have a ray intersection pick a LineEntityItem.
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool supportsDetailedRayIntersection() const override { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const { return false; }
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject,
bool precisionPicking) const override { return false; }
virtual void debugDump() const;
virtual void debugDump() const override;
static const float DEFAULT_LINE_WIDTH;
static const int MAX_POINTS_PER_LINE;

View file

@ -26,11 +26,11 @@ public:
ALLOW_INSTANTIATION // This class can be instantiated
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
@ -38,20 +38,20 @@ public:
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
virtual void update(const quint64& now);
virtual bool needsToCallUpdate() const;
virtual void debugDump() const;
virtual void update(const quint64& now) override;
virtual bool needsToCallUpdate() const override;
virtual void debugDump() const override;
void setShapeType(ShapeType type);
virtual ShapeType getShapeType() const;
void setShapeType(ShapeType type) override;
virtual ShapeType getShapeType() const override;
// TODO: Move these to subclasses, or other appropriate abstraction
@ -115,7 +115,7 @@ public:
const QString getTextures() const;
void setTextures(const QString& textures);
virtual bool shouldBePhysical() const;
virtual bool shouldBePhysical() const override;
virtual glm::vec3 getJointPosition(int jointIndex) const { return glm::vec3(); }
virtual glm::quat getJointRotation(int jointIndex) const { return glm::quat(); }

View file

@ -38,9 +38,9 @@ public:
~MovingEntitiesOperator();
void addEntityToMoveList(EntityItemPointer entity, const AACube& newCube);
virtual bool preRecursion(OctreeElementPointer element);
virtual bool postRecursion(OctreeElementPointer element);
virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex);
virtual bool preRecursion(OctreeElementPointer element) override;
virtual bool postRecursion(OctreeElementPointer element) override;
virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex) override;
bool hasMovingEntities() const { return _entitiesToMove.size() > 0; }
private:
EntityTreePointer _tree;

View file

@ -26,10 +26,10 @@ public:
ParticleEffectEntityItem(const EntityItemID& entityItemID);
// methods for getting/setting all properties of this entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
@ -37,15 +37,15 @@ public:
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
virtual void update(const quint64& now);
virtual bool needsToCallUpdate() const;
virtual void update(const quint64& now) override;
virtual bool needsToCallUpdate() const override;
const rgbColor& getColor() const { return _color; }
xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; }
@ -95,10 +95,10 @@ public:
void setAlphaSpread(float alphaSpread);
float getAlphaSpread() const { return _alphaSpread; }
void setShapeType(ShapeType type);
virtual ShapeType getShapeType() const { return _shapeType; }
void setShapeType(ShapeType type) override;
virtual ShapeType getShapeType() const override { return _shapeType; }
virtual void debugDump() const;
virtual void debugDump() const override;
bool isEmittingParticles() const; /// emitting enabled, and there are particles alive
bool getIsEmitting() const { return _isEmitting; }
@ -219,7 +219,7 @@ public:
_emitterShouldTrail = emitterShouldTrail;
}
virtual bool supportsDetailedRayIntersection() const { return false; }
virtual bool supportsDetailedRayIntersection() const override { return false; }
protected:
struct Particle;

View file

@ -12,35 +12,35 @@
#ifndef hifi_PolyLineEntityItem_h
#define hifi_PolyLineEntityItem_h
#include "EntityItem.h"
#include "EntityItem.h"
class PolyLineEntityItem : public EntityItem {
public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
PolyLineEntityItem(const EntityItemID& entityItemID);
ALLOW_INSTANTIATION // This class can be instantiated
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
const rgbColor& getColor() const { return _color; }
xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; }
@ -49,22 +49,21 @@ class PolyLineEntityItem : public EntityItem {
memcpy(_color, value, sizeof(_color));
}
void setColor(const xColor& value) {
_color[RED_INDEX] = value.red;
_color[GREEN_INDEX] = value.green;
_color[BLUE_INDEX] = value.blue;
}
void setLineWidth(float lineWidth){ _lineWidth = lineWidth; }
float getLineWidth() const{ return _lineWidth; }
bool setLinePoints(const QVector<glm::vec3>& points);
bool appendPoint(const glm::vec3& point);
const QVector<glm::vec3>& getLinePoints() const{ return _points; }
bool setNormals(const QVector<glm::vec3>& normals);
const QVector<glm::vec3>& getNormals() const{ return _normals; }
bool setStrokeWidths(const QVector<float>& strokeWidths);
const QVector<float>& getStrokeWidths() const{ return _strokeWidths; }
@ -76,18 +75,18 @@ class PolyLineEntityItem : public EntityItem {
}
}
virtual bool needsToCallUpdate() const { return true; }
virtual bool needsToCallUpdate() const override { return true; }
virtual ShapeType getShapeType() const { return SHAPE_TYPE_NONE; }
virtual ShapeType getShapeType() const override { return SHAPE_TYPE_NONE; }
// never have a ray intersection pick a PolyLineEntityItem.
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool supportsDetailedRayIntersection() const override { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const { return false;}
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const override { return false; }
virtual void debugDump() const;
virtual void debugDump() const override;
static const float DEFAULT_LINE_WIDTH;
static const int MAX_POINTS_PER_LINE;

View file

@ -23,11 +23,11 @@ class PolyVoxEntityItem : public EntityItem {
ALLOW_INSTANTIATION // This class can be instantiated
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
@ -35,21 +35,21 @@ class PolyVoxEntityItem : public EntityItem {
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
// never have a ray intersection pick a PolyVoxEntityItem.
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool supportsDetailedRayIntersection() const override { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const { return false; }
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const override { return false; }
virtual void debugDump() const;
virtual void debugDump() const override;
virtual void setVoxelVolumeSize(glm::vec3 voxelVolumeSize);
virtual glm::vec3 getVoxelVolumeSize() const;

View file

@ -63,7 +63,7 @@ public:
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
int& propertyCount,
OctreeElement::AppendState& appendState) const = 0;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes) = 0;

View file

@ -15,8 +15,8 @@ class RecurseOctreeToMapOperator : public RecurseOctreeOperator {
public:
RecurseOctreeToMapOperator(QVariantMap& map, OctreeElementPointer top, QScriptEngine* engine, bool skipDefaultValues,
bool skipThoseWithBadParents);
bool preRecursion(OctreeElementPointer element);
bool postRecursion(OctreeElementPointer element);
bool preRecursion(OctreeElementPointer element) override;
bool postRecursion(OctreeElementPointer element) override;
private:
QVariantMap& _map;
OctreeElementPointer _top;

View file

@ -30,44 +30,47 @@ class ReadBitstreamToTreeParams;
class SkyboxPropertyGroup : public PropertyGroup {
public:
// EntityItemProperty related helpers
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties,
QScriptEngine* engine, bool skipDefaults,
EntityItemProperties& defaultEntityProperties) const override;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
virtual void debugDump() const override;
virtual void listChangedProperties(QList<QString>& out) override;
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes);
virtual void markAllChanged();
virtual EntityPropertyFlags getChangedProperties() const;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags,
const unsigned char*& dataAt, int& processedBytes) override;
virtual void markAllChanged() override;
virtual EntityPropertyFlags getChangedProperties() const override;
// EntityItem related helpers
// methods for getting/setting all properties of an entity
virtual void getProperties(EntityItemProperties& propertiesOut) const;
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties);
virtual void getProperties(EntityItemProperties& propertiesOut) const override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties) override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
glm::vec3 getColorVec3() const {
const quint8 MAX_COLOR = 255;
glm::vec3 color = { (float)_color.red / (float)MAX_COLOR,

View file

@ -30,54 +30,57 @@ class ReadBitstreamToTreeParams;
class StagePropertyGroup : public PropertyGroup {
public:
// EntityItemProperty related helpers
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties,
QScriptEngine* engine, bool skipDefaults,
EntityItemProperties& defaultEntityProperties) const override;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
virtual void debugDump() const override;
virtual void listChangedProperties(QList<QString>& out) override;
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes);
virtual void markAllChanged();
virtual EntityPropertyFlags getChangedProperties() const;
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags,
const unsigned char*& dataAt, int& processedBytes) override;
virtual void markAllChanged() override;
virtual EntityPropertyFlags getChangedProperties() const override;
// EntityItem related helpers
// methods for getting/setting all properties of an entity
virtual void getProperties(EntityItemProperties& propertiesOut) const;
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties);
virtual void getProperties(EntityItemProperties& propertiesOut) const override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
/// returns true if something changed
virtual bool setProperties(const EntityItemProperties& properties) override;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
static const bool DEFAULT_STAGE_SUN_MODEL_ENABLED;
static const float DEFAULT_STAGE_LATITUDE;
static const float DEFAULT_STAGE_LONGITUDE;
static const float DEFAULT_STAGE_ALTITUDE;
static const quint16 DEFAULT_STAGE_DAY;
static const float DEFAULT_STAGE_HOUR;
float calculateHour() const;
uint16_t calculateDay() const;
DEFINE_PROPERTY(PROP_STAGE_SUN_MODEL_ENABLED, SunModelEnabled, sunModelEnabled, bool, DEFAULT_STAGE_SUN_MODEL_ENABLED);
DEFINE_PROPERTY(PROP_STAGE_LATITUDE, Latitude, latitude, float, DEFAULT_STAGE_LATITUDE);
DEFINE_PROPERTY(PROP_STAGE_LONGITUDE, Longitude, longitude, float, DEFAULT_STAGE_LONGITUDE);

View file

@ -12,45 +12,45 @@
#ifndef hifi_TextEntityItem_h
#define hifi_TextEntityItem_h
#include "EntityItem.h"
#include "EntityItem.h"
class TextEntityItem : public EntityItem {
public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
TextEntityItem(const EntityItemID& entityItemID);
ALLOW_INSTANTIATION // This class can be instantiated
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
virtual void setDimensions(const glm::vec3& value);
virtual ShapeType getShapeType() const { return SHAPE_TYPE_BOX; }
virtual void setDimensions(const glm::vec3& value) override;
virtual ShapeType getShapeType() const override { return SHAPE_TYPE_BOX; }
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool supportsDetailedRayIntersection() const override { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const;
void** intersectedObject, bool precisionPicking) const override;
static const QString DEFAULT_TEXT;
void setText(const QString& value) { _text = value; }
@ -81,7 +81,7 @@ public:
_backgroundColor[GREEN_INDEX] = value.green;
_backgroundColor[BLUE_INDEX] = value.blue;
}
static const bool DEFAULT_FACE_CAMERA;
bool getFaceCamera() const { return _faceCamera; }
void setFaceCamera(bool value) { _faceCamera = value; }

View file

@ -25,9 +25,9 @@ public:
~UpdateEntityOperator();
virtual bool preRecursion(OctreeElementPointer element);
virtual bool postRecursion(OctreeElementPointer element);
virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex);
virtual bool preRecursion(OctreeElementPointer element) override;
virtual bool postRecursion(OctreeElementPointer element) override;
virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex) override;
private:
EntityTreePointer _tree;
EntityItemPointer _existingEntity;

View file

@ -22,15 +22,15 @@ public:
ALLOW_INSTANTIATION // This class can be instantiated
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
virtual void setDimensions(const glm::vec3& value);
virtual ShapeType getShapeType() const { return SHAPE_TYPE_BOX; }
virtual void setDimensions(const glm::vec3& value) override;
virtual ShapeType getShapeType() const override { return SHAPE_TYPE_BOX; }
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
@ -38,18 +38,18 @@ public:
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool supportsDetailedRayIntersection() const override { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const;
void** intersectedObject, bool precisionPicking) const override;
virtual void setSourceUrl(const QString& value);
const QString& getSourceUrl() const;

View file

@ -23,28 +23,28 @@ public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
ZoneEntityItem(const EntityItemID& entityItemID);
ALLOW_INSTANTIATION // This class can be instantiated
// methods for getting/setting all properties of an entity
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
virtual bool setProperties(const EntityItemProperties& properties);
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
virtual bool setProperties(const EntityItemProperties& properties) override;
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const;
int& propertyCount,
OctreeElement::AppendState& appendState) const override;
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
bool& somethingChanged) override;
@ -53,11 +53,11 @@ public:
static bool getDrawZoneBoundaries() { return _drawZoneBoundaries; }
static void setDrawZoneBoundaries(bool value) { _drawZoneBoundaries = value; }
virtual bool isReadyToComputeShape() { return false; }
void setShapeType(ShapeType type) { _shapeType = type; }
virtual ShapeType getShapeType() const;
virtual bool isReadyToComputeShape() override { return false; }
void setShapeType(ShapeType type) override { _shapeType = type; }
virtual ShapeType getShapeType() const override;
virtual bool hasCompoundShapeURL() const { return !_compoundShapeURL.isEmpty(); }
const QString getCompoundShapeURL() const { return _compoundShapeURL; }
virtual void setCompoundShapeURL(const QString& url);
@ -75,13 +75,13 @@ public:
bool getGhostingAllowed() const { return _ghostingAllowed; }
void setGhostingAllowed(bool value) { _ghostingAllowed = value; }
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool supportsDetailedRayIntersection() const override { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElementPointer& element, float& distance,
BoxFace& face, glm::vec3& surfaceNormal,
void** intersectedObject, bool precisionPicking) const;
void** intersectedObject, bool precisionPicking) const override;
virtual void debugDump() const;
virtual void debugDump() const override;
static const ShapeType DEFAULT_SHAPE_TYPE;
static const QString DEFAULT_COMPOUND_SHAPE_URL;

View file

@ -100,7 +100,7 @@ protected:
class QmlNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory {
public:
QNetworkAccessManager* create(QObject* parent);
QNetworkAccessManager* create(QObject* parent) override;
};
QNetworkAccessManager* QmlNetworkAccessManagerFactory::create(QObject* parent) {

View file

@ -33,6 +33,13 @@
#pragma clang diagnostic ignored "-Wpessimizing-move"
#endif
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#if __GNUC__ >= 5 && __GNUC_MINOR__ >= 1
#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#endif
#include <oglplus/gl.hpp>
#include <oglplus/all.hpp>
@ -42,6 +49,10 @@
#include <oglplus/bound/renderbuffer.hpp>
#include <oglplus/shapes/wrapper.hpp>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
#ifdef _WIN32
#pragma warning(pop)
#elif defined(Q_OS_MAC)

Some files were not shown because too many files have changed in this diff Show more