mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 01:03:58 +02:00
Merge branch 'master' into case7587
This commit is contained in:
commit
6fb47eef85
33 changed files with 283 additions and 119 deletions
|
@ -175,7 +175,7 @@ bool EntityTreeSendThread::addAncestorsToExtraFlaggedEntities(const QUuid& filte
|
||||||
return parentWasNew || ancestorsWereNew;
|
return parentWasNew || ancestorsWereNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
// since we didn't have a parent niether of our parents or ancestors could be new additions
|
// since we didn't have a parent, neither of our parents or ancestors could be new additions
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,9 @@ bool EntityTreeSendThread::addDescendantsToExtraFlaggedEntities(const QUuid& fil
|
||||||
return hasNewChild || hasNewDescendants;
|
return hasNewChild || hasNewDescendants;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTreeElementPointer root, int32_t lodLevelOffset, bool usesViewFrustum) {
|
void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTreeElementPointer root, int32_t lodLevelOffset,
|
||||||
|
bool usesViewFrustum) {
|
||||||
|
|
||||||
DiffTraversal::Type type = _traversal.prepareNewTraversal(view, root, lodLevelOffset, usesViewFrustum);
|
DiffTraversal::Type type = _traversal.prepareNewTraversal(view, root, lodLevelOffset, usesViewFrustum);
|
||||||
// there are three types of traversal:
|
// there are three types of traversal:
|
||||||
//
|
//
|
||||||
|
@ -423,12 +425,19 @@ bool EntityTreeSendThread::traverseTreeAndBuildNextPacketPayload(EncodeBitstream
|
||||||
uint64_t sendTime = usecTimestampNow();
|
uint64_t sendTime = usecTimestampNow();
|
||||||
auto nodeData = static_cast<OctreeQueryNode*>(params.nodeData);
|
auto nodeData = static_cast<OctreeQueryNode*>(params.nodeData);
|
||||||
nodeData->stats.encodeStarted();
|
nodeData->stats.encodeStarted();
|
||||||
|
auto entityNode = _node.toStrongRef();
|
||||||
|
auto entityNodeData = static_cast<EntityNodeData*>(entityNode->getLinkedData());
|
||||||
while(!_sendQueue.empty()) {
|
while(!_sendQueue.empty()) {
|
||||||
PrioritizedEntity queuedItem = _sendQueue.top();
|
PrioritizedEntity queuedItem = _sendQueue.top();
|
||||||
EntityItemPointer entity = queuedItem.getEntity();
|
EntityItemPointer entity = queuedItem.getEntity();
|
||||||
if (entity) {
|
if (entity) {
|
||||||
// Only send entities that match the jsonFilters, but keep track of everything we've tried to send so we don't try to send it again
|
// Only send entities that match the jsonFilters, but keep track of everything we've tried to send so we don't try to send it again
|
||||||
if (entity->matchesJSONFilters(jsonFilters)) {
|
bool entityMatchesFilters = entity->matchesJSONFilters(jsonFilters);
|
||||||
|
if (entityMatchesFilters || entityNodeData->isEntityFlaggedAsExtra(entity->getID())) {
|
||||||
|
if (!jsonFilters.isEmpty() && entityMatchesFilters) {
|
||||||
|
// Record explicitly filtered-in entity so that extra entities can be flagged.
|
||||||
|
entityNodeData->insertSentFilteredEntity(entity->getID());
|
||||||
|
}
|
||||||
OctreeElement::AppendState appendEntityState = entity->appendEntityData(&_packetData, params, _extraEncodeData);
|
OctreeElement::AppendState appendEntityState = entity->appendEntityData(&_packetData, params, _extraEncodeData);
|
||||||
|
|
||||||
if (appendEntityState != OctreeElement::COMPLETED) {
|
if (appendEntityState != OctreeElement::COMPLETED) {
|
||||||
|
|
|
@ -38,7 +38,8 @@ private:
|
||||||
bool addAncestorsToExtraFlaggedEntities(const QUuid& filteredEntityID, EntityItem& entityItem, EntityNodeData& nodeData);
|
bool addAncestorsToExtraFlaggedEntities(const QUuid& filteredEntityID, EntityItem& entityItem, EntityNodeData& nodeData);
|
||||||
bool addDescendantsToExtraFlaggedEntities(const QUuid& filteredEntityID, EntityItem& entityItem, EntityNodeData& nodeData);
|
bool addDescendantsToExtraFlaggedEntities(const QUuid& filteredEntityID, EntityItem& entityItem, EntityNodeData& nodeData);
|
||||||
|
|
||||||
void startNewTraversal(const ViewFrustum& viewFrustum, EntityTreeElementPointer root, int32_t lodLevelOffset, bool usesViewFrustum);
|
void startNewTraversal(const ViewFrustum& viewFrustum, EntityTreeElementPointer root, int32_t lodLevelOffset,
|
||||||
|
bool usesViewFrustum);
|
||||||
bool traverseTreeAndBuildNextPacketPayload(EncodeBitstreamParams& params, const QJsonObject& jsonFilters) override;
|
bool traverseTreeAndBuildNextPacketPayload(EncodeBitstreamParams& params, const QJsonObject& jsonFilters) override;
|
||||||
|
|
||||||
void preDistributionProcessing() override;
|
void preDistributionProcessing() override;
|
||||||
|
|
4
cmake/externals/wasapi/CMakeLists.txt
vendored
4
cmake/externals/wasapi/CMakeLists.txt
vendored
|
@ -6,8 +6,8 @@ if (WIN32)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
${EXTERNAL_NAME}
|
${EXTERNAL_NAME}
|
||||||
URL http://hifi-public.s3.amazonaws.com/dependencies/qtaudio_wasapi9.zip
|
URL http://hifi-public.s3.amazonaws.com/dependencies/qtaudio_wasapi10.zip
|
||||||
URL_MD5 94f4765bdbcd53cd099f349ae031e769
|
URL_MD5 4f40e49715a420fb67b45b9cee19052c
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND ""
|
BUILD_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
|
|
@ -16,10 +16,10 @@ import Qt.labs.settings 1.0
|
||||||
|
|
||||||
import "../styles-uit"
|
import "../styles-uit"
|
||||||
import "../controls-uit" as HifiControls
|
import "../controls-uit" as HifiControls
|
||||||
import "../windows"
|
import "../windows" as Windows
|
||||||
import "../dialogs"
|
import "../dialogs"
|
||||||
|
|
||||||
ScrollingWindow {
|
Windows.ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
objectName: "AssetServer"
|
objectName: "AssetServer"
|
||||||
title: "Asset Browser"
|
title: "Asset Browser"
|
||||||
|
|
|
@ -213,8 +213,8 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
peak: model.peak;
|
peak: model.peak;
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: (bar.currentIndex === 1 && selectedHMD && isVR) ||
|
visible: ((bar.currentIndex === 1 && isVR) ||
|
||||||
(bar.currentIndex === 0 && selectedDesktop && !isVR) &&
|
(bar.currentIndex === 0 && !isVR)) &&
|
||||||
Audio.devices.input.peakValuesAvailable;
|
Audio.devices.input.peakValuesAvailable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ void Ledger::buy(const QString& hfc_key, int cost, const QString& asset_id, cons
|
||||||
signedSend("transaction", transactionString, hfc_key, "buy", "buySuccess", "buyFailure", controlled_failure);
|
signedSend("transaction", transactionString, hfc_key, "buy", "buySuccess", "buyFailure", controlled_failure);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Ledger::receiveAt(const QString& hfc_key, const QString& old_key) {
|
bool Ledger::receiveAt(const QString& hfc_key, const QString& old_key, const QString& machine_fingerprint) {
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
if (!accountManager->isLoggedIn()) {
|
if (!accountManager->isLoggedIn()) {
|
||||||
qCWarning(commerce) << "Cannot set receiveAt when not logged in.";
|
qCWarning(commerce) << "Cannot set receiveAt when not logged in.";
|
||||||
|
@ -99,7 +99,13 @@ bool Ledger::receiveAt(const QString& hfc_key, const QString& old_key) {
|
||||||
return false; // We know right away that we will fail, so tell the caller.
|
return false; // We know right away that we will fail, so tell the caller.
|
||||||
}
|
}
|
||||||
|
|
||||||
signedSend("public_key", hfc_key.toUtf8(), old_key, "receive_at", "receiveAtSuccess", "receiveAtFailure");
|
QJsonObject transaction;
|
||||||
|
transaction["hfc_key"] = hfc_key;
|
||||||
|
transaction["machine_fingerprint"] = machine_fingerprint;
|
||||||
|
QJsonDocument transactionDoc{ transaction };
|
||||||
|
auto transactionString = transactionDoc.toJson(QJsonDocument::Compact);
|
||||||
|
|
||||||
|
signedSend("transaction", transactionString, old_key, "receive_at", "receiveAtSuccess", "receiveAtFailure");
|
||||||
return true; // Note that there may still be an asynchronous signal of failure that callers might be interested in.
|
return true; // Note that there may still be an asynchronous signal of failure that callers might be interested in.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Ledger : public QObject, public Dependency {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void buy(const QString& hfc_key, int cost, const QString& asset_id, const QString& inventory_key, const bool controlled_failure = false);
|
void buy(const QString& hfc_key, int cost, const QString& asset_id, const QString& inventory_key, const bool controlled_failure = false);
|
||||||
bool receiveAt(const QString& hfc_key, const QString& old_key);
|
bool receiveAt(const QString& hfc_key, const QString& old_key, const QString& machine_fingerprint);
|
||||||
void balance(const QStringList& keys);
|
void balance(const QStringList& keys);
|
||||||
void inventory(const QStringList& keys);
|
void inventory(const QStringList& keys);
|
||||||
void history(const QStringList& keys);
|
void history(const QStringList& keys);
|
||||||
|
|
|
@ -33,7 +33,7 @@ QmlCommerce::QmlCommerce(QQuickItem* parent) : OffscreenQmlDialog(parent) {
|
||||||
connect(ledger.data(), &Ledger::updateCertificateStatus, this, &QmlCommerce::updateCertificateStatus);
|
connect(ledger.data(), &Ledger::updateCertificateStatus, this, &QmlCommerce::updateCertificateStatus);
|
||||||
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
connect(accountManager.data(), &AccountManager::usernameChanged, [&]() {
|
connect(accountManager.data(), &AccountManager::usernameChanged, this, [&]() {
|
||||||
setPassphrase("");
|
setPassphrase("");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "ui/ImageProvider.h"
|
#include "ui/ImageProvider.h"
|
||||||
#include "scripting/HMDScriptingInterface.h"
|
#include "scripting/HMDScriptingInterface.h"
|
||||||
|
|
||||||
|
#include <FingerprintUtils.h>
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
#include <OffscreenUi.h>
|
#include <OffscreenUi.h>
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
|
@ -541,7 +542,8 @@ bool Wallet::generateKeyPair() {
|
||||||
// 2. It is maximally private, and we can step back from that later if desired.
|
// 2. It is maximally private, and we can step back from that later if desired.
|
||||||
// 3. It maximally exercises all the machinery, so we are most likely to surface issues now.
|
// 3. It maximally exercises all the machinery, so we are most likely to surface issues now.
|
||||||
auto ledger = DependencyManager::get<Ledger>();
|
auto ledger = DependencyManager::get<Ledger>();
|
||||||
return ledger->receiveAt(key, oldKey);
|
QString machineFingerprint = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());
|
||||||
|
return ledger->receiveAt(key, oldKey, machineFingerprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Wallet::listPublicKeys() {
|
QStringList Wallet::listPublicKeys() {
|
||||||
|
|
|
@ -27,7 +27,6 @@ LaserPointer::LaserPointer(const QVariant& rayProps, const RenderStateMap& rende
|
||||||
_rayPickUID(DependencyManager::get<RayPickScriptingInterface>()->createRayPick(rayProps))
|
_rayPickUID(DependencyManager::get<RayPickScriptingInterface>()->createRayPick(rayProps))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
for (auto& state : _renderStates) {
|
for (auto& state : _renderStates) {
|
||||||
if (!enabled || state.first != _currentRenderState) {
|
if (!enabled || state.first != _currentRenderState) {
|
||||||
disableRenderState(state.second);
|
disableRenderState(state.second);
|
||||||
|
@ -120,23 +119,25 @@ void LaserPointer::updateRenderState(const RenderState& renderState, const Inter
|
||||||
qApp->getOverlays().editOverlay(renderState.getStartID(), startProps);
|
qApp->getOverlays().editOverlay(renderState.getStartID(), startProps);
|
||||||
}
|
}
|
||||||
glm::vec3 endVec;
|
glm::vec3 endVec;
|
||||||
if (((defaultState || !_lockEnd) && _objectLockEnd.first.isNull()) || type == IntersectionType::HUD) {
|
if (((defaultState || !_lockEnd) && _lockEndObject.id.isNull()) || type == IntersectionType::HUD) {
|
||||||
endVec = pickRay.origin + pickRay.direction * distance;
|
endVec = pickRay.origin + pickRay.direction * distance;
|
||||||
} else {
|
} else {
|
||||||
if (!_objectLockEnd.first.isNull()) {
|
if (!_lockEndObject.id.isNull()) {
|
||||||
glm::vec3 pos;
|
glm::vec3 pos;
|
||||||
glm::quat rot;
|
glm::quat rot;
|
||||||
glm::vec3 dim;
|
glm::vec3 dim;
|
||||||
glm::vec3 registrationPoint;
|
glm::vec3 registrationPoint;
|
||||||
if (_objectLockEnd.second) {
|
if (_lockEndObject.isOverlay) {
|
||||||
pos = vec3FromVariant(qApp->getOverlays().getProperty(_objectLockEnd.first, "position").value);
|
pos = vec3FromVariant(qApp->getOverlays().getProperty(_lockEndObject.id, "position").value);
|
||||||
rot = quatFromVariant(qApp->getOverlays().getProperty(_objectLockEnd.first, "rotation").value);
|
rot = quatFromVariant(qApp->getOverlays().getProperty(_lockEndObject.id, "rotation").value);
|
||||||
dim = vec3FromVariant(qApp->getOverlays().getProperty(_objectLockEnd.first, "dimensions").value);
|
dim = vec3FromVariant(qApp->getOverlays().getProperty(_lockEndObject.id, "dimensions").value);
|
||||||
registrationPoint = glm::vec3(0.5f);
|
registrationPoint = glm::vec3(0.5f);
|
||||||
} else {
|
} else {
|
||||||
EntityItemProperties props = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(_objectLockEnd.first);
|
EntityItemProperties props = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(_lockEndObject.id);
|
||||||
pos = props.getPosition();
|
glm::mat4 entityMat = createMatFromQuatAndPos(props.getRotation(), props.getPosition());
|
||||||
rot = props.getRotation();
|
glm::mat4 finalPosAndRotMat = entityMat * _lockEndObject.offsetMat;
|
||||||
|
pos = extractTranslation(finalPosAndRotMat);
|
||||||
|
rot = glmExtractRotation(finalPosAndRotMat);
|
||||||
dim = props.getDimensions();
|
dim = props.getDimensions();
|
||||||
registrationPoint = props.getRegistrationPoint();
|
registrationPoint = props.getRegistrationPoint();
|
||||||
}
|
}
|
||||||
|
@ -218,7 +219,7 @@ void LaserPointer::update() {
|
||||||
withReadLock([&] {
|
withReadLock([&] {
|
||||||
RayPickResult prevRayPickResult = qApp->getRayPickManager().getPrevRayPickResult(_rayPickUID);
|
RayPickResult prevRayPickResult = qApp->getRayPickManager().getPrevRayPickResult(_rayPickUID);
|
||||||
if (_renderingEnabled && !_currentRenderState.empty() && _renderStates.find(_currentRenderState) != _renderStates.end() &&
|
if (_renderingEnabled && !_currentRenderState.empty() && _renderStates.find(_currentRenderState) != _renderStates.end() &&
|
||||||
(prevRayPickResult.type != IntersectionType::NONE || _laserLength > 0.0f || !_objectLockEnd.first.isNull())) {
|
(prevRayPickResult.type != IntersectionType::NONE || _laserLength > 0.0f || !_lockEndObject.id.isNull())) {
|
||||||
float distance = _laserLength > 0.0f ? _laserLength : prevRayPickResult.distance;
|
float distance = _laserLength > 0.0f ? _laserLength : prevRayPickResult.distance;
|
||||||
qDebug() << &_currentRenderState;
|
qDebug() << &_currentRenderState;
|
||||||
updateRenderState(_renderStates[_currentRenderState], prevRayPickResult.type, distance, prevRayPickResult.objectID, prevRayPickResult.searchRay, false);
|
updateRenderState(_renderStates[_currentRenderState], prevRayPickResult.type, distance, prevRayPickResult.objectID, prevRayPickResult.searchRay, false);
|
||||||
|
@ -243,9 +244,11 @@ void LaserPointer::setLaserLength(const float laserLength) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaserPointer::setLockEndUUID(QUuid objectID, const bool isOverlay) {
|
void LaserPointer::setLockEndUUID(QUuid objectID, const bool isOverlay, const glm::mat4& offsetMat) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_objectLockEnd = std::pair<QUuid, bool>(objectID, isOverlay);
|
_lockEndObject.id = objectID;
|
||||||
|
_lockEndObject.isOverlay = isOverlay;
|
||||||
|
_lockEndObject.offsetMat = offsetMat;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,12 @@
|
||||||
|
|
||||||
class RayPickResult;
|
class RayPickResult;
|
||||||
|
|
||||||
|
struct LockEndObject {
|
||||||
|
QUuid id { QUuid() };
|
||||||
|
bool isOverlay { false };
|
||||||
|
glm::mat4 offsetMat { glm::mat4() };
|
||||||
|
};
|
||||||
|
|
||||||
class RenderState {
|
class RenderState {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -74,7 +80,7 @@ public:
|
||||||
|
|
||||||
void setPrecisionPicking(const bool precisionPicking);
|
void setPrecisionPicking(const bool precisionPicking);
|
||||||
void setLaserLength(const float laserLength);
|
void setLaserLength(const float laserLength);
|
||||||
void setLockEndUUID(QUuid objectID, const bool isOverlay);
|
void setLockEndUUID(QUuid objectID, const bool isOverlay, const glm::mat4& offsetMat = glm::mat4());
|
||||||
|
|
||||||
void setIgnoreItems(const QVector<QUuid>& ignoreItems) const;
|
void setIgnoreItems(const QVector<QUuid>& ignoreItems) const;
|
||||||
void setIncludeItems(const QVector<QUuid>& includeItems) const;
|
void setIncludeItems(const QVector<QUuid>& includeItems) const;
|
||||||
|
@ -92,7 +98,7 @@ private:
|
||||||
bool _lockEnd;
|
bool _lockEnd;
|
||||||
bool _distanceScaleEnd;
|
bool _distanceScaleEnd;
|
||||||
bool _scaleWithAvatar;
|
bool _scaleWithAvatar;
|
||||||
std::pair<QUuid, bool> _objectLockEnd { std::pair<QUuid, bool>(QUuid(), false)};
|
LockEndObject _lockEndObject;
|
||||||
|
|
||||||
const QUuid _rayPickUID;
|
const QUuid _rayPickUID;
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,9 @@ void LaserPointerManager::setIncludeItems(const QUuid& uid, const QVector<QUuid>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaserPointerManager::setLockEndUUID(const QUuid& uid, const QUuid& objectID, const bool isOverlay) const {
|
void LaserPointerManager::setLockEndUUID(const QUuid& uid, const QUuid& objectID, const bool isOverlay, const glm::mat4& offsetMat) const {
|
||||||
auto laserPointer = find(uid);
|
auto laserPointer = find(uid);
|
||||||
if (laserPointer) {
|
if (laserPointer) {
|
||||||
laserPointer->setLockEndUUID(objectID, isOverlay);
|
laserPointer->setLockEndUUID(objectID, isOverlay, offsetMat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
void setIgnoreItems(const QUuid& uid, const QVector<QUuid>& ignoreEntities) const;
|
void setIgnoreItems(const QUuid& uid, const QVector<QUuid>& ignoreEntities) const;
|
||||||
void setIncludeItems(const QUuid& uid, const QVector<QUuid>& includeEntities) const;
|
void setIncludeItems(const QUuid& uid, const QVector<QUuid>& includeEntities) const;
|
||||||
|
|
||||||
void setLockEndUUID(const QUuid& uid, const QUuid& objectID, const bool isOverlay) const;
|
void setLockEndUUID(const QUuid& uid, const QUuid& objectID, const bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ public slots:
|
||||||
Q_INVOKABLE void setIgnoreItems(const QUuid& uid, const QScriptValue& ignoreEntities) const;
|
Q_INVOKABLE void setIgnoreItems(const QUuid& uid, const QScriptValue& ignoreEntities) const;
|
||||||
Q_INVOKABLE void setIncludeItems(const QUuid& uid, const QScriptValue& includeEntities) const;
|
Q_INVOKABLE void setIncludeItems(const QUuid& uid, const QScriptValue& includeEntities) const;
|
||||||
|
|
||||||
Q_INVOKABLE void setLockEndUUID(const QUuid& uid, const QUuid& objectID, bool isOverlay) const { qApp->getLaserPointerManager().setLockEndUUID(uid, objectID, isOverlay); }
|
Q_INVOKABLE void setLockEndUUID(const QUuid& uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { qApp->getLaserPointerManager().setLockEndUUID(uid, objectID, isOverlay, offsetMat); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static RenderState buildRenderState(const QVariantMap& propMap);
|
static RenderState buildRenderState(const QVariantMap& propMap);
|
||||||
|
|
|
@ -152,6 +152,7 @@ void Rig::overrideRoleAnimation(const QString& role, const QString& url, float f
|
||||||
const float REFERENCE_FRAMES_PER_SECOND = 30.0f;
|
const float REFERENCE_FRAMES_PER_SECOND = 30.0f;
|
||||||
float timeScale = fps / REFERENCE_FRAMES_PER_SECOND;
|
float timeScale = fps / REFERENCE_FRAMES_PER_SECOND;
|
||||||
auto clipNode = std::make_shared<AnimClip>(role, url, firstFrame, lastFrame, timeScale, loop, false);
|
auto clipNode = std::make_shared<AnimClip>(role, url, firstFrame, lastFrame, timeScale, loop, false);
|
||||||
|
_roleAnimStates[role] = { role, url, fps, loop, firstFrame, lastFrame };
|
||||||
AnimNode::Pointer parent = node->getParent();
|
AnimNode::Pointer parent = node->getParent();
|
||||||
parent->replaceChild(node, clipNode);
|
parent->replaceChild(node, clipNode);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1638,6 +1639,11 @@ void Rig::initAnimGraph(const QUrl& url) {
|
||||||
_userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f };
|
_userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f };
|
||||||
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
|
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
|
||||||
}
|
}
|
||||||
|
// restore the role animations we had before reset.
|
||||||
|
for (auto& roleAnimState : _roleAnimStates) {
|
||||||
|
auto roleState = roleAnimState.second;
|
||||||
|
overrideRoleAnimation(roleState.role, roleState.url, roleState.fps, roleState.loop, roleState.firstFrame, roleState.lastFrame);
|
||||||
|
}
|
||||||
_animLoading = false;
|
_animLoading = false;
|
||||||
|
|
||||||
emit onLoadComplete();
|
emit onLoadComplete();
|
||||||
|
|
|
@ -336,7 +336,21 @@ protected:
|
||||||
float lastFrame;
|
float lastFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RoleAnimState {
|
||||||
|
RoleAnimState() {}
|
||||||
|
RoleAnimState(const QString& roleId, const QString& urlIn, float fpsIn, bool loopIn, float firstFrameIn, float lastFrameIn) :
|
||||||
|
role(roleId), url(urlIn), fps(fpsIn), loop(loopIn), firstFrame(firstFrameIn), lastFrame(lastFrameIn) {}
|
||||||
|
|
||||||
|
QString role;
|
||||||
|
QString url;
|
||||||
|
float fps;
|
||||||
|
bool loop;
|
||||||
|
float firstFrame;
|
||||||
|
float lastFrame;
|
||||||
|
};
|
||||||
|
|
||||||
UserAnimState _userAnimState;
|
UserAnimState _userAnimState;
|
||||||
|
std::map<QString, RoleAnimState> _roleAnimStates;
|
||||||
|
|
||||||
float _leftHandOverlayAlpha { 0.0f };
|
float _leftHandOverlayAlpha { 0.0f };
|
||||||
float _rightHandOverlayAlpha { 0.0f };
|
float _rightHandOverlayAlpha { 0.0f };
|
||||||
|
|
|
@ -142,7 +142,8 @@ DiffTraversal::DiffTraversal() {
|
||||||
_path.reserve(MIN_PATH_DEPTH);
|
_path.reserve(MIN_PATH_DEPTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
DiffTraversal::Type DiffTraversal::prepareNewTraversal(const ViewFrustum& viewFrustum, EntityTreeElementPointer root, int32_t lodLevelOffset, bool usesViewFrustum) {
|
DiffTraversal::Type DiffTraversal::prepareNewTraversal(const ViewFrustum& viewFrustum, EntityTreeElementPointer root,
|
||||||
|
int32_t lodLevelOffset, bool usesViewFrustum) {
|
||||||
assert(root);
|
assert(root);
|
||||||
// there are three types of traversal:
|
// there are three types of traversal:
|
||||||
//
|
//
|
||||||
|
|
|
@ -57,7 +57,8 @@ public:
|
||||||
|
|
||||||
DiffTraversal();
|
DiffTraversal();
|
||||||
|
|
||||||
Type prepareNewTraversal(const ViewFrustum& viewFrustum, EntityTreeElementPointer root, int32_t lodLevelOffset, bool usesViewFrustum);
|
Type prepareNewTraversal(const ViewFrustum& viewFrustum, EntityTreeElementPointer root, int32_t lodLevelOffset,
|
||||||
|
bool usesViewFrustum);
|
||||||
|
|
||||||
const ViewFrustum& getCurrentView() const { return _currentView.viewFrustum; }
|
const ViewFrustum& getCurrentView() const { return _currentView.viewFrustum; }
|
||||||
const ViewFrustum& getCompletedView() const { return _completedView.viewFrustum; }
|
const ViewFrustum& getCompletedView() const { return _completedView.viewFrustum; }
|
||||||
|
|
|
@ -93,18 +93,23 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type,
|
||||||
|
|
||||||
QByteArray bufferOut(NLPacket::maxPayloadSize(type), 0);
|
QByteArray bufferOut(NLPacket::maxPayloadSize(type), 0);
|
||||||
|
|
||||||
bool success;
|
OctreeElement::AppendState encodeResult = OctreeElement::PARTIAL; // start the loop assuming there's more to send
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
if (properties.parentIDChanged() && properties.getParentID() == AVATAR_SELF_ID) {
|
|
||||||
|
EntityPropertyFlags didntFitProperties;
|
||||||
EntityItemProperties propertiesCopy = properties;
|
EntityItemProperties propertiesCopy = properties;
|
||||||
|
|
||||||
|
if (properties.parentIDChanged() && properties.getParentID() == AVATAR_SELF_ID) {
|
||||||
const QUuid myNodeID = nodeList->getSessionUUID();
|
const QUuid myNodeID = nodeList->getSessionUUID();
|
||||||
propertiesCopy.setParentID(myNodeID);
|
propertiesCopy.setParentID(myNodeID);
|
||||||
success = EntityItemProperties::encodeEntityEditPacket(type, entityItemID, propertiesCopy, bufferOut);
|
|
||||||
} else {
|
|
||||||
success = EntityItemProperties::encodeEntityEditPacket(type, entityItemID, properties, bufferOut);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
EntityPropertyFlags requestedProperties = propertiesCopy.getChangedProperties();
|
||||||
|
|
||||||
|
while (encodeResult == OctreeElement::PARTIAL) {
|
||||||
|
encodeResult = EntityItemProperties::encodeEntityEditPacket(type, entityItemID, propertiesCopy, bufferOut, requestedProperties, didntFitProperties);
|
||||||
|
|
||||||
|
if (encodeResult != OctreeElement::NONE) {
|
||||||
#ifdef WANT_DEBUG
|
#ifdef WANT_DEBUG
|
||||||
qCDebug(entities) << "calling queueOctreeEditMessage()...";
|
qCDebug(entities) << "calling queueOctreeEditMessage()...";
|
||||||
qCDebug(entities) << " id:" << entityItemID;
|
qCDebug(entities) << " id:" << entityItemID;
|
||||||
|
@ -115,6 +120,15 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type,
|
||||||
emit addingEntityWithCertificate(properties.getCertificateID(), DependencyManager::get<AddressManager>()->getPlaceName());
|
emit addingEntityWithCertificate(properties.getCertificateID(), DependencyManager::get<AddressManager>()->getPlaceName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we still have properties to send, switch the message type to edit, and request only the packets that didn't fit
|
||||||
|
if (encodeResult != OctreeElement::COMPLETED) {
|
||||||
|
type = PacketType::EntityEdit;
|
||||||
|
requestedProperties = didntFitProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
bufferOut.resize(NLPacket::maxPayloadSize(type)); // resize our output buffer for the next packet
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityEditPacketSender::queueEraseEntityMessage(const EntityItemID& entityItemID) {
|
void EntityEditPacketSender::queueEraseEntityMessage(const EntityItemID& entityItemID) {
|
||||||
|
|
|
@ -83,7 +83,7 @@ EntityPropertyFlags EntityItem::getEntityProperties(EncodeBitstreamParams& param
|
||||||
requestedProperties += PROP_ANGULAR_VELOCITY;
|
requestedProperties += PROP_ANGULAR_VELOCITY;
|
||||||
requestedProperties += PROP_ACCELERATION;
|
requestedProperties += PROP_ACCELERATION;
|
||||||
|
|
||||||
requestedProperties += PROP_DIMENSIONS; // NOTE: PROP_RADIUS obsolete
|
requestedProperties += PROP_DIMENSIONS;
|
||||||
requestedProperties += PROP_DENSITY;
|
requestedProperties += PROP_DENSITY;
|
||||||
requestedProperties += PROP_GRAVITY;
|
requestedProperties += PROP_GRAVITY;
|
||||||
requestedProperties += PROP_DAMPING;
|
requestedProperties += PROP_DAMPING;
|
||||||
|
@ -241,7 +241,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_VELOCITY, getLocalAngularVelocity());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_VELOCITY, getLocalAngularVelocity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ACCELERATION, getAcceleration());
|
APPEND_ENTITY_PROPERTY(PROP_ACCELERATION, getAcceleration());
|
||||||
|
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DIMENSIONS, getDimensions()); // NOTE: PROP_RADIUS obsolete
|
APPEND_ENTITY_PROPERTY(PROP_DIMENSIONS, getDimensions());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DENSITY, getDensity());
|
APPEND_ENTITY_PROPERTY(PROP_DENSITY, getDensity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_GRAVITY, getGravity());
|
APPEND_ENTITY_PROPERTY(PROP_GRAVITY, getGravity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DAMPING, getDamping());
|
APPEND_ENTITY_PROPERTY(PROP_DAMPING, getDamping());
|
||||||
|
|
|
@ -1221,8 +1221,9 @@ void EntityItemProperties::entityPropertyFlagsFromScriptValue(const QScriptValue
|
||||||
//
|
//
|
||||||
// TODO: Implement support for script and visible properties.
|
// TODO: Implement support for script and visible properties.
|
||||||
//
|
//
|
||||||
bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItemID id, const EntityItemProperties& properties,
|
OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItemID id, const EntityItemProperties& properties,
|
||||||
QByteArray& buffer) {
|
QByteArray& buffer, EntityPropertyFlags requestedProperties, EntityPropertyFlags& didntFitProperties) {
|
||||||
|
|
||||||
OctreePacketData ourDataPacket(false, buffer.size()); // create a packetData object to add out packet details too.
|
OctreePacketData ourDataPacket(false, buffer.size()); // create a packetData object to add out packet details too.
|
||||||
OctreePacketData* packetData = &ourDataPacket; // we want a pointer to this so we can use our APPEND_ENTITY_PROPERTY macro
|
OctreePacketData* packetData = &ourDataPacket; // we want a pointer to this so we can use our APPEND_ENTITY_PROPERTY macro
|
||||||
|
|
||||||
|
@ -1264,17 +1265,8 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
|
||||||
QByteArray encodedUpdateDelta = updateDeltaCoder;
|
QByteArray encodedUpdateDelta = updateDeltaCoder;
|
||||||
|
|
||||||
EntityPropertyFlags propertyFlags(PROP_LAST_ITEM);
|
EntityPropertyFlags propertyFlags(PROP_LAST_ITEM);
|
||||||
EntityPropertyFlags requestedProperties = properties.getChangedProperties();
|
|
||||||
EntityPropertyFlags propertiesDidntFit = requestedProperties;
|
EntityPropertyFlags propertiesDidntFit = requestedProperties;
|
||||||
|
|
||||||
// TODO: we need to handle the multi-pass form of this, similar to how we handle entity data
|
|
||||||
//
|
|
||||||
// If we are being called for a subsequent pass at appendEntityData() that failed to completely encode this item,
|
|
||||||
// then our modelTreeElementExtraEncodeData should include data about which properties we need to append.
|
|
||||||
//if (modelTreeElementExtraEncodeData && modelTreeElementExtraEncodeData->includedItems.contains(getEntityItemID())) {
|
|
||||||
// requestedProperties = modelTreeElementExtraEncodeData->includedItems.value(getEntityItemID());
|
|
||||||
//}
|
|
||||||
|
|
||||||
LevelDetails entityLevel = packetData->startLevel();
|
LevelDetails entityLevel = packetData->startLevel();
|
||||||
|
|
||||||
// Last Edited quint64 always first, before any other details, which allows us easy access to adjusting this
|
// Last Edited quint64 always first, before any other details, which allows us easy access to adjusting this
|
||||||
|
@ -1316,7 +1308,7 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
|
||||||
|
|
||||||
APPEND_ENTITY_PROPERTY(PROP_SIMULATION_OWNER, properties._simulationOwner.toByteArray());
|
APPEND_ENTITY_PROPERTY(PROP_SIMULATION_OWNER, properties._simulationOwner.toByteArray());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_POSITION, properties.getPosition());
|
APPEND_ENTITY_PROPERTY(PROP_POSITION, properties.getPosition());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DIMENSIONS, properties.getDimensions()); // NOTE: PROP_RADIUS obsolete
|
APPEND_ENTITY_PROPERTY(PROP_DIMENSIONS, properties.getDimensions());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ROTATION, properties.getRotation());
|
APPEND_ENTITY_PROPERTY(PROP_ROTATION, properties.getRotation());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DENSITY, properties.getDensity());
|
APPEND_ENTITY_PROPERTY(PROP_DENSITY, properties.getDensity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_VELOCITY, properties.getVelocity());
|
APPEND_ENTITY_PROPERTY(PROP_VELOCITY, properties.getVelocity());
|
||||||
|
@ -1472,6 +1464,7 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
|
||||||
properties.getType() == EntityTypes::Sphere) {
|
properties.getType() == EntityTypes::Sphere) {
|
||||||
APPEND_ENTITY_PROPERTY(PROP_SHAPE, properties.getShape());
|
APPEND_ENTITY_PROPERTY(PROP_SHAPE, properties.getShape());
|
||||||
}
|
}
|
||||||
|
|
||||||
APPEND_ENTITY_PROPERTY(PROP_NAME, properties.getName());
|
APPEND_ENTITY_PROPERTY(PROP_NAME, properties.getName());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISION_SOUND_URL, properties.getCollisionSoundURL());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISION_SOUND_URL, properties.getCollisionSoundURL());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ACTION_DATA, properties.getActionData());
|
APPEND_ENTITY_PROPERTY(PROP_ACTION_DATA, properties.getActionData());
|
||||||
|
@ -1522,12 +1515,7 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
|
||||||
|
|
||||||
// If any part of the model items didn't fit, then the element is considered partial
|
// If any part of the model items didn't fit, then the element is considered partial
|
||||||
if (appendState != OctreeElement::COMPLETED) {
|
if (appendState != OctreeElement::COMPLETED) {
|
||||||
// TODO: handle mechanism for handling partial fitting data!
|
didntFitProperties = propertiesDidntFit;
|
||||||
// add this item into our list for the next appendElementData() pass
|
|
||||||
//modelTreeElementExtraEncodeData->includedItems.insert(getEntityItemID(), propertiesDidntFit);
|
|
||||||
|
|
||||||
// for now, if it's not complete, it's not successful
|
|
||||||
success = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1543,11 +1531,15 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
|
||||||
} else {
|
} else {
|
||||||
qCDebug(entities) << "ERROR - encoded edit message doesn't fit in output buffer.";
|
qCDebug(entities) << "ERROR - encoded edit message doesn't fit in output buffer.";
|
||||||
success = false;
|
success = false;
|
||||||
|
appendState = OctreeElement::NONE; // if we got here, then we didn't include the item
|
||||||
|
// maybe we should assert!!!
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
packetData->discardSubTree();
|
packetData->discardSubTree();
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
|
|
||||||
|
return appendState;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray EntityItemProperties::getPackedNormals() const {
|
QByteArray EntityItemProperties::getPackedNormals() const {
|
||||||
|
@ -1673,7 +1665,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
|
||||||
|
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_SIMULATION_OWNER, QByteArray, setSimulationOwner);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_SIMULATION_OWNER, QByteArray, setSimulationOwner);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_POSITION, glm::vec3, setPosition);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_POSITION, glm::vec3, setPosition);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DIMENSIONS, glm::vec3, setDimensions); // NOTE: PROP_RADIUS obsolete
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DIMENSIONS, glm::vec3, setDimensions);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ROTATION, glm::quat, setRotation);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ROTATION, glm::quat, setRotation);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DENSITY, float, setDensity);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DENSITY, float, setDensity);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_VELOCITY, glm::vec3, setVelocity);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_VELOCITY, glm::vec3, setVelocity);
|
||||||
|
|
|
@ -262,8 +262,8 @@ public:
|
||||||
float getLocalRenderAlpha() const { return _localRenderAlpha; }
|
float getLocalRenderAlpha() const { return _localRenderAlpha; }
|
||||||
void setLocalRenderAlpha(float value) { _localRenderAlpha = value; _localRenderAlphaChanged = true; }
|
void setLocalRenderAlpha(float value) { _localRenderAlpha = value; _localRenderAlphaChanged = true; }
|
||||||
|
|
||||||
static bool encodeEntityEditPacket(PacketType command, EntityItemID id, const EntityItemProperties& properties,
|
static OctreeElement::AppendState encodeEntityEditPacket(PacketType command, EntityItemID id, const EntityItemProperties& properties,
|
||||||
QByteArray& buffer);
|
QByteArray& buffer, EntityPropertyFlags requestedProperties, EntityPropertyFlags& didntFitProperties);
|
||||||
|
|
||||||
static bool encodeEraseEntityMessage(const EntityItemID& entityItemID, QByteArray& buffer);
|
static bool encodeEraseEntityMessage(const EntityItemID& entityItemID, QByteArray& buffer);
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,7 @@ enum EntityPropertyList {
|
||||||
// these properties are supported by the EntityItem base class
|
// these properties are supported by the EntityItem base class
|
||||||
PROP_VISIBLE,
|
PROP_VISIBLE,
|
||||||
PROP_POSITION,
|
PROP_POSITION,
|
||||||
PROP_RADIUS, // NOTE: PROP_RADIUS is obsolete and only included in old format streams
|
PROP_DIMENSIONS,
|
||||||
PROP_DIMENSIONS = PROP_RADIUS,
|
|
||||||
PROP_ROTATION,
|
PROP_ROTATION,
|
||||||
PROP_DENSITY,
|
PROP_DENSITY,
|
||||||
PROP_VELOCITY,
|
PROP_VELOCITY,
|
||||||
|
@ -47,13 +46,13 @@ enum EntityPropertyList {
|
||||||
PROP_ANGULAR_VELOCITY,
|
PROP_ANGULAR_VELOCITY,
|
||||||
PROP_ANGULAR_DAMPING,
|
PROP_ANGULAR_DAMPING,
|
||||||
PROP_COLLISIONLESS,
|
PROP_COLLISIONLESS,
|
||||||
PROP_DYNAMIC,
|
PROP_DYNAMIC, // 24
|
||||||
|
|
||||||
// property used by Light entity
|
// property used by Light entity
|
||||||
PROP_IS_SPOTLIGHT,
|
PROP_IS_SPOTLIGHT,
|
||||||
PROP_DIFFUSE_COLOR,
|
PROP_DIFFUSE_COLOR,
|
||||||
PROP_AMBIENT_COLOR_UNUSED,
|
PROP_AMBIENT_COLOR_UNUSED, // FIXME - No longer used, can remove and bump protocol
|
||||||
PROP_SPECULAR_COLOR_UNUSED,
|
PROP_SPECULAR_COLOR_UNUSED, // FIXME - No longer used, can remove and bump protocol
|
||||||
PROP_INTENSITY, // Previously PROP_CONSTANT_ATTENUATION
|
PROP_INTENSITY, // Previously PROP_CONSTANT_ATTENUATION
|
||||||
PROP_LINEAR_ATTENUATION_UNUSED,
|
PROP_LINEAR_ATTENUATION_UNUSED,
|
||||||
PROP_QUADRATIC_ATTENUATION_UNUSED,
|
PROP_QUADRATIC_ATTENUATION_UNUSED,
|
||||||
|
@ -61,30 +60,30 @@ enum EntityPropertyList {
|
||||||
PROP_CUTOFF,
|
PROP_CUTOFF,
|
||||||
|
|
||||||
// available to all entities
|
// available to all entities
|
||||||
PROP_LOCKED,
|
PROP_LOCKED, // 34
|
||||||
|
|
||||||
PROP_TEXTURES, // used by Model entities
|
PROP_TEXTURES, // used by Model entities
|
||||||
PROP_ANIMATION_SETTINGS, // used by Model entities
|
PROP_ANIMATION_SETTINGS_UNUSED, // FIXME - No longer used, can remove and bump protocol
|
||||||
PROP_USER_DATA, // all entities
|
PROP_USER_DATA, // all entities -- 37
|
||||||
PROP_SHAPE_TYPE, // used by Model + zones entities
|
PROP_SHAPE_TYPE, // used by Model + zones entities
|
||||||
|
|
||||||
// used by ParticleEffect entities
|
// used by ParticleEffect entities
|
||||||
PROP_MAX_PARTICLES,
|
PROP_MAX_PARTICLES, // 39
|
||||||
PROP_LIFESPAN,
|
PROP_LIFESPAN, // 40 -- used by all entities
|
||||||
PROP_EMIT_RATE,
|
PROP_EMIT_RATE,
|
||||||
PROP_EMIT_SPEED,
|
PROP_EMIT_SPEED,
|
||||||
PROP_EMIT_STRENGTH,
|
PROP_EMIT_STRENGTH,
|
||||||
PROP_EMIT_ACCELERATION,
|
PROP_EMIT_ACCELERATION, // FIXME - doesn't seem to get set in mark all changed????
|
||||||
PROP_PARTICLE_RADIUS,
|
PROP_PARTICLE_RADIUS, // 45!!
|
||||||
|
|
||||||
PROP_COMPOUND_SHAPE_URL, // used by Model + zones entities
|
PROP_COMPOUND_SHAPE_URL, // used by Model + zones entities
|
||||||
PROP_MARKETPLACE_ID, // all entities
|
PROP_MARKETPLACE_ID, // all entities
|
||||||
PROP_ACCELERATION, // all entities
|
PROP_ACCELERATION, // all entities
|
||||||
PROP_SIMULATION_OWNER, // formerly known as PROP_SIMULATOR_ID
|
PROP_SIMULATION_OWNER, // formerly known as PROP_SIMULATOR_ID
|
||||||
PROP_NAME, // all entities
|
PROP_NAME, // all entities -- 50
|
||||||
PROP_COLLISION_SOUND_URL,
|
PROP_COLLISION_SOUND_URL,
|
||||||
PROP_RESTITUTION,
|
PROP_RESTITUTION,
|
||||||
PROP_FRICTION,
|
PROP_FRICTION, // 53
|
||||||
|
|
||||||
PROP_VOXEL_VOLUME_SIZE,
|
PROP_VOXEL_VOLUME_SIZE,
|
||||||
PROP_VOXEL_DATA,
|
PROP_VOXEL_DATA,
|
||||||
|
@ -96,7 +95,7 @@ enum EntityPropertyList {
|
||||||
|
|
||||||
// used by hyperlinks
|
// used by hyperlinks
|
||||||
PROP_HREF,
|
PROP_HREF,
|
||||||
PROP_DESCRIPTION,
|
PROP_DESCRIPTION, // 61
|
||||||
|
|
||||||
PROP_FACE_CAMERA,
|
PROP_FACE_CAMERA,
|
||||||
PROP_SCRIPT_TIMESTAMP,
|
PROP_SCRIPT_TIMESTAMP,
|
||||||
|
|
|
@ -68,8 +68,8 @@ bool OctreePacketData::append(const unsigned char* data, int length) {
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool wantDebug = false;
|
#ifdef WANT_DEBUG
|
||||||
if (wantDebug && !success) {
|
if (!success) {
|
||||||
qCDebug(octree) << "OctreePacketData::append(const unsigned char* data, int length) FAILING....";
|
qCDebug(octree) << "OctreePacketData::append(const unsigned char* data, int length) FAILING....";
|
||||||
qCDebug(octree) << " length=" << length;
|
qCDebug(octree) << " length=" << length;
|
||||||
qCDebug(octree) << " _bytesAvailable=" << _bytesAvailable;
|
qCDebug(octree) << " _bytesAvailable=" << _bytesAvailable;
|
||||||
|
@ -77,6 +77,7 @@ bool OctreePacketData::append(const unsigned char* data, int length) {
|
||||||
qCDebug(octree) << " _targetSize=" << _targetSize;
|
qCDebug(octree) << " _targetSize=" << _targetSize;
|
||||||
qCDebug(octree) << " _bytesReserved=" << _bytesReserved;
|
qCDebug(octree) << " _bytesReserved=" << _bytesReserved;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -647,6 +648,13 @@ void OctreePacketData::debugContent() {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OctreePacketData::debugBytes() {
|
||||||
|
qCDebug(octree) << " _bytesAvailable=" << _bytesAvailable;
|
||||||
|
qCDebug(octree) << " _bytesInUse=" << _bytesInUse;
|
||||||
|
qCDebug(octree) << " _targetSize=" << _targetSize;
|
||||||
|
qCDebug(octree) << " _bytesReserved=" << _bytesReserved;
|
||||||
|
}
|
||||||
|
|
||||||
int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, QString& result) {
|
int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, QString& result) {
|
||||||
uint16_t length;
|
uint16_t length;
|
||||||
memcpy(&length, dataBytes, sizeof(length));
|
memcpy(&length, dataBytes, sizeof(length));
|
||||||
|
|
|
@ -240,6 +240,7 @@ public:
|
||||||
|
|
||||||
/// displays contents for debugging
|
/// displays contents for debugging
|
||||||
void debugContent();
|
void debugContent();
|
||||||
|
void debugBytes();
|
||||||
|
|
||||||
static quint64 getCompressContentTime() { return _compressContentTime; } /// total time spent compressing content
|
static quint64 getCompressContentTime() { return _compressContentTime; } /// total time spent compressing content
|
||||||
static quint64 getCompressContentCalls() { return _compressContentCalls; } /// total calls to compress content
|
static quint64 getCompressContentCalls() { return _compressContentCalls; } /// total calls to compress content
|
||||||
|
|
|
@ -13,12 +13,13 @@
|
||||||
makeDispatcherModuleParameters, MSECS_PER_SEC, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
|
makeDispatcherModuleParameters, MSECS_PER_SEC, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
|
||||||
PICK_MAX_DISTANCE, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD,
|
PICK_MAX_DISTANCE, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD,
|
||||||
DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_OFF_VALUE, TRIGGER_ON_VALUE, ZERO_VEC, ensureDynamic,
|
DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_OFF_VALUE, TRIGGER_ON_VALUE, ZERO_VEC, ensureDynamic,
|
||||||
getControllerWorldLocation, projectOntoEntityXYPlane, ContextOverlay, HMD, Reticle, Overlays, isPointingAtUI
|
getControllerWorldLocation, projectOntoEntityXYPlane, ContextOverlay, HMD, Reticle, Overlays, isPointingAtUI, Xform, getEntityParents
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
Script.include("/~/system/libraries/controllers.js");
|
Script.include("/~/system/libraries/controllers.js");
|
||||||
|
Script.include("/~/system/libraries/Xform.js");
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var PICK_WITH_HAND_RAY = true;
|
var PICK_WITH_HAND_RAY = true;
|
||||||
|
@ -113,18 +114,71 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
];
|
];
|
||||||
|
|
||||||
var MARGIN = 25;
|
var MARGIN = 25;
|
||||||
|
|
||||||
|
function TargetObject(entityID, entityProps) {
|
||||||
|
this.entityID = entityID;
|
||||||
|
this.entityProps = entityProps;
|
||||||
|
this.targetEntityID = null;
|
||||||
|
this.targetEntityProps = null;
|
||||||
|
this.previousCollisionStatus = null;
|
||||||
|
this.madeDynamic = null;
|
||||||
|
|
||||||
|
this.makeDynamic = function() {
|
||||||
|
if (this.targetEntityID) {
|
||||||
|
var newProps = {
|
||||||
|
dynamic: true,
|
||||||
|
collisionless: true
|
||||||
|
};
|
||||||
|
this.previousCollisionStatus = this.targetEntityProps.collisionless;
|
||||||
|
Entities.editEntity(this.targetEntityID, newProps);
|
||||||
|
this.madeDynamic = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.restoreTargetEntityOriginalProps = function() {
|
||||||
|
if (this.madeDynamic) {
|
||||||
|
var props = {};
|
||||||
|
props.dynamic = false;
|
||||||
|
props.collisionless = this.previousCollisionStatus;
|
||||||
|
var zeroVector = {x: 0, y: 0, z:0};
|
||||||
|
props.localVelocity = zeroVector;
|
||||||
|
props.localRotation = zeroVector;
|
||||||
|
Entities.editEntity(this.targetEntityID, props);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getTargetEntity = function() {
|
||||||
|
var parentPropsLength = this.parentProps.length;
|
||||||
|
if (parentPropsLength !== 0) {
|
||||||
|
var targetEntity = {
|
||||||
|
id: this.parentProps[parentPropsLength - 1].id,
|
||||||
|
props: this.parentProps[parentPropsLength - 1]};
|
||||||
|
this.targetEntityID = targetEntity.id;
|
||||||
|
this.targetEntityProps = targetEntity.props;
|
||||||
|
return targetEntity;
|
||||||
|
}
|
||||||
|
this.targetEntityID = this.entityID;
|
||||||
|
this.targetEntityProps = this.entityProps;
|
||||||
|
return {
|
||||||
|
id: this.entityID,
|
||||||
|
props: this.entityProps};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function FarActionGrabEntity(hand) {
|
function FarActionGrabEntity(hand) {
|
||||||
this.hand = hand;
|
this.hand = hand;
|
||||||
this.grabbedThingID = null;
|
this.grabbedThingID = null;
|
||||||
|
this.targetObject = null;
|
||||||
this.actionID = null; // action this script created...
|
this.actionID = null; // action this script created...
|
||||||
|
this.entityToLockOnto = null;
|
||||||
this.entityWithContextOverlay = false;
|
this.entityWithContextOverlay = false;
|
||||||
this.contextOverlayTimer = false;
|
this.contextOverlayTimer = false;
|
||||||
this.previousCollisionStatus = false;
|
this.previousCollisionStatus = false;
|
||||||
|
this.locked = false;
|
||||||
this.reticleMinX = MARGIN;
|
this.reticleMinX = MARGIN;
|
||||||
this.reticleMaxX;
|
this.reticleMaxX;
|
||||||
this.reticleMinY = MARGIN;
|
this.reticleMinY = MARGIN;
|
||||||
this.reticleMaxY;
|
this.reticleMaxY;
|
||||||
this.madeDynamic = false;
|
|
||||||
|
|
||||||
var ACTION_TTL = 15; // seconds
|
var ACTION_TTL = 15; // seconds
|
||||||
|
|
||||||
|
@ -158,9 +212,25 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
LaserPointers.enableLaserPointer(laserPointerID);
|
LaserPointers.enableLaserPointer(laserPointerID);
|
||||||
LaserPointers.setRenderState(laserPointerID, mode);
|
LaserPointers.setRenderState(laserPointerID, mode);
|
||||||
if (this.distanceHolding || this.distanceRotating) {
|
if (this.distanceHolding || this.distanceRotating) {
|
||||||
LaserPointers.setLockEndUUID(laserPointerID, this.grabbedThingID, this.grabbedIsOverlay);
|
if (!this.locked) {
|
||||||
|
// calculate offset
|
||||||
|
var targetProps = Entities.getEntityProperties(this.targetObject.entityID, [
|
||||||
|
"position",
|
||||||
|
"rotation"
|
||||||
|
]);
|
||||||
|
var zeroVector = { x: 0, y: 0, z:0, w: 0 };
|
||||||
|
var intersection = controllerData.rayPicks[this.hand].intersection;
|
||||||
|
var intersectionMat = new Xform(zeroVector, intersection);
|
||||||
|
var modelMat = new Xform(targetProps.rotation, targetProps.position);
|
||||||
|
var modelMatInv = modelMat.inv();
|
||||||
|
var xformMat = Xform.mul(modelMatInv, intersectionMat);
|
||||||
|
var offsetMat = Mat4.createFromRotAndTrans(xformMat.rot, xformMat.pos);
|
||||||
|
LaserPointers.setLockEndUUID(laserPointerID, this.targetObject.entityID, this.grabbedIsOverlay, offsetMat);
|
||||||
|
this.locked = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LaserPointers.setLockEndUUID(laserPointerID, null, false);
|
LaserPointers.setLockEndUUID(laserPointerID, null, false);
|
||||||
|
this.locked = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -339,18 +409,12 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
|
|
||||||
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
||||||
Entities.callEntityMethod(this.grabbedThingID, "releaseGrab", args);
|
Entities.callEntityMethod(this.grabbedThingID, "releaseGrab", args);
|
||||||
|
if (this.targetObject) {
|
||||||
if (this.madeDynamic) {
|
this.targetObject.restoreTargetEntityOriginalProps();
|
||||||
var props = {};
|
|
||||||
props.dynamic = false;
|
|
||||||
props.collisionless = this.previousCollisionStatus;
|
|
||||||
props.localVelocity = {x: 0, y: 0, z: 0};
|
|
||||||
props.localRotation = {x: 0, y: 0, z: 0};
|
|
||||||
Entities.editEntity(this.grabbedThingID, props);
|
|
||||||
this.madeDynamic = false;
|
|
||||||
}
|
}
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
this.grabbedThingID = null;
|
this.grabbedThingID = null;
|
||||||
|
this.targetObject = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateRecommendedArea = function() {
|
this.updateRecommendedArea = function() {
|
||||||
|
@ -503,17 +567,18 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
"userData", "locked", "type"
|
"userData", "locked", "type"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
this.targetObject = new TargetObject(entityID, targetProps);
|
||||||
|
this.targetObject.parentProps = getEntityParents(targetProps);
|
||||||
if (entityID !== this.entityWithContextOverlay) {
|
if (entityID !== this.entityWithContextOverlay) {
|
||||||
this.destroyContextOverlay();
|
this.destroyContextOverlay();
|
||||||
}
|
}
|
||||||
|
var targetEntity = this.targetObject.getTargetEntity();
|
||||||
|
entityID = targetEntity.id;
|
||||||
|
targetProps = targetEntity.props;
|
||||||
|
|
||||||
if (entityIsGrabbable(targetProps)) {
|
if (entityIsGrabbable(targetProps)) {
|
||||||
if (!entityIsDistanceGrabbable(targetProps)) {
|
if (!entityIsDistanceGrabbable(targetProps)) {
|
||||||
targetProps.dynamic = true;
|
this.targetObject.makeDynamic();
|
||||||
this.previousCollisionStatus = targetProps.collisionless;
|
|
||||||
targetProps.collisionless = true;
|
|
||||||
Entities.editEntity(entityID, targetProps);
|
|
||||||
this.madeDynamic = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.distanceRotating) {
|
if (!this.distanceRotating) {
|
||||||
|
|
|
@ -315,6 +315,10 @@ Grabber.prototype.pressEvent = function(event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.isAlt || event.isMeta) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Overlays.getOverlayAtPoint(Reticle.position) > 0) {
|
if (Overlays.getOverlayAtPoint(Reticle.position) > 0) {
|
||||||
// the mouse is pointing at an overlay; don't look for entities underneath the overlay.
|
// the mouse is pointing at an overlay; don't look for entities underneath the overlay.
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1333,7 +1333,7 @@ function sortSelectedEntities(selected) {
|
||||||
return sortedEntities;
|
return sortedEntities;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recursiveDelete(entities, childrenList) {
|
function recursiveDelete(entities, childrenList, deletedIDs) {
|
||||||
var entitiesLength = entities.length;
|
var entitiesLength = entities.length;
|
||||||
for (var i = 0; i < entitiesLength; i++) {
|
for (var i = 0; i < entitiesLength; i++) {
|
||||||
var entityID = entities[i];
|
var entityID = entities[i];
|
||||||
|
@ -1346,6 +1346,7 @@ function recursiveDelete(entities, childrenList) {
|
||||||
properties: initialProperties,
|
properties: initialProperties,
|
||||||
children: grandchildrenList
|
children: grandchildrenList
|
||||||
});
|
});
|
||||||
|
deletedIDs.push(entityID);
|
||||||
Entities.deleteEntity(entityID);
|
Entities.deleteEntity(entityID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1413,6 +1414,8 @@ function parentSelectedEntities() {
|
||||||
}
|
}
|
||||||
function deleteSelectedEntities() {
|
function deleteSelectedEntities() {
|
||||||
if (SelectionManager.hasSelection()) {
|
if (SelectionManager.hasSelection()) {
|
||||||
|
var deletedIDs = [];
|
||||||
|
|
||||||
selectedParticleEntityID = null;
|
selectedParticleEntityID = null;
|
||||||
particleExplorerTool.destroyWebView();
|
particleExplorerTool.destroyWebView();
|
||||||
SelectionManager.saveProperties();
|
SelectionManager.saveProperties();
|
||||||
|
@ -1423,16 +1426,22 @@ function deleteSelectedEntities() {
|
||||||
var initialProperties = SelectionManager.savedProperties[entityID];
|
var initialProperties = SelectionManager.savedProperties[entityID];
|
||||||
var children = Entities.getChildrenIDs(entityID);
|
var children = Entities.getChildrenIDs(entityID);
|
||||||
var childList = [];
|
var childList = [];
|
||||||
recursiveDelete(children, childList);
|
recursiveDelete(children, childList, deletedIDs);
|
||||||
savedProperties.push({
|
savedProperties.push({
|
||||||
entityID: entityID,
|
entityID: entityID,
|
||||||
properties: initialProperties,
|
properties: initialProperties,
|
||||||
children: childList
|
children: childList
|
||||||
});
|
});
|
||||||
|
deletedIDs.push(entityID);
|
||||||
Entities.deleteEntity(entityID);
|
Entities.deleteEntity(entityID);
|
||||||
}
|
}
|
||||||
SelectionManager.clearSelections();
|
SelectionManager.clearSelections();
|
||||||
pushCommandForSelections([], savedProperties);
|
pushCommandForSelections([], savedProperties);
|
||||||
|
|
||||||
|
entityListTool.webView.emitScriptEvent(JSON.stringify({
|
||||||
|
type: "deleted",
|
||||||
|
ids: deletedIDs
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,6 @@ function loaded() {
|
||||||
}
|
}
|
||||||
elDelete.onclick = function() {
|
elDelete.onclick = function() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'delete' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'delete' }));
|
||||||
refreshEntities();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("keydown", function (keyDownEvent) {
|
document.addEventListener("keydown", function (keyDownEvent) {
|
||||||
|
@ -362,6 +361,12 @@ function loaded() {
|
||||||
updateSelectedEntities(data.selectedIDs);
|
updateSelectedEntities(data.selectedIDs);
|
||||||
resize();
|
resize();
|
||||||
}
|
}
|
||||||
|
} else if (data.type === "deleted") {
|
||||||
|
for (i = 0, length = data.ids.length; i < length; i++) {
|
||||||
|
delete entities[data.ids[i]];
|
||||||
|
entityList.remove("id", data.ids[i]);
|
||||||
|
}
|
||||||
|
refreshFooter();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTimeout(refreshEntities, 1000);
|
setTimeout(refreshEntities, 1000);
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
window.location = "https://clara.io/library?gameCheck=true&public=true";
|
window.location = "https://clara.io/library?gameCheck=true&public=true";
|
||||||
});
|
});
|
||||||
$('#exploreHifiMarketplace').on('click', function () {
|
$('#exploreHifiMarketplace').on('click', function () {
|
||||||
window.location = "http://www.highfidelity.com/marketplace";
|
window.location = metaverseServerURL + "/marketplace";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,9 +612,9 @@
|
||||||
var HIFI_ITEM_PAGE = 3;
|
var HIFI_ITEM_PAGE = 3;
|
||||||
var pageType = DIRECTORY;
|
var pageType = DIRECTORY;
|
||||||
|
|
||||||
if (location.href.indexOf("highfidelity.com/") !== -1) { pageType = HIFI; }
|
if (location.href.indexOf(metaverseServerURL + "/") !== -1) { pageType = HIFI; }
|
||||||
if (location.href.indexOf("clara.io/") !== -1) { pageType = CLARA; }
|
if (location.href.indexOf("clara.io/") !== -1) { pageType = CLARA; }
|
||||||
if (location.href.indexOf("highfidelity.com/marketplace/items/") !== -1) { pageType = HIFI_ITEM_PAGE; }
|
if (location.href.indexOf(metaverseServerURL + "/marketplace/items/") !== -1) { pageType = HIFI_ITEM_PAGE; }
|
||||||
|
|
||||||
injectCommonCode(pageType === DIRECTORY);
|
injectCommonCode(pageType === DIRECTORY);
|
||||||
switch (pageType) {
|
switch (pageType) {
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
/* global entityIsCloneable:true, getGrabbableData:true, cloneEntity:true, propsAreCloneDynamic:true, Script,
|
/* global entityIsCloneable:true, getGrabbableData:true, cloneEntity:true, propsAreCloneDynamic:true, Script,
|
||||||
propsAreCloneDynamic:true, Entities*/
|
propsAreCloneDynamic:true, Entities*/
|
||||||
|
|
||||||
Script.include("/~/system/controllers/controllerDispatcherUtils.js");
|
Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
|
|
||||||
|
|
||||||
// Object assign polyfill
|
// Object assign polyfill
|
||||||
if (typeof Object.assign !== 'function') {
|
if (typeof Object.assign !== 'function') {
|
||||||
|
|
|
@ -35,12 +35,14 @@
|
||||||
propsArePhysical:true,
|
propsArePhysical:true,
|
||||||
controllerDispatcherPluginsNeedSort:true,
|
controllerDispatcherPluginsNeedSort:true,
|
||||||
projectOntoXYPlane:true,
|
projectOntoXYPlane:true,
|
||||||
|
getChildrenProps:true,
|
||||||
projectOntoEntityXYPlane:true,
|
projectOntoEntityXYPlane:true,
|
||||||
projectOntoOverlayXYPlane:true,
|
projectOntoOverlayXYPlane:true,
|
||||||
entityHasActions:true,
|
entityHasActions:true,
|
||||||
ensureDynamic:true,
|
ensureDynamic:true,
|
||||||
findGroupParent:true,
|
findGroupParent:true,
|
||||||
BUMPER_ON_VALUE:true,
|
BUMPER_ON_VALUE:true,
|
||||||
|
getEntityParents:true,
|
||||||
findHandChildEntities:true,
|
findHandChildEntities:true,
|
||||||
TEAR_AWAY_DISTANCE:true,
|
TEAR_AWAY_DISTANCE:true,
|
||||||
TEAR_AWAY_COUNT:true,
|
TEAR_AWAY_COUNT:true,
|
||||||
|
@ -306,6 +308,23 @@ findGroupParent = function (controllerData, targetProps) {
|
||||||
return targetProps;
|
return targetProps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getEntityParents = function(targetProps) {
|
||||||
|
var parentProperties = [];
|
||||||
|
while (targetProps.parentID &&
|
||||||
|
targetProps.parentID !== Uuid.NULL &&
|
||||||
|
Entities.getNestableType(targetProps.parentID) == "entity") {
|
||||||
|
var parentProps = Entities.getEntityProperties(targetProps.parentID, DISPATCHER_PROPERTIES);
|
||||||
|
if (!parentProps) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
parentProps.id = targetProps.parentID;
|
||||||
|
targetProps = parentProps;
|
||||||
|
parentProperties.push(parentProps);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parentProperties;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
findHandChildEntities = function(hand) {
|
findHandChildEntities = function(hand) {
|
||||||
// find children of avatar's hand joint
|
// find children of avatar's hand joint
|
||||||
|
|
|
@ -74,7 +74,7 @@ void OctreeTests::propertyFlagsTests() {
|
||||||
EntityPropertyFlags props;
|
EntityPropertyFlags props;
|
||||||
props.setHasProperty(PROP_VISIBLE);
|
props.setHasProperty(PROP_VISIBLE);
|
||||||
props.setHasProperty(PROP_POSITION);
|
props.setHasProperty(PROP_POSITION);
|
||||||
props.setHasProperty(PROP_RADIUS);
|
props.setHasProperty(PROP_DIMENSIONS);
|
||||||
props.setHasProperty(PROP_MODEL_URL);
|
props.setHasProperty(PROP_MODEL_URL);
|
||||||
props.setHasProperty(PROP_COMPOUND_SHAPE_URL);
|
props.setHasProperty(PROP_COMPOUND_SHAPE_URL);
|
||||||
props.setHasProperty(PROP_ROTATION);
|
props.setHasProperty(PROP_ROTATION);
|
||||||
|
|
Loading…
Reference in a new issue