From bc319cb3401c0ee742a1bb9333d0a6df0881d3cc Mon Sep 17 00:00:00 2001
From: HifiExperiments
Date: Sat, 11 Jan 2020 22:29:07 -0800
Subject: [PATCH 001/105] zone occlusion
---
interface/src/graphics/WorldBox.h | 4 -
.../src/RenderableEntityItem.cpp | 27 +++++-
.../src/RenderableEntityItem.h | 4 +
.../src/RenderableModelEntityItem.cpp | 10 +++
.../src/RenderableModelEntityItem.h | 1 +
.../src/RenderableTextEntityItem.cpp | 19 +++++
.../src/RenderableTextEntityItem.h | 2 +
.../src/RenderableZoneEntityItem.cpp | 7 ++
libraries/entities/src/EntityItem.cpp | 20 +++++
libraries/entities/src/EntityItem.h | 8 ++
.../entities/src/EntityItemProperties.cpp | 15 ++++
libraries/entities/src/EntityItemProperties.h | 1 +
.../entities/src/EntityItemPropertiesMacros.h | 7 ++
libraries/entities/src/EntityPropertyFlags.h | 1 +
libraries/networking/src/udt/PacketHeaders.h | 1 +
libraries/octree/src/OctreePacketData.cpp | 22 +++++
libraries/octree/src/OctreePacketData.h | 4 +
.../render-utils/src/MeshPartPayload.cpp | 28 ++++++-
libraries/render-utils/src/MeshPartPayload.h | 6 ++
libraries/render-utils/src/Model.cpp | 10 +++
libraries/render-utils/src/Model.h | 2 +
libraries/render/src/render/Args.h | 10 +--
libraries/render/src/render/CullTask.cpp | 84 +++++++------------
libraries/render/src/render/CullTask.h | 16 ++--
libraries/render/src/render/Item.cpp | 6 ++
libraries/render/src/render/Item.h | 13 ++-
.../src/render/RenderFetchCullSortTask.cpp | 1 +
libraries/shared/src/RegisteredMetaTypes.cpp | 18 ++++
libraries/shared/src/RegisteredMetaTypes.h | 2 +
29 files changed, 272 insertions(+), 77 deletions(-)
diff --git a/interface/src/graphics/WorldBox.h b/interface/src/graphics/WorldBox.h
index 114777ba0f..4d53652c0e 100644
--- a/interface/src/graphics/WorldBox.h
+++ b/interface/src/graphics/WorldBox.h
@@ -19,8 +19,6 @@
#include
#include "Menu.h"
-
-
class WorldBoxRenderData {
public:
typedef render::Payload Payload;
@@ -29,8 +27,6 @@ public:
int _val = 0;
static render::ItemID _item; // unique WorldBoxRenderData
-
-
static void renderWorldBox(RenderArgs* args, gpu::Batch& batch);
};
diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp
index ae56a8fc47..dcf90cd966 100644
--- a/libraries/entities-renderer/src/RenderableEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp
@@ -128,7 +128,7 @@ std::shared_ptr make_renderer(const EntityItemPointer& entity) {
return std::shared_ptr(new T(entity), [](T* ptr) { ptr->deleteLater(); });
}
-EntityRenderer::EntityRenderer(const EntityItemPointer& entity) : _created(entity->getCreated()), _entity(entity) {}
+EntityRenderer::EntityRenderer(const EntityItemPointer& entity) : _created(entity->getCreated()), _entity(entity), _entityID(entity->getID()) {}
EntityRenderer::~EntityRenderer() {}
@@ -196,6 +196,23 @@ uint32_t EntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) const {
return 0;
}
+bool EntityRenderer::passesZoneOcclusionTest(const std::unordered_set& containingZones) const {
+ auto renderWithZones = resultWithReadLock>([&] {
+ return _renderWithZones;
+ });
+ if (!renderWithZones.isEmpty()) {
+ if (!containingZones.empty()) {
+ for (auto renderWithZone : renderWithZones) {
+ if (containingZones.find(renderWithZone) != containingZones.end()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
void EntityRenderer::render(RenderArgs* args) {
if (!isValidRenderItem()) {
return;
@@ -385,6 +402,10 @@ bool EntityRenderer::needsRenderUpdateFromEntity(const EntityItemPointer& entity
return true;
}
+ if (entity->needsZoneOcclusionUpdate()) {
+ return true;
+ }
+
return false;
}
@@ -426,6 +447,10 @@ void EntityRenderer::doRenderUpdateSynchronous(const ScenePointer& scene, Transa
_canCastShadow = entity->getCanCastShadow();
setCullWithParent(entity->getCullWithParent());
_cauterized = entity->getCauterized();
+ if (entity->needsZoneOcclusionUpdate()) {
+ entity->resetNeedsZoneOcclusionUpdate();
+ setRenderWithZones(entity->getRenderWithZones());
+ }
entity->setNeedsRenderUpdate(false);
});
}
diff --git a/libraries/entities-renderer/src/RenderableEntityItem.h b/libraries/entities-renderer/src/RenderableEntityItem.h
index 227eb6a018..9c787d82c2 100644
--- a/libraries/entities-renderer/src/RenderableEntityItem.h
+++ b/libraries/entities-renderer/src/RenderableEntityItem.h
@@ -65,6 +65,7 @@ public:
virtual uint32_t metaFetchMetaSubItems(ItemIDs& subItems) const override;
virtual Item::Bound getBound() override;
+ bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const override;
protected:
virtual bool needsRenderUpdateFromEntity() const final { return needsRenderUpdateFromEntity(_entity); }
@@ -109,6 +110,7 @@ protected:
virtual void setRenderLayer(RenderLayer value) { _renderLayer = value; }
virtual void setPrimitiveMode(PrimitiveMode value) { _primitiveMode = value; }
virtual void setCullWithParent(bool value) { _cullWithParent = value; }
+ virtual void setRenderWithZones(const QVector& renderWithZones) { _renderWithZones = renderWithZones; }
template
T withReadLockResult(const std::function& f) {
@@ -143,6 +145,7 @@ protected:
bool _cullWithParent { false };
RenderLayer _renderLayer { RenderLayer::WORLD };
PrimitiveMode _primitiveMode { PrimitiveMode::SOLID };
+ QVector _renderWithZones;
bool _cauterized { false };
bool _moving { false };
// Only touched on the rendering thread
@@ -153,6 +156,7 @@ protected:
std::mutex _materialsLock;
quint64 _created;
+ QUuid _entityID;
// The base class relies on comparing the model transform to the entity transform in order
// to trigger an update, so the member must not be visible to derived classes as a modifiable
diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp
index 5fbbdfa0b8..107890cd21 100644
--- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp
@@ -1324,6 +1324,9 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
setKey(didVisualGeometryRequestSucceed);
_model->setTagMask(getTagMask());
_model->setHifiRenderLayer(getHifiRenderLayer());
+ _model->setPrimitiveMode(_primitiveMode);
+ _model->setCullWithParent(_cullWithParent);
+ _model->setRenderWithZones(_renderWithZones);
emit requestRenderUpdate();
if(didVisualGeometryRequestSucceed) {
emit DependencyManager::get()->
@@ -1507,6 +1510,13 @@ void ModelEntityRenderer::setCullWithParent(bool value) {
}
}
+void ModelEntityRenderer::setRenderWithZones(const QVector& renderWithZones) {
+ Parent::setRenderWithZones(renderWithZones);
+ if (_model) {
+ _model->setRenderWithZones(renderWithZones);
+ }
+}
+
// NOTE: this only renders the "meta" portion of the Model, namely it renders debugging items
void ModelEntityRenderer::doRender(RenderArgs* args) {
DETAILED_PROFILE_RANGE(render_detail, "MetaModelRender");
diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.h b/libraries/entities-renderer/src/RenderableModelEntityItem.h
index 0119c7bc26..84384532d0 100644
--- a/libraries/entities-renderer/src/RenderableModelEntityItem.h
+++ b/libraries/entities-renderer/src/RenderableModelEntityItem.h
@@ -165,6 +165,7 @@ protected:
void setRenderLayer(RenderLayer value) override;
void setPrimitiveMode(PrimitiveMode value) override;
void setCullWithParent(bool value) override;
+ void setRenderWithZones(const QVector& renderWithZones) override;
private:
void animate(const TypedEntityPointer& entity);
diff --git a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp
index fbd10e2f5b..2ba1acea11 100644
--- a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp
@@ -289,6 +289,17 @@ ShapeKey entities::TextPayload::getShapeKey() const {
return ShapeKey::Builder::invalid();
}
+bool entities::TextPayload::passesZoneOcclusionTest(const std::unordered_set& containingZones) const {
+ auto entityTreeRenderer = DependencyManager::get();
+ if (entityTreeRenderer) {
+ auto renderable = entityTreeRenderer->renderableForEntityId(_entityID);
+ if (renderable) {
+ return std::static_pointer_cast(renderable)->passesZoneOcclusionTest(containingZones);
+ }
+ }
+ return false;
+}
+
void entities::TextPayload::render(RenderArgs* args) {
PerformanceTimer perfTimer("TextPayload::render");
Q_ASSERT(args->_batch);
@@ -388,4 +399,12 @@ template <> const ShapeKey shapeGetShapeKey(const TextPayload::Pointer& payload)
template <> void payloadRender(const TextPayload::Pointer& payload, RenderArgs* args) {
return payload->render(args);
}
+
+template <> bool payloadPassesZoneOcclusionTest(const entities::TextPayload::Pointer& payload, const std::unordered_set& containingZones) {
+ if (payload) {
+ return payload->passesZoneOcclusionTest(containingZones);
+ }
+ return false;
+}
+
}
diff --git a/libraries/entities-renderer/src/RenderableTextEntityItem.h b/libraries/entities-renderer/src/RenderableTextEntityItem.h
index 63cf3e6e9e..87102daa32 100644
--- a/libraries/entities-renderer/src/RenderableTextEntityItem.h
+++ b/libraries/entities-renderer/src/RenderableTextEntityItem.h
@@ -94,6 +94,7 @@ public:
Item::Bound getBound() const;
ShapeKey getShapeKey() const;
void render(RenderArgs* args);
+ bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const;
protected:
QUuid _entityID;
@@ -109,6 +110,7 @@ namespace render {
template <> const Item::Bound payloadGetBound(const entities::TextPayload::Pointer& payload);
template <> const ShapeKey shapeGetShapeKey(const entities::TextPayload::Pointer& payload);
template <> void payloadRender(const entities::TextPayload::Pointer& payload, RenderArgs* args);
+ template <> bool payloadPassesZoneOcclusionTest(const entities::TextPayload::Pointer& payload, const std::unordered_set& containingZones);
}
#endif // hifi_RenderableTextEntityItem_h
diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp
index bbb8c67ad1..948c6ca762 100644
--- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp
@@ -71,6 +71,11 @@ void ZoneEntityRenderer::onRemoveFromSceneTyped(const TypedEntityPointer& entity
}
void ZoneEntityRenderer::doRender(RenderArgs* args) {
+ // This is necessary so that zones can themselves be zone culled
+ if (!passesZoneOcclusionTest(CullTest::_prevContainingZones)) {
+ return;
+ }
+
if (!_stage) {
_stage = args->_scene->getStage();
assert(_stage);
@@ -180,6 +185,8 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
_bloomStage->_currentFrame.pushBloom(_bloomIndex);
}
}
+
+ CullTest::_containingZones.insert(_entityID);
}
void ZoneEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp
index cc215d3528..0fffe2de35 100644
--- a/libraries/entities/src/EntityItem.cpp
+++ b/libraries/entities/src/EntityItem.cpp
@@ -105,6 +105,7 @@ EntityPropertyFlags EntityItem::getEntityProperties(EncodeBitstreamParams& param
requestedProperties += PROP_RENDER_LAYER;
requestedProperties += PROP_PRIMITIVE_MODE;
requestedProperties += PROP_IGNORE_PICK_INTERSECTION;
+ requestedProperties += PROP_RENDER_WITH_ZONES;
requestedProperties += _grabProperties.getEntityProperties(params);
// Physics
@@ -300,6 +301,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
APPEND_ENTITY_PROPERTY(PROP_RENDER_LAYER, (uint32_t)getRenderLayer());
APPEND_ENTITY_PROPERTY(PROP_PRIMITIVE_MODE, (uint32_t)getPrimitiveMode());
APPEND_ENTITY_PROPERTY(PROP_IGNORE_PICK_INTERSECTION, getIgnorePickIntersection());
+ APPEND_ENTITY_PROPERTY(PROP_RENDER_WITH_ZONES, getRenderWithZones());
withReadLock([&] {
_grabProperties.appendSubclassData(packetData, params, entityTreeElementExtraEncodeData, requestedProperties,
propertyFlags, propertiesDidntFit, propertyCount, appendState);
@@ -875,6 +877,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
READ_ENTITY_PROPERTY(PROP_RENDER_LAYER, RenderLayer, setRenderLayer);
READ_ENTITY_PROPERTY(PROP_PRIMITIVE_MODE, PrimitiveMode, setPrimitiveMode);
READ_ENTITY_PROPERTY(PROP_IGNORE_PICK_INTERSECTION, bool, setIgnorePickIntersection);
+ READ_ENTITY_PROPERTY(PROP_RENDER_WITH_ZONES, QVector, setRenderWithZones);
withWriteLock([&] {
int bytesFromGrab = _grabProperties.readEntitySubclassDataFromBuffer(dataAt, (bytesLeftToRead - bytesRead), args,
propertyFlags, overwriteLocalData,
@@ -1354,6 +1357,7 @@ EntityItemProperties EntityItem::getProperties(const EntityPropertyFlags& desire
COPY_ENTITY_PROPERTY_TO_PROPERTIES(renderLayer, getRenderLayer);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(primitiveMode, getPrimitiveMode);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(ignorePickIntersection, getIgnorePickIntersection);
+ COPY_ENTITY_PROPERTY_TO_PROPERTIES(renderWithZones, getRenderWithZones);
withReadLock([&] {
_grabProperties.getProperties(properties);
});
@@ -1503,6 +1507,7 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
SET_ENTITY_PROPERTY_FROM_PROPERTIES(renderLayer, setRenderLayer);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(primitiveMode, setPrimitiveMode);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(ignorePickIntersection, setIgnorePickIntersection);
+ SET_ENTITY_PROPERTY_FROM_PROPERTIES(renderWithZones, setRenderWithZones);
withWriteLock([&] {
bool grabPropertiesChanged = _grabProperties.setProperties(properties);
somethingChanged |= grabPropertiesChanged;
@@ -3520,3 +3525,18 @@ void EntityItem::disableGrab(GrabPointer grab) {
}
}
}
+
+void EntityItem::setRenderWithZones(const QVector& renderWithZones) {
+ withWriteLock([&] {
+ if (_renderWithZones != renderWithZones) {
+ _needsZoneOcclusionUpdate = true;
+ _renderWithZones = renderWithZones;
+ }
+ });
+}
+
+QVector EntityItem::getRenderWithZones() const {
+ return resultWithReadLock>([&] {
+ return _renderWithZones;
+ });
+}
\ No newline at end of file
diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h
index 14b8b259cc..2d2d158ebd 100644
--- a/libraries/entities/src/EntityItem.h
+++ b/libraries/entities/src/EntityItem.h
@@ -577,6 +577,11 @@ public:
bool needsRenderUpdate() const { return resultWithReadLock([&] { return _needsRenderUpdate; }); }
void setNeedsRenderUpdate(bool needsRenderUpdate) { withWriteLock([&] { _needsRenderUpdate = needsRenderUpdate; }); }
+ void setRenderWithZones(const QVector& renderWithZones);
+ QVector getRenderWithZones() const;
+ bool needsZoneOcclusionUpdate() const { return _needsZoneOcclusionUpdate; }
+ void resetNeedsZoneOcclusionUpdate() { withWriteLock([&] { _needsZoneOcclusionUpdate = false; }); }
+
signals:
void spaceUpdate(std::pair data);
@@ -765,6 +770,9 @@ protected:
QHash _grabActions;
+ QVector _renderWithZones;
+ mutable bool _needsZoneOcclusionUpdate { false };
+
bool _cullWithParent { false };
mutable bool _needsRenderUpdate { false };
diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp
index 2b8f2b4c14..54f84beee1 100644
--- a/libraries/entities/src/EntityItemProperties.cpp
+++ b/libraries/entities/src/EntityItemProperties.cpp
@@ -421,6 +421,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
CHECK_PROPERTY_CHANGE(PROP_RENDER_LAYER, renderLayer);
CHECK_PROPERTY_CHANGE(PROP_PRIMITIVE_MODE, primitiveMode);
CHECK_PROPERTY_CHANGE(PROP_IGNORE_PICK_INTERSECTION, ignorePickIntersection);
+ CHECK_PROPERTY_CHANGE(PROP_RENDER_WITH_ZONES, renderWithZones);
changedProperties += _grab.getChangedProperties();
// Physics
@@ -793,6 +794,10 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* avatar entities, false
if they won't be.
* @property {Uuid} cloneOriginID - The ID of the entity that this entity was cloned from.
*
+ * @property {Uuid[]} renderWithZones=[]] - A list of entity IDs representing with which zones this entity should render.
+ * If it is empty, this entity will render normally. Otherwise, this entity will only render if your avatar is within
+ * one of the zones in this list.
+ *
* @property {Entities.Grab} grab - The entity's grab-related properties.
*
* @property {string} itemName="" - Certifiable name of the Marketplace item.
@@ -1583,6 +1588,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_RENDER_LAYER, renderLayer, getRenderLayerAsString());
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_PRIMITIVE_MODE, primitiveMode, getPrimitiveModeAsString());
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_IGNORE_PICK_INTERSECTION, ignorePickIntersection);
+ COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_RENDER_WITH_ZONES, renderWithZones);
_grab.copyToScriptValue(_desiredProperties, properties, engine, skipDefaults, defaultEntityProperties);
// Physics
@@ -2000,6 +2006,7 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
COPY_PROPERTY_FROM_QSCRIPTVALUE_ENUM(renderLayer, RenderLayer);
COPY_PROPERTY_FROM_QSCRIPTVALUE_ENUM(primitiveMode, PrimitiveMode);
COPY_PROPERTY_FROM_QSCRIPTVALUE(ignorePickIntersection, bool, setIgnorePickIntersection);
+ COPY_PROPERTY_FROM_QSCRIPTVALUE(renderWithZones, qVectorQUuid, setRenderWithZones);
_grab.copyFromScriptValue(object, _defaultSettings);
// Physics
@@ -2293,6 +2300,7 @@ void EntityItemProperties::merge(const EntityItemProperties& other) {
COPY_PROPERTY_IF_CHANGED(renderLayer);
COPY_PROPERTY_IF_CHANGED(primitiveMode);
COPY_PROPERTY_IF_CHANGED(ignorePickIntersection);
+ COPY_PROPERTY_IF_CHANGED(renderWithZones);
_grab.merge(other._grab);
// Physics
@@ -2585,6 +2593,7 @@ bool EntityItemProperties::getPropertyInfo(const QString& propertyName, EntityPr
ADD_PROPERTY_TO_MAP(PROP_RENDER_LAYER, RenderLayer, renderLayer, RenderLayer);
ADD_PROPERTY_TO_MAP(PROP_PRIMITIVE_MODE, PrimitiveMode, primitiveMode, PrimitiveMode);
ADD_PROPERTY_TO_MAP(PROP_IGNORE_PICK_INTERSECTION, IgnorePickIntersection, ignorePickIntersection, bool);
+ ADD_PROPERTY_TO_MAP(PROP_RENDER_WITH_ZONES, RenderWithZones, renderWithZones, QVector);
{ // Grab
ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_GRABBABLE, Grab, grab, Grabbable, grabbable);
ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_KINEMATIC, Grab, grab, GrabKinematic, grabKinematic);
@@ -3073,6 +3082,7 @@ OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketTy
APPEND_ENTITY_PROPERTY(PROP_RENDER_LAYER, (uint32_t)properties.getRenderLayer());
APPEND_ENTITY_PROPERTY(PROP_PRIMITIVE_MODE, (uint32_t)properties.getPrimitiveMode());
APPEND_ENTITY_PROPERTY(PROP_IGNORE_PICK_INTERSECTION, properties.getIgnorePickIntersection());
+ APPEND_ENTITY_PROPERTY(PROP_RENDER_WITH_ZONES, properties.getRenderWithZones());
_staticGrab.setProperties(properties);
_staticGrab.appendToEditPacket(packetData, requestedProperties, propertyFlags,
propertiesDidntFit, propertyCount, appendState);
@@ -3562,6 +3572,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_RENDER_LAYER, RenderLayer, setRenderLayer);
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_PRIMITIVE_MODE, PrimitiveMode, setPrimitiveMode);
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_IGNORE_PICK_INTERSECTION, bool, setIgnorePickIntersection);
+ READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_RENDER_WITH_ZONES, QVector, setRenderWithZones);
properties.getGrab().decodeFromEditPacket(propertyFlags, dataAt, processedBytes);
// Physics
@@ -3979,6 +3990,7 @@ void EntityItemProperties::markAllChanged() {
_renderLayerChanged = true;
_primitiveModeChanged = true;
_ignorePickIntersectionChanged = true;
+ _renderWithZonesChanged = true;
_grab.markAllChanged();
// Physics
@@ -4381,6 +4393,9 @@ QList EntityItemProperties::listChangedProperties() {
if (ignorePickIntersectionChanged()) {
out += "ignorePickIntersection";
}
+ if (renderWithZonesChanged()) {
+ out += "renderWithZones";
+ }
getGrab().listChangedProperties(out);
// Physics
diff --git a/libraries/entities/src/EntityItemProperties.h b/libraries/entities/src/EntityItemProperties.h
index 63d8183899..69c25cecdd 100644
--- a/libraries/entities/src/EntityItemProperties.h
+++ b/libraries/entities/src/EntityItemProperties.h
@@ -192,6 +192,7 @@ public:
DEFINE_PROPERTY_REF_ENUM(PROP_RENDER_LAYER, RenderLayer, renderLayer, RenderLayer, RenderLayer::WORLD);
DEFINE_PROPERTY_REF_ENUM(PROP_PRIMITIVE_MODE, PrimitiveMode, primitiveMode, PrimitiveMode, PrimitiveMode::SOLID);
DEFINE_PROPERTY(PROP_IGNORE_PICK_INTERSECTION, IgnorePickIntersection, ignorePickIntersection, bool, false);
+ DEFINE_PROPERTY_REF(PROP_RENDER_WITH_ZONES, RenderWithZones, renderWithZones, QVector, QVector());
DEFINE_PROPERTY_GROUP(Grab, grab, GrabPropertyGroup);
// Physics
diff --git a/libraries/entities/src/EntityItemPropertiesMacros.h b/libraries/entities/src/EntityItemPropertiesMacros.h
index 4c989ef74e..c25eb21e6c 100644
--- a/libraries/entities/src/EntityItemPropertiesMacros.h
+++ b/libraries/entities/src/EntityItemPropertiesMacros.h
@@ -119,6 +119,7 @@ inline QScriptValue qVectorVec3Color_convertScriptValue(QScriptEngine* e, const
inline QScriptValue convertScriptValue(QScriptEngine* e, const QVector& v) {return qVectorQuatToScriptValue(e, v); }
inline QScriptValue convertScriptValue(QScriptEngine* e, const QVector& v) {return qVectorBoolToScriptValue(e, v); }
inline QScriptValue convertScriptValue(QScriptEngine* e, const QVector& v) { return qVectorFloatToScriptValue(e, v); }
+inline QScriptValue convertScriptValue(QScriptEngine* e, const QVector& v) { return qVectorQUuidToScriptValue(e, v); }
inline QScriptValue convertScriptValue(QScriptEngine* e, const QRect& v) { return qRectToScriptValue(e, v); }
@@ -216,6 +217,7 @@ typedef QVector qVectorVec3;
typedef QVector qVectorQuat;
typedef QVector qVectorBool;
typedef QVector qVectorFloat;
+typedef QVector qVectorQUuid;
inline float float_convertFromScriptValue(const QScriptValue& v, bool& isValid) { return v.toVariant().toFloat(&isValid); }
inline quint64 quint64_convertFromScriptValue(const QScriptValue& v, bool& isValid) { return v.toVariant().toULongLong(&isValid); }
inline quint32 quint32_convertFromScriptValue(const QScriptValue& v, bool& isValid) {
@@ -293,6 +295,11 @@ inline qVectorBool qVectorBool_convertFromScriptValue(const QScriptValue& v, boo
return qVectorBoolFromScriptValue(v);
}
+inline qVectorQUuid qVectorQUuid_convertFromScriptValue(const QScriptValue& v, bool& isValid) {
+ isValid = true;
+ return qVectorQUuidFromScriptValue(v);
+}
+
inline glm::quat quat_convertFromScriptValue(const QScriptValue& v, bool& isValid) {
isValid = false; /// assume it can't be converted
QScriptValue x = v.property("x");
diff --git a/libraries/entities/src/EntityPropertyFlags.h b/libraries/entities/src/EntityPropertyFlags.h
index d5af337a7d..c186b2b87f 100644
--- a/libraries/entities/src/EntityPropertyFlags.h
+++ b/libraries/entities/src/EntityPropertyFlags.h
@@ -43,6 +43,7 @@ enum EntityPropertyList {
PROP_RENDER_LAYER,
PROP_PRIMITIVE_MODE,
PROP_IGNORE_PICK_INTERSECTION,
+ PROP_RENDER_WITH_ZONES,
// Grab
PROP_GRAB_GRABBABLE,
PROP_GRAB_KINEMATIC,
diff --git a/libraries/networking/src/udt/PacketHeaders.h b/libraries/networking/src/udt/PacketHeaders.h
index fbf575065e..1bfeff5e7f 100644
--- a/libraries/networking/src/udt/PacketHeaders.h
+++ b/libraries/networking/src/udt/PacketHeaders.h
@@ -275,6 +275,7 @@ enum class EntityVersion : PacketVersion {
ShadowBiasAndDistance,
TextEntityFonts,
ScriptServerKinematicMotion,
+ ZoneOcclusion,
// Add new versions above here
NUM_PACKET_TYPE,
diff --git a/libraries/octree/src/OctreePacketData.cpp b/libraries/octree/src/OctreePacketData.cpp
index 8ab502e951..5e6825c886 100755
--- a/libraries/octree/src/OctreePacketData.cpp
+++ b/libraries/octree/src/OctreePacketData.cpp
@@ -482,6 +482,19 @@ bool OctreePacketData::appendValue(const QVector& value) {
return success;
}
+bool OctreePacketData::appendValue(const QVector& value) {
+ uint16_t qVecSize = value.size();
+ bool success = appendValue(qVecSize);
+ if (success) {
+ success = append((const unsigned char*)value.constData(), qVecSize * sizeof(QUuid));
+ if (success) {
+ _bytesOfValues += qVecSize * sizeof(QUuid);
+ _totalBytesOfValues += qVecSize * sizeof(QUuid);
+ }
+ }
+ return success;
+}
+
bool OctreePacketData::appendValue(const glm::quat& value) {
const size_t VALUES_PER_QUAT = 4;
const size_t PACKED_QUAT_SIZE = sizeof(uint16_t) * VALUES_PER_QUAT;
@@ -774,6 +787,15 @@ int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, QVecto
return (dataBytes - start) + (int)sizeof(uint16_t);
}
+int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, QVector& result) {
+ uint16_t length;
+ memcpy(&length, dataBytes, sizeof(uint16_t));
+ dataBytes += sizeof(length);
+ result.resize(length);
+ memcpy(result.data(), dataBytes, length * sizeof(QUuid));
+ return sizeof(uint16_t) + length * sizeof(QUuid);
+}
+
int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, QByteArray& result) {
uint16_t length;
memcpy(&length, dataBytes, sizeof(length));
diff --git a/libraries/octree/src/OctreePacketData.h b/libraries/octree/src/OctreePacketData.h
index 46e5de9bda..2050dd1487 100644
--- a/libraries/octree/src/OctreePacketData.h
+++ b/libraries/octree/src/OctreePacketData.h
@@ -186,6 +186,9 @@ public:
/// appends a QVector of bools to the end of the stream, may fail if new data stream is too long to fit in packet
bool appendValue(const QVector& value);
+ /// appends a QVector of QUuids to the end of the stream, may fail if new data stream is too long to fit in packet
+ bool appendValue(const QVector& value);
+
/// appends a packed quat to the end of the stream, may fail if new data stream is too long to fit in packet
bool appendValue(const glm::quat& value);
@@ -284,6 +287,7 @@ public:
static int unpackDataFromBytes(const unsigned char* dataBytes, QVector& result);
static int unpackDataFromBytes(const unsigned char* dataBytes, QVector& result);
static int unpackDataFromBytes(const unsigned char* dataBytes, QVector& result);
+ static int unpackDataFromBytes(const unsigned char* dataBytes, QVector& result);
static int unpackDataFromBytes(const unsigned char* dataBytes, QByteArray& result);
static int unpackDataFromBytes(const unsigned char* dataBytes, AACube& result);
static int unpackDataFromBytes(const unsigned char* dataBytes, QRect& result);
diff --git a/libraries/render-utils/src/MeshPartPayload.cpp b/libraries/render-utils/src/MeshPartPayload.cpp
index e82af5395f..88ba24cbc2 100644
--- a/libraries/render-utils/src/MeshPartPayload.cpp
+++ b/libraries/render-utils/src/MeshPartPayload.cpp
@@ -55,6 +55,13 @@ template <> const ShapeKey shapeGetShapeKey(const MeshPartPayload::Pointer& payl
template <> void payloadRender(const MeshPartPayload::Pointer& payload, RenderArgs* args) {
return payload->render(args);
}
+
+template <> bool payloadPassesZoneOcclusionTest(const MeshPartPayload::Pointer& payload, const std::unordered_set& containingZones) {
+ if (payload) {
+ return payload->passesZoneOcclusionTest(containingZones);
+ }
+ return false;
+}
}
MeshPartPayload::MeshPartPayload(const std::shared_ptr& mesh, int partIndex, graphics::MaterialPointer material, const uint64_t& created) :
@@ -167,10 +174,23 @@ void MeshPartPayload::bindMesh(gpu::Batch& batch) {
batch.setInputStream(0, _drawMesh->getVertexStream());
}
- void MeshPartPayload::bindTransform(gpu::Batch& batch, RenderArgs::RenderMode renderMode) const {
+void MeshPartPayload::bindTransform(gpu::Batch& batch, RenderArgs::RenderMode renderMode) const {
batch.setModelTransform(_drawTransform);
}
+bool MeshPartPayload::passesZoneOcclusionTest(const std::unordered_set& containingZones) const {
+ if (!_renderWithZones.isEmpty()) {
+ if (!containingZones.empty()) {
+ for (auto renderWithZone : _renderWithZones) {
+ if (containingZones.find(renderWithZone) != containingZones.end()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ return true;
+}
void MeshPartPayload::render(RenderArgs* args) {
PerformanceTimer perfTimer("MeshPartPayload::render");
@@ -242,6 +262,12 @@ template <> void payloadRender(const ModelMeshPartPayload::Pointer& payload, Ren
return payload->render(args);
}
+template <> bool payloadPassesZoneOcclusionTest(const ModelMeshPartPayload::Pointer& payload, const std::unordered_set& containingZones) {
+ if (payload) {
+ return payload->passesZoneOcclusionTest(containingZones);
+ }
+ return false;
+}
}
ModelMeshPartPayload::ModelMeshPartPayload(ModelPointer model, int meshIndex, int partIndex, int shapeIndex,
diff --git a/libraries/render-utils/src/MeshPartPayload.h b/libraries/render-utils/src/MeshPartPayload.h
index ee205bd778..db3e1fca4d 100644
--- a/libraries/render-utils/src/MeshPartPayload.h
+++ b/libraries/render-utils/src/MeshPartPayload.h
@@ -75,11 +75,15 @@ public:
void setCullWithParent(bool value) { _cullWithParent = value; }
+ void setRenderWithZones(const QVector& renderWithZones) { _renderWithZones = renderWithZones; }
+ bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const;
+
static bool enableMaterialProceduralShaders;
protected:
render::ItemKey _itemKey{ render::ItemKey::Builder::opaqueShape().build() };
bool _cullWithParent { false };
+ QVector _renderWithZones;
uint64_t _created;
};
@@ -88,6 +92,7 @@ namespace render {
template <> const Item::Bound payloadGetBound(const MeshPartPayload::Pointer& payload);
template <> const ShapeKey shapeGetShapeKey(const MeshPartPayload::Pointer& payload);
template <> void payloadRender(const MeshPartPayload::Pointer& payload, RenderArgs* args);
+ template <> bool payloadPassesZoneOcclusionTest(const MeshPartPayload::Pointer& payload, const std::unordered_set& containingZones);
}
class ModelMeshPartPayload : public MeshPartPayload {
@@ -154,6 +159,7 @@ namespace render {
template <> const Item::Bound payloadGetBound(const ModelMeshPartPayload::Pointer& payload);
template <> const ShapeKey shapeGetShapeKey(const ModelMeshPartPayload::Pointer& payload);
template <> void payloadRender(const ModelMeshPartPayload::Pointer& payload, RenderArgs* args);
+ template <> bool payloadPassesZoneOcclusionTest(const ModelMeshPartPayload::Pointer& payload, const std::unordered_set& containingZones);
}
#endif // hifi_MeshPartPayload_h
diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp
index d8172112ff..db4fc46e36 100644
--- a/libraries/render-utils/src/Model.cpp
+++ b/libraries/render-utils/src/Model.cpp
@@ -976,6 +976,16 @@ void Model::setCullWithParent(bool cullWithParent) {
}
}
+void Model::setRenderWithZones(const QVector& renderWithZones) {
+ render::Transaction transaction;
+ for(auto item : _modelMeshRenderItemIDs) {
+ transaction.updateItem(item, [renderWithZones](ModelMeshPartPayload& data) {
+ data.setRenderWithZones(renderWithZones);
+ });
+ }
+ AbstractViewStateInterface::instance()->getMain3DScene()->enqueueTransaction(transaction);
+}
+
const render::ItemKey Model::getRenderItemKeyGlobalFlags() const {
return _renderItemKeyGlobalFlags;
}
diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h
index b677861e9f..ec68db4b27 100644
--- a/libraries/render-utils/src/Model.h
+++ b/libraries/render-utils/src/Model.h
@@ -131,6 +131,8 @@ public:
void setCullWithParent(bool value);
+ void setRenderWithZones(const QVector& renderWithZones);
+
// Access the current RenderItemKey Global Flags used by the model and applied to the render items representing the parts of the model.
const render::ItemKey getRenderItemKeyGlobalFlags() const;
diff --git a/libraries/render/src/render/Args.h b/libraries/render/src/render/Args.h
index a75192bad7..5fee00b370 100644
--- a/libraries/render/src/render/Args.h
+++ b/libraries/render/src/render/Args.h
@@ -13,15 +13,16 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
#include
#include "Forward.h"
-
class AABox;
namespace render {
@@ -142,13 +143,6 @@ namespace render {
bool _takingSnapshot { false };
StencilMaskMode _stencilMaskMode { StencilMaskMode::NONE };
std::function _stencilMaskOperator;
-
- float _visionSqueezeX { 0.0f };
- float _visionSqueezeY { 0.0f };
- float _visionSqueezeTransition { 0.15f };
- int _visionSqueezePerEye { 0 };
- float _visionSqueezeGroundPlaneY { 0.0f };
- float _visionSqueezeSpotlightSize { 0.02f };
};
}
diff --git a/libraries/render/src/render/CullTask.cpp b/libraries/render/src/render/CullTask.cpp
index 068d6f9851..f309d5a3bf 100644
--- a/libraries/render/src/render/CullTask.cpp
+++ b/libraries/render/src/render/CullTask.cpp
@@ -19,6 +19,9 @@
using namespace render;
+std::unordered_set CullTest::_containingZones = std::unordered_set();
+std::unordered_set CullTest::_prevContainingZones = std::unordered_set();
+
CullTest::CullTest(CullFunctor& functor, RenderArgs* pargs, RenderDetails::Item& renderDetails, ViewFrustumPointer antiFrustum) :
_functor(functor),
_args(pargs),
@@ -64,46 +67,8 @@ bool CullTest::solidAngleTest(const AABox& bound) {
return true;
}
-void render::cullItems(const RenderContextPointer& renderContext, const CullFunctor& cullFunctor, RenderDetails::Item& details,
- const ItemBounds& inItems, ItemBounds& outItems) {
- assert(renderContext->args);
- assert(renderContext->args->hasViewFrustum());
-
- RenderArgs* args = renderContext->args;
- const ViewFrustum& frustum = args->getViewFrustum();
-
- details._considered += (int)inItems.size();
-
- // Culling / LOD
- for (auto item : inItems) {
- if (item.bound.isNull()) {
- outItems.emplace_back(item); // One more Item to render
- continue;
- }
-
- // TODO: some entity types (like lights) might want to be rendered even
- // when they are outside of the view frustum...
- bool inView;
- {
- PerformanceTimer perfTimer("boxIntersectsFrustum");
- inView = frustum.boxIntersectsFrustum(item.bound);
- }
- if (inView) {
- bool bigEnoughToRender;
- {
- PerformanceTimer perfTimer("shouldRender");
- bigEnoughToRender = cullFunctor(args, item.bound);
- }
- if (bigEnoughToRender) {
- outItems.emplace_back(item); // One more Item to render
- } else {
- details._tooSmall++;
- }
- } else {
- details._outOfView++;
- }
- }
- details._rendered += (int)outItems.size();
+bool CullTest::zoneOcclusionTest(const render::Item& item) {
+ return item.passesZoneOcclusionTest(_containingZones);
}
void FetchNonspatialItems::run(const RenderContextPointer& renderContext, const ItemFilter& filter, ItemBounds& outItems) {
@@ -117,7 +82,7 @@ void FetchNonspatialItems::run(const RenderContextPointer& renderContext, const
outItems.reserve(items.size());
for (auto& id : items) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && item.passesZoneOcclusionTest(CullTest::_containingZones)) {
outItems.emplace_back(ItemBound(id, item.getBound()));
}
}
@@ -126,7 +91,6 @@ void FetchNonspatialItems::run(const RenderContextPointer& renderContext, const
void FetchSpatialTree::configure(const Config& config) {
_justFrozeFrustum = _justFrozeFrustum || (config.freezeFrustum && !_freezeFrustum);
_freezeFrustum = config.freezeFrustum;
- _lodAngle = config.lodAngle;
}
void FetchSpatialTree::run(const RenderContextPointer& renderContext, const Inputs& inputs, ItemSpatialTree::ItemSelection& outSelection) {
@@ -215,7 +179,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("insideFitItems");
for (auto id : inSelection.insideItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
outItems.emplace_back(itemBound);
if (item.getKey().isMetaCullGroup()) {
@@ -230,7 +194,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("insideSmallItems");
for (auto id : inSelection.insideSubcellItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
outItems.emplace_back(itemBound);
if (item.getKey().isMetaCullGroup()) {
@@ -245,7 +209,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("partialFitItems");
for (auto id : inSelection.partialItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
outItems.emplace_back(itemBound);
if (item.getKey().isMetaCullGroup()) {
@@ -260,7 +224,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("partialSmallItems");
for (auto id : inSelection.partialSubcellItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
outItems.emplace_back(itemBound);
if (item.getKey().isMetaCullGroup()) {
@@ -277,7 +241,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("insideFitItems");
for (auto id : inSelection.insideItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
outItems.emplace_back(itemBound);
if (item.getKey().isMetaCullGroup()) {
@@ -292,7 +256,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("insideSmallItems");
for (auto id : inSelection.insideSubcellItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
if (test.solidAngleTest(itemBound.bound)) {
outItems.emplace_back(itemBound);
@@ -309,7 +273,7 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("partialFitItems");
for (auto id : inSelection.partialItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
if (test.frustumTest(itemBound.bound)) {
outItems.emplace_back(itemBound);
@@ -326,14 +290,12 @@ void CullSpatialSelection::run(const RenderContextPointer& renderContext,
PerformanceTimer perfTimer("partialSmallItems");
for (auto id : inSelection.partialSubcellItems) {
auto& item = scene->getItem(id);
- if (filter.test(item.getKey())) {
+ if (filter.test(item.getKey()) && test.zoneOcclusionTest(item)) {
ItemBound itemBound(id, item.getBound());
- if (test.frustumTest(itemBound.bound)) {
- if (test.solidAngleTest(itemBound.bound)) {
- outItems.emplace_back(itemBound);
- if (item.getKey().isMetaCullGroup()) {
- item.fetchMetaSubItemBounds(outItems, (*scene));
- }
+ if (test.frustumTest(itemBound.bound) && test.solidAngleTest(itemBound.bound)) {
+ outItems.emplace_back(itemBound);
+ if (item.getKey().isMetaCullGroup()) {
+ item.fetchMetaSubItemBounds(outItems, (*scene));
}
}
}
@@ -444,3 +406,13 @@ void ApplyCullFunctorOnItemBounds::run(const RenderContextPointer& renderContext
args->popViewFrustum();
}
}
+
+void ClearContainingZones::run(const RenderContextPointer& renderContext) {
+ // This is a bit of a hack. We want to do zone culling as early as possible, so we do it
+ // during the RenderFetchCullSortTask (in CullSpatialSelection and FetchNonspatialItems),
+ // but the zones aren't collected until after (in SetupZones). To get around this,
+ // we actually use the zones from the previous frame to render, and then clear at the beginning
+ // of the next frame
+ CullTest::_prevContainingZones = CullTest::_containingZones;
+ CullTest::_containingZones.clear();
+}
\ No newline at end of file
diff --git a/libraries/render/src/render/CullTask.h b/libraries/render/src/render/CullTask.h
index e67edd6666..9a7466223d 100644
--- a/libraries/render/src/render/CullTask.h
+++ b/libraries/render/src/render/CullTask.h
@@ -19,9 +19,6 @@ namespace render {
using CullFunctor = std::function;
- void cullItems(const RenderContextPointer& renderContext, const CullFunctor& cullFunctor, RenderDetails::Item& details,
- const ItemBounds& inItems, ItemBounds& outItems);
-
// Culling Frustum / solidAngle test helper class
struct CullTest {
CullFunctor _functor;
@@ -36,6 +33,10 @@ namespace render {
bool frustumTest(const AABox& bound);
bool antiFrustumTest(const AABox& bound);
bool solidAngleTest(const AABox& bound);
+ bool zoneOcclusionTest(const render::Item& item);
+
+ static std::unordered_set _containingZones;
+ static std::unordered_set _prevContainingZones;
};
class FetchNonspatialItems {
@@ -48,7 +49,6 @@ namespace render {
Q_OBJECT
Q_PROPERTY(int numItems READ getNumItems)
Q_PROPERTY(bool freezeFrustum MEMBER freezeFrustum WRITE setFreezeFrustum)
- Q_PROPERTY(float LODAngle MEMBER lodAngle NOTIFY dirty)
public:
int numItems{ 0 };
@@ -56,7 +56,6 @@ namespace render {
bool freezeFrustum{ false };
- float lodAngle{ 2.0 };
public slots:
void setFreezeFrustum(bool enabled) { freezeFrustum = enabled; emit dirty(); }
@@ -68,7 +67,6 @@ namespace render {
bool _freezeFrustum{ false }; // initialized by Config
bool _justFrozeFrustum{ false };
ViewFrustum _frozenFrustum;
- float _lodAngle;
public:
using Config = FetchSpatialTreeConfig;
@@ -159,6 +157,12 @@ namespace render {
render::CullFunctor _cullFunctor;
};
+
+ class ClearContainingZones {
+ public:
+ using JobModel = Job::Model;
+ void run(const RenderContextPointer& renderContext);
+ };
}
#endif // hifi_render_CullTask_h;
\ No newline at end of file
diff --git a/libraries/render/src/render/Item.cpp b/libraries/render/src/render/Item.cpp
index 532964777f..f21df58368 100644
--- a/libraries/render/src/render/Item.cpp
+++ b/libraries/render/src/render/Item.cpp
@@ -154,4 +154,10 @@ namespace render {
return payload->metaFetchMetaSubItems(subItems);
}
+ template <> bool payloadPassesZoneOcclusionTest(const PayloadProxyInterface::Pointer& payload, const std::unordered_set& containingZones) {
+ if (!payload) {
+ return false;
+ }
+ return payload->passesZoneOcclusionTest(containingZones);
+ }
}
diff --git a/libraries/render/src/render/Item.h b/libraries/render/src/render/Item.h
index 3383101b5b..cb9fb32c7f 100644
--- a/libraries/render/src/render/Item.h
+++ b/libraries/render/src/render/Item.h
@@ -436,6 +436,8 @@ public:
virtual uint32_t fetchMetaSubItems(ItemIDs& subItems) const = 0;
+ virtual bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const = 0;
+
~PayloadInterface() {}
// Status interface is local to the base class
@@ -487,6 +489,8 @@ public:
uint32_t fetchMetaSubItems(ItemIDs& subItems) const { return _payload->fetchMetaSubItems(subItems); }
uint32_t fetchMetaSubItemBounds(ItemBounds& subItemBounds, Scene& scene) const;
+ bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const { return _payload->passesZoneOcclusionTest(containingZones); }
+
// Access the status
const StatusPointer& getStatus() const { return _payload->getStatus(); }
@@ -537,6 +541,10 @@ template const ShapeKey shapeGetShapeKey(const std::shared_ptr& pay
// Meta items act as the grouping object for several sub items (typically shapes).
template uint32_t metaFetchMetaSubItems(const std::shared_ptr& payloadData, ItemIDs& subItems) { return 0; }
+// Zone Occlusion Interface
+// Allows payloads to determine if they should render or not, based on the zones that contain the current camera
+template bool payloadPassesZoneOcclusionTest(const std::shared_ptr& payloadData, const std::unordered_set& containingZones) { return true; }
+
// THe Payload class is the real Payload to be used
// THis allow anything to be turned into a Payload as long as the required interface functions are available
// When creating a new kind of payload from a new "stuff" class then you need to create specialized version for "stuff"
@@ -561,6 +569,8 @@ public:
// Meta Type Interface
virtual uint32_t fetchMetaSubItems(ItemIDs& subItems) const override { return metaFetchMetaSubItems(_data, subItems); }
+ virtual bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const override { return payloadPassesZoneOcclusionTest(_data, containingZones); }
+
protected:
DataPointer _data;
@@ -615,6 +625,7 @@ public:
virtual Item::Bound getBound() = 0;
virtual void render(RenderArgs* args) = 0;
virtual uint32_t metaFetchMetaSubItems(ItemIDs& subItems) const = 0;
+ virtual bool passesZoneOcclusionTest(const std::unordered_set& containingZones) const = 0;
};
template <> const ItemKey payloadGetKey(const PayloadProxyInterface::Pointer& payload);
@@ -622,7 +633,7 @@ template <> const Item::Bound payloadGetBound(const PayloadProxyInterface::Point
template <> void payloadRender(const PayloadProxyInterface::Pointer& payload, RenderArgs* args);
template <> uint32_t metaFetchMetaSubItems(const PayloadProxyInterface::Pointer& payload, ItemIDs& subItems);
template <> const ShapeKey shapeGetShapeKey(const PayloadProxyInterface::Pointer& payload);
-
+template <> bool payloadPassesZoneOcclusionTest(const PayloadProxyInterface::Pointer& payload, const std::unordered_set& containingZones);
typedef Item::PayloadPointer PayloadPointer;
typedef std::vector Payloads;
diff --git a/libraries/render/src/render/RenderFetchCullSortTask.cpp b/libraries/render/src/render/RenderFetchCullSortTask.cpp
index ebcf5a432b..b2656a597f 100644
--- a/libraries/render/src/render/RenderFetchCullSortTask.cpp
+++ b/libraries/render/src/render/RenderFetchCullSortTask.cpp
@@ -74,6 +74,7 @@ void RenderFetchCullSortTask::build(JobModel& task, const Varying& input, Varyin
const auto filteredLayeredOpaque = task.addJob("FilterLayeredOpaque", layeredOpaques, ItemKey::Layer::LAYER_1);
const auto filteredLayeredTransparent = task.addJob("FilterLayeredTransparent", layeredTransparents, ItemKey::Layer::LAYER_1);
+ task.addJob("ClearContainingZones");
output = Output(BucketList{ opaques, transparents, lights, metas,
filteredLayeredOpaque.getN(0), filteredLayeredTransparent.getN(0),
diff --git a/libraries/shared/src/RegisteredMetaTypes.cpp b/libraries/shared/src/RegisteredMetaTypes.cpp
index 87cd269c97..97ca26b221 100644
--- a/libraries/shared/src/RegisteredMetaTypes.cpp
+++ b/libraries/shared/src/RegisteredMetaTypes.cpp
@@ -36,6 +36,7 @@ int qVectorVec3MetaTypeId = qRegisterMetaType>();
int qVectorQuatMetaTypeId = qRegisterMetaType>();
int qVectorBoolMetaTypeId = qRegisterMetaType>();
int qVectorGLMUint32MetaTypeId = qRegisterMetaType>("QVector");
+int qVectorQUuidMetaTypeId = qRegisterMetaType>();
int quatMetaTypeId = qRegisterMetaType();
int pickRayMetaTypeId = qRegisterMetaType();
int collisionMetaTypeId = qRegisterMetaType();
@@ -58,6 +59,7 @@ void registerMetaTypes(QScriptEngine* engine) {
qScriptRegisterMetaType(engine, qVectorBoolToScriptValue, qVectorBoolFromScriptValue);
qScriptRegisterMetaType(engine, qVectorFloatToScriptValue, qVectorFloatFromScriptValue);
qScriptRegisterMetaType(engine, qVectorIntToScriptValue, qVectorIntFromScriptValue);
+ qScriptRegisterMetaType(engine, qVectorQUuidToScriptValue, qVectorQUuidFromScriptValue);
qScriptRegisterMetaType(engine, qSizeFToScriptValue, qSizeFFromScriptValue);
qScriptRegisterMetaType(engine, qRectToScriptValue, qRectFromScriptValue);
@@ -874,6 +876,22 @@ QVector qVectorFloatFromScriptValue(const QScriptValue& array) {
return newVector;
}
+QScriptValue qVectorQUuidToScriptValue(QScriptEngine* engine, const QVector& vector) {
+ QScriptValue array = engine->newArray();
+ for (int i = 0; i < vector.size(); i++) {
+ array.setProperty(i, quuidToScriptValue(engine, vector.at(i)));
+ }
+ return array;
+}
+
+void qVectorQUuidFromScriptValue(const QScriptValue& array, QVector& vector) {
+ int length = array.property("length").toInteger();
+
+ for (int i = 0; i < length; i++) {
+ vector << array.property(i).toVariant().toUuid();
+ }
+}
+
QVector qVectorQUuidFromScriptValue(const QScriptValue& array) {
if (!array.isArray()) {
return QVector();
diff --git a/libraries/shared/src/RegisteredMetaTypes.h b/libraries/shared/src/RegisteredMetaTypes.h
index 3b47bb70c6..fa7ae624b2 100644
--- a/libraries/shared/src/RegisteredMetaTypes.h
+++ b/libraries/shared/src/RegisteredMetaTypes.h
@@ -247,6 +247,8 @@ QVector qVectorFloatFromScriptValue(const QScriptValue& array);
QScriptValue qVectorIntToScriptValue(QScriptEngine* engine, const QVector& vector);
void qVectorIntFromScriptValue(const QScriptValue& array, QVector& vector);
+QScriptValue qVectorQUuidToScriptValue(QScriptEngine* engine, const QVector& vector);
+void qVectorQUuidFromScriptValue(const QScriptValue& array, QVector& vector);
QVector qVectorQUuidFromScriptValue(const QScriptValue& array);
QScriptValue aaCubeToScriptValue(QScriptEngine* engine, const AACube& aaCube);
From 1a4266a64a93db554fea764aba38bb4596177b40 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Mon, 20 Jan 2020 14:33:06 +1300
Subject: [PATCH 002/105] Review JSDoc updates from recent commits
---
.../src/avatars/ScriptableAvatar.h | 10 +++++-----
interface/src/avatar/MyAvatar.h | 18 +++++++++---------
interface/src/ui/InteractiveWindow.cpp | 2 +-
.../src/avatars-renderer/Avatar.cpp | 2 +-
.../src/avatars-renderer/Avatar.h | 4 ++--
.../src/avatars-renderer/ScriptAvatar.h | 4 ++--
libraries/avatars/src/AvatarData.h | 10 +++++-----
libraries/avatars/src/ScriptAvatarData.h | 2 +-
.../GraphicsScriptingInterface.cpp | 2 +-
.../src/graphics-scripting/ScriptableMesh.h | 4 ++--
.../graphics-scripting/ScriptableMeshPart.h | 2 +-
.../src/graphics-scripting/ScriptableModel.h | 4 ++--
.../src/graphics/BufferViewHelpers.cpp | 2 +-
libraries/shared/src/JointData.h | 2 +-
libraries/shared/src/RegisteredMetaTypes.cpp | 2 +-
15 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/assignment-client/src/avatars/ScriptableAvatar.h b/assignment-client/src/avatars/ScriptableAvatar.h
index 500c3f44fb..1e6046ba7e 100644
--- a/assignment-client/src/avatars/ScriptableAvatar.h
+++ b/assignment-client/src/avatars/ScriptableAvatar.h
@@ -82,15 +82,15 @@
* Note: This property will automatically be set to true if the Controller system has valid facial
* blend shape actions.
* @property {boolean} hasProceduralBlinkFaceMovement=true - true
if avatars blink automatically by animating
- * facial blend shapes, false
if automatic blinking is disabled. Set this property to false
if
- * you wish to fully control the blink facial blend shapes via the {@link MyAvatar.setBlendshape} method.
+ * facial blend shapes, false
if automatic blinking is disabled. Set to false
to fully control
+ * the blink facial blend shapes via the {@link MyAvatar.setBlendshape} method.
* @property {boolean} hasProceduralEyeFaceMovement=true - true
if the facial blend shapes for an avatar's eyes
* adjust automatically as the eyes move, false
if this automatic movement is disabled. Set this property
- * to true
to prevent the iris from being obscured by the upper or lower lids. Set this property to
- * false
if you wish to fully control the eye blend shapes via the {@link MyAvatar.setBlendshape} method.
+ * to true
to prevent the iris from being obscured by the upper or lower lids. Set to false
to
+ * fully control the eye blend shapes via the {@link MyAvatar.setBlendshape} method.
* @property {boolean} hasAudioEnabledFaceMovement=true - true
if the avatar's mouth blend shapes animate
* automatically based on detected microphone input, false
if this automatic movement is disabled. Set
- * this property to false
if you wish to fully control the mouth facial blend shapes via the
+ * this property to false
to fully control the mouth facial blend shapes via the
* {@link MyAvatar.setBlendshape} method.
*
* @example Create a scriptable avatar.
diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h
index 9b9bc2d9df..0f46af458e 100644
--- a/interface/src/avatar/MyAvatar.h
+++ b/interface/src/avatar/MyAvatar.h
@@ -154,12 +154,12 @@ class MyAvatar : public Avatar {
* Note: This property will automatically be set to true
if the controller system has
* valid facial blend shape actions.
* @property {boolean} hasProceduralBlinkFaceMovement=true - true
if avatars blink automatically by animating
- * facial blend shapes, false
if automatic blinking is disabled. Set this property to false
- * to fully control the blink facial blend shapes via the {@link MyAvatar.setBlendshape} method.
+ * facial blend shapes, false
if automatic blinking is disabled. Set to false
to fully control
+ * the blink facial blend shapes via the {@link MyAvatar.setBlendshape} method.
* @property {boolean} hasProceduralEyeFaceMovement=true - true
if the facial blend shapes for an avatar's eyes
* adjust automatically as the eyes move, false
if this automatic movement is disabled. Set this property
- * to true
to prevent the iris from being obscured by the upper or lower lids. Set this property to
- * false
to fully control the eye blend shapes via the {@link MyAvatar.setBlendshape} method.
+ * to true
to prevent the iris from being obscured by the upper or lower lids. Set to false
to
+ * fully control the eye blend shapes via the {@link MyAvatar.setBlendshape} method.
* @property {boolean} hasAudioEnabledFaceMovement=true - true
if the avatar's mouth blend shapes animate
* automatically based on detected microphone input, false
if this automatic movement is disabled. Set
* this property to false
to fully control the mouth facial blend shapes via the
@@ -1793,15 +1793,15 @@ public:
/**jsdoc
* Turns the avatar's head until it faces the target point within a +90/-90 degree range.
- * Once this method is called, API calls will have full control of the head for a limited time.
- * If this method is not called for 2 seconds, the engine will regain control of the head.
+ * Once this method is called, API calls have full control of the head for a limited time.
+ * If this method is not called for 2 seconds, the engine regains control of the head.
* @function MyAvatar.setHeadLookAt
* @param {Vec3} lookAtTarget - The target point in world coordinates.
*/
Q_INVOKABLE void setHeadLookAt(const glm::vec3& lookAtTarget);
/**jsdoc
- * Returns the current target point of the head's look direction in world coordinates.
+ * Gets the current target point of the head's look direction in world coordinates.
* @function MyAvatar.getHeadLookAt
* @returns {Vec3} The head's look-at target in world coordinates.
*/
@@ -1815,7 +1815,7 @@ public:
/**jsdoc
* Forces the avatar's eyes to look at a specified location. Once this method is called, API calls
- * have full control of the eyes for a limited time. If this method is not called for two seconds,
+ * full control of the eyes for a limited time. If this method is not called for 2 seconds,
* the engine regains control of the eyes.
* @function MyAvatar.setEyesLookAt
* @param {Vec3} lookAtTarget - The target point in world coordinates.
@@ -1823,7 +1823,7 @@ public:
Q_INVOKABLE void setEyesLookAt(const glm::vec3& lookAtTarget);
/**jsdoc
- * Returns the current target point of the eyes look direction in world coordinates.
+ * Gets the current target point of the eyes look direction in world coordinates.
* @function MyAvatar.getEyesLookAt
* @returns {Vec3} The eyes' look-at target in world coordinates.
*/
diff --git a/interface/src/ui/InteractiveWindow.cpp b/interface/src/ui/InteractiveWindow.cpp
index 2acac2c529..0ac1f05737 100644
--- a/interface/src/ui/InteractiveWindow.cpp
+++ b/interface/src/ui/InteractiveWindow.cpp
@@ -145,7 +145,7 @@ void InteractiveWindow::emitMainWindowResizeEvent() {
* @property {InteractiveWindow.Flags} [additionalFlags=0] - Customizes window behavior.
* @property {InteractiveWindow.OverrideFlags} [overrideFlags=0] - Customizes window controls.
- * @property {InteractiveWindow.RelativePositionAnchor} [relativePositionAnchor] - he anchor for the
+ * @property {InteractiveWindow.RelativePositionAnchor} [relativePositionAnchor] - The anchor for the
* relativePosition
, if used.
* @property {Vec2} [relativePosition] - The position of the window, relative to the relativePositionAnchor
, in
* pixels. Excludes the window frame.
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
index a9e16e9ff1..3792057052 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
@@ -1925,7 +1925,7 @@ void Avatar::setParentJointIndex(quint16 parentJointIndex) {
* @typedef {object} SkeletonJoint
* @property {string} name - Joint name.
* @property {number} index - Joint index.
- * @property {number} parentIndex - Index of this joint's parent (-1 if no parent).
+ * @property {number} parentIndex - Index of this joint's parent (-1
if no parent).
*/
QList Avatar::getSkeleton() {
SkeletonModelPointer skeletonModel = _skeletonModel;
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
index dcd4d00db0..2c36a92b0f 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
@@ -442,7 +442,7 @@ public:
void setOrientationViaScript(const glm::quat& orientation) override;
/**jsdoc
- * Gets the ID of the entity of avatar that the avatar is parented to.
+ * Gets the ID of the entity or avatar that the avatar is parented to.
* @function MyAvatar.getParentID
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented.
*/
@@ -450,7 +450,7 @@ public:
Q_INVOKABLE virtual const QUuid getParentID() const override { return SpatiallyNestable::getParentID(); }
/**jsdoc
- * Sets the ID of the entity of avatar that the avatar is parented to.
+ * Sets the ID of the entity or avatar that the avatar is parented to.
* @function MyAvatar.setParentID
* @param {Uuid} parentID - The ID of the entity or avatar that the avatar should be parented to. Set to
* {@link Uuid(0)|Uuid.NULL} to unparent.
diff --git a/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h b/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h
index 3f8fc4f88b..abc15ae11b 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h
@@ -19,7 +19,7 @@
/**jsdoc
* Information about an avatar.
*
- * Created using {@link MyAvatar.getTargetAvatar} or {@link AvatarList.getAvatar}.
+ * Create using {@link MyAvatar.getTargetAvatar} or {@link AvatarList.getAvatar}.
*
* @class ScriptAvatar
* @hideconstructor
@@ -152,7 +152,7 @@ public slots:
/**jsdoc
- * Gets the ID of the entity of avatar that the avatar is parented to.
+ * Gets the ID of the entity or avatar that the avatar is parented to.
* @function ScriptAvatar.getParentID
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented
* or avatar data aren't available.
diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h
index 24808b98bf..40e3a056da 100755
--- a/libraries/avatars/src/AvatarData.h
+++ b/libraries/avatars/src/AvatarData.h
@@ -538,12 +538,12 @@ class AvatarData : public QObject, public SpatiallyNestable {
* Note: This property will automatically be set to true
if the controller system has
* valid facial blend shape actions.
* @property {boolean} hasProceduralBlinkFaceMovement=true - true
if avatars blink automatically by animating
- * facial blend shapes, false
if automatic blinking is disabled. Set this property to false
- * to fully control the blink facial blend shapes via the {@link Avatar.setBlendshape} method.
+ * facial blend shapes, false
if automatic blinking is disabled. Set to false
to fully control
+ * the blink facial blend shapes via the {@link Avatar.setBlendshape} method.
* @property {boolean} hasProceduralEyeFaceMovement=true - true
if the facial blend shapes for an avatar's eyes
* adjust automatically as the eyes move, false
if this automatic movement is disabled. Set this property
- * to true
to prevent the iris from being obscured by the upper or lower lids. Set this property to
- * false
to fully control the eye blend shapes via the {@link Avatar.setBlendshape} method.
+ * to true
to prevent the iris from being obscured by the upper or lower lids. Set to false
to
+ * fully control the eye blend shapes via the {@link Avatar.setBlendshape} method.
* @property {boolean} hasAudioEnabledFaceMovement=true - true
if the avatar's mouth blend shapes animate
* automatically based on detected microphone input, false
if this automatic movement is disabled. Set
* this property to false
to fully control the mouth facial blend shapes via the
@@ -1542,7 +1542,7 @@ signals:
void sessionDisplayNameChanged();
/**jsdoc
- * Triggered when the avatar's model (i.e., skeletonModelURL
property value) is changed.
+ * Triggered when the avatar's model (i.e., skeletonModelURL
property value) changes.
* @function Avatar.skeletonModelURLChanged
* @returns {Signal}
* @example Report when your avatar's skeleton model changes.
diff --git a/libraries/avatars/src/ScriptAvatarData.h b/libraries/avatars/src/ScriptAvatarData.h
index 7dcd7cc7e1..128bf9aef7 100644
--- a/libraries/avatars/src/ScriptAvatarData.h
+++ b/libraries/avatars/src/ScriptAvatarData.h
@@ -248,7 +248,7 @@ signals:
void sessionDisplayNameChanged();
/**jsdoc
- * Triggered when the avatar's model (i.e., skeletonModelURL
property value) is changed.
+ * Triggered when the avatar's model (i.e., skeletonModelURL
property value) changes.
* @function ScriptAvatar.skeletonModelURLChanged
* @returns {Signal}
*/
diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp
index 9d36cfd91a..a27eff9cbe 100644
--- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp
+++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp
@@ -434,7 +434,7 @@ namespace scriptable {
* @property {string} [glossMap] - The URL of the gloss texture image.
* Only use one of roughnessMap
and glossMap
.
* "hifi_pbr"
model only.
- * @property {string} [normalMa]p - The URL of the normal texture image.
+ * @property {string} [normalMap] - The URL of the normal texture image.
* If "fallthrough"
then it and bumpMap
fall through to the material below.
* Only use one of normalMap
and bumpMap
.
* "hifi_pbr"
model only.
diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h
index 8d70eda9e4..0e7eecc03b 100644
--- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h
+++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h
@@ -31,7 +31,7 @@ namespace scriptable {
/**jsdoc
* A handle to in-memory mesh data in a {@link GraphicsModel}.
*
- * Created using the {@link Graphics} API, {@link GraphicsModel.cloneModel}, or {@link GraphicsMesh.cloneMesh}.
+ * Create using the {@link Graphics} API, {@link GraphicsModel.cloneModel}, or {@link GraphicsMesh.cloneMesh}.
*
* @class GraphicsMesh
* @hideconstructor
@@ -133,7 +133,7 @@ namespace scriptable {
QVector findNearbyVertexIndices(const glm::vec3& origin, float epsilon = 1e-6) const;
/**jsdoc
- * Adds an attribute to the (whole) mesh's vertices.
+ * Adds an attribute for all vertices.
* @function GraphicsMesh.addAttribute
* @param {Graphics.BufferTypeName} name - The name of the attribute.
* @param {Graphics.BufferType} [defaultValue] - The value to give the attributes added to the vertices.
diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h
index 78ddb4f2b0..878b239f3d 100644
--- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h
+++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h
@@ -13,7 +13,7 @@ namespace scriptable {
/**jsdoc
* A handle to in-memory mesh part data in a {@link GraphicsModel}.
*
- * Created using the {@link Graphics} API, {@link GraphicsModel.cloneModel}, {@link GraphicsMesh.cloneMesh}, or
+ *
Create using the {@link Graphics} API, {@link GraphicsModel.cloneModel}, {@link GraphicsMesh.cloneMesh}, or
* {@link GraphicsMeshPart.cloneMeshPart}.
*
* @class GraphicsMeshPart
diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h b/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h
index 6dc2a06747..a6f135c321 100644
--- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h
+++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h
@@ -22,7 +22,7 @@ namespace scriptable {
* Note: The model may be used for more than one instance of an item displayed in the scene. Modifying the model updates
* all instances displayed.
*
- * Created using the {@link Graphics} API or {@link GraphicsModel.cloneModel}.
+ * Create using the {@link Graphics} API or {@link GraphicsModel.cloneModel}.
*
* @class GraphicsModel
* @hideconstructor
@@ -34,7 +34,7 @@ namespace scriptable {
* @property {Uuid} objectID - The ID of the entity or avatar that the model is associated with, if any; null
* if the model is not associated with an entity or avatar.
* Read-only.
- * @property {number} numMeshes - The number of meshes contained in the model.
+ * @property {number} numMeshes - The number of meshes in the model.
* Read-only.
* @property {GraphicsMesh[]} meshes - The meshes in the model. Each mesh may have more than one mesh part.
* Read-only.
diff --git a/libraries/graphics/src/graphics/BufferViewHelpers.cpp b/libraries/graphics/src/graphics/BufferViewHelpers.cpp
index 076cb92dcf..87d19ec6a2 100644
--- a/libraries/graphics/src/graphics/BufferViewHelpers.cpp
+++ b/libraries/graphics/src/graphics/BufferViewHelpers.cpp
@@ -76,7 +76,7 @@ const std::array ZERO123 = { { "0", "1", "2", "3" } };
* {@link Vec2} | "texcoord4" | Fifth UV coordinates buffer. |
*
*
- * @typedef {Vec3|vec2} Graphics.BufferType
+ * @typedef {Vec4|Vec3|Vec2} Graphics.BufferType
*/
QMap ATTRIBUTES{
{"position", gpu::Stream::POSITION },
diff --git a/libraries/shared/src/JointData.h b/libraries/shared/src/JointData.h
index 3f957fa046..329c2dd151 100644
--- a/libraries/shared/src/JointData.h
+++ b/libraries/shared/src/JointData.h
@@ -16,7 +16,7 @@ public:
// Used by the avatar mixer to describe a single joint
// Translations relative to their parent joint
// Rotations are absolute (i.e. not relative to parent) and are in rig space.
-// No JSDoc because its not provided as a type to the script engine.
+// No JSDoc because it's not provided as a type to the script engine.
class JointData {
public:
glm::quat rotation;
diff --git a/libraries/shared/src/RegisteredMetaTypes.cpp b/libraries/shared/src/RegisteredMetaTypes.cpp
index 7c30d4f205..7faaebbae9 100644
--- a/libraries/shared/src/RegisteredMetaTypes.cpp
+++ b/libraries/shared/src/RegisteredMetaTypes.cpp
@@ -1309,7 +1309,7 @@ void meshesFromScriptValue(const QScriptValue& value, MeshProxyList &out) {
/**jsdoc
* A triangle in a mesh.
* @typedef {object} MeshFace
- * @property {number[]} vertices - The indexes of the three vertices that make up the fase.
+ * @property {number[]} vertices - The indexes of the three vertices that make up the face.
*/
QScriptValue meshFaceToScriptValue(QScriptEngine* engine, const MeshFace &meshFace) {
QScriptValue obj = engine->newObject();
From eae3336f5735b38775088a6b97d887cfbb18d8f5 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Mon, 20 Jan 2020 15:06:32 +1300
Subject: [PATCH 003/105] Fix up docs links
---
.../hifi/avatarPackager/AvatarPackagerApp.qml | 2 +-
.../qml/hifi/avatarPackager/AvatarProject.qml | 2 +-
.../qml/hifi/avatarapp/MessageBoxes.qml | 2 +-
.../qml/hifi/commerce/checkout/Checkout.qml | 2 +-
.../qml/hifi/commerce/purchases/Purchases.qml | 2 +-
interface/src/Application.cpp | 2 +-
interface/src/avatar/AvatarDoctor.cpp | 2 +-
interface/src/avatar/MyAvatar.h | 14 +++++++-------
.../src/avatars-renderer/Avatar.h | 4 ++--
.../src/avatars-renderer/ScriptAvatar.h | 4 ++--
libraries/avatars/src/AvatarData.h | 18 +++++++++---------
libraries/avatars/src/ScriptAvatarData.h | 8 ++++----
libraries/image/src/image/TextureProcessing.h | 2 +-
libraries/midi/src/Midi.h | 2 +-
libraries/script-engine/src/ScriptEngine.h | 2 +-
libraries/script-engine/src/Vec3.h | 2 +-
16 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml b/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml
index 278ce36362..9158e25f75 100644
--- a/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml
+++ b/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml
@@ -229,7 +229,7 @@ Item {
}
function openDocs() {
- Qt.openUrlExternally("https://docs.highfidelity.com/create/avatars/package-avatar.html");
+ Qt.openUrlExternally("https://docs.projectathena.dev/create/avatars/package-avatar.html");
}
function openVideo() {
diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml b/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml
index e5bffa7829..5dd2dd0bd6 100644
--- a/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml
+++ b/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml
@@ -326,7 +326,7 @@ Item {
text: "This item is not for sale yet, learn more."
onLinkActivated: {
- Qt.openUrlExternally("https://docs.highfidelity.com/sell/add-item/upload-avatar.html");
+ Qt.openUrlExternally("https://docs.projectathena.dev/sell/add-item/upload-avatar.html");
}
}
diff --git a/interface/resources/qml/hifi/avatarapp/MessageBoxes.qml b/interface/resources/qml/hifi/avatarapp/MessageBoxes.qml
index 7d25438a1f..decb5e0807 100644
--- a/interface/resources/qml/hifi/avatarapp/MessageBoxes.qml
+++ b/interface/resources/qml/hifi/avatarapp/MessageBoxes.qml
@@ -7,7 +7,7 @@ MessageBox {
popup.onButton2Clicked = callback;
popup.titleText = 'Specify Avatar URL'
popup.bodyText = 'This will not overwrite your existing favorite if you are wearing one.
' +
- '' +
+ '' +
'Learn to make a custom avatar by opening this link on your desktop.' +
''
popup.inputText.visible = true;
diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml
index 41ac9232e2..315fc540dd 100644
--- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml
+++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml
@@ -778,7 +778,7 @@ Rectangle {
lightboxPopup.bodyText = "Rezzing this content set will replace the existing environment and all of the items in this domain. " +
"If you want to save the state of the content in this domain, create a backup before proceeding.
" +
"For more information about backing up and restoring content, " +
- "" +
+ "" +
"click here to open info on your desktop browser.";
lightboxPopup.button1text = "CANCEL";
lightboxPopup.button1method = function() {
diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
index 85e5211649..40365ef9e7 100644
--- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
+++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
@@ -602,7 +602,7 @@ Rectangle {
lightboxPopup.bodyText = "Rezzing this content set will replace the existing environment and all of the items in this domain. " +
"If you want to save the state of the content in this domain, create a backup before proceeding.
" +
"For more information about backing up and restoring content, " +
- "" +
+ "" +
"click here to open info on your desktop browser.";
lightboxPopup.button1text = "CANCEL";
lightboxPopup.button1method = function() {
diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp
index 36f1f4132a..776f78774c 100644
--- a/interface/src/Application.cpp
+++ b/interface/src/Application.cpp
@@ -7749,7 +7749,7 @@ bool Application::askToReplaceDomainContent(const QString& url) {
static const QString infoText = simpleWordWrap("Your domain's content will be replaced with a new content set. "
"If you want to save what you have now, create a backup before proceeding. For more information about backing up "
"and restoring content, visit the documentation page at: ", MAX_CHARACTERS_PER_LINE) +
- "\nhttps://docs.highfidelity.com/create-and-explore/start-working-in-your-sandbox/restoring-sandbox-content";
+ "\nhttps://docs.projectathena.dev/host/maintain-domain.html";
ModalDialogListener* dig = OffscreenUi::asyncQuestion("Are you sure you want to replace this domain's content set?",
infoText, QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
diff --git a/interface/src/avatar/AvatarDoctor.cpp b/interface/src/avatar/AvatarDoctor.cpp
index 4ff6fb7553..3c56170825 100644
--- a/interface/src/avatar/AvatarDoctor.cpp
+++ b/interface/src/avatar/AvatarDoctor.cpp
@@ -55,7 +55,7 @@ static QStringList HAND_MAPPING_SUFFIXES = {
"HandThumb1",
};
-const QUrl PACKAGE_AVATAR_DOCS_BASE_URL = QUrl("https://docs.highfidelity.com/create/avatars/package-avatar.html");
+const QUrl PACKAGE_AVATAR_DOCS_BASE_URL = QUrl("https://docs.projectathena.dev/create/avatars/package-avatar.html");
AvatarDoctor::AvatarDoctor(const QUrl& avatarFSTFileUrl) :
_avatarFSTFileUrl(avatarFSTFileUrl) {
diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h
index 0f46af458e..8ab532358b 100644
--- a/interface/src/avatar/MyAvatar.h
+++ b/interface/src/avatar/MyAvatar.h
@@ -654,7 +654,7 @@ public:
* Note: When using pre-built animation data, it's critical that the joint orientation of the source animation and target
* rig are equivalent, since the animation data applies absolute values onto the joints. If the orientations are different,
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
- * Avatar Standards.
+ * Avatar Standards.
* @function MyAvatar.overrideAnimation
* @param {string} url - The URL to the animation file. Animation files may be in glTF or FBX format, but only need to
* contain the avatar skeleton and animation data. glTF models may be in JSON or binary format (".gltf" or ".glb" URLs
@@ -762,7 +762,7 @@ public:
* Note: When using pre-built animation data, it's critical that the joint orientation of the source animation and target
* rig are equivalent, since the animation data applies absolute values onto the joints. If the orientations are different,
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
- * Avatar Standards.
+ * Avatar Standards.
* @function MyAvatar.overrideRoleAnimation
* @param {string} role - The animation role to override
* @param {string} url - The URL to the animation file. Animation files need to be in glTF or FBX format, but only need to
@@ -1920,7 +1920,7 @@ public:
/**jsdoc
* Enables and disables flow simulation of physics on the avatar's hair, clothes, and body parts. See
- * {@link https://docs.highfidelity.com/create/avatars/add-flow.html|Add Flow to Your Avatar} for more
+ * {@link https://docs.projectathena.dev/create/avatars/add-flow.html|Add Flow to Your Avatar} for more
* information.
* @function MyAvatar.useFlow
* @param {boolean} isActive - true
if flow simulation is enabled on the joint, false
if it isn't.
@@ -2284,7 +2284,7 @@ public slots:
/**jsdoc
* Gets the URL of the override animation graph.
- *
See {@link https://docs.highfidelity.com/create/avatars/custom-animations.html|Custom Avatar Animations} for
+ *
See {@link https://docs.projectathena.dev/create/avatars/custom-animations.html|Custom Avatar Animations} for
* information on animation graphs.
* @function MyAvatar.getAnimGraphOverrideUrl
* @returns {string} The URL of the override animation graph JSON file. ""
if there is no override animation
@@ -2294,7 +2294,7 @@ public slots:
/**jsdoc
* Sets the animation graph to use in preference to the default animation graph.
- * See {@link https://docs.highfidelity.com/create/avatars/custom-animations.html|Custom Avatar Animations} for
+ *
See {@link https://docs.projectathena.dev/create/avatars/custom-animations.html|Custom Avatar Animations} for
* information on animation graphs.
* @function MyAvatar.setAnimGraphOverrideUrl
* @param {string} url - The URL of the animation graph JSON file to use. Set to ""
to clear an override.
@@ -2303,7 +2303,7 @@ public slots:
/**jsdoc
* Gets the URL of animation graph (i.e., the avatar animation JSON) that's currently being used for avatar animations.
- * See {@link https://docs.highfidelity.com/create/avatars/custom-animations.html|Custom Avatar Animations} for
+ *
See {@link https://docs.projectathena.dev/create/avatars/custom-animations.html|Custom Avatar Animations} for
* information on animation graphs.
* @function MyAvatar.getAnimGraphUrl
* @returns {string} The URL of the current animation graph JSON file.
@@ -2314,7 +2314,7 @@ public slots:
/**jsdoc
* Sets the current animation graph (i.e., the avatar animation JSON) to use for avatar animations and makes it the default.
- * See {@link https://docs.highfidelity.com/create/avatars/custom-animations.html|Custom Avatar Animations} for
+ *
See {@link https://docs.projectathena.dev/create/avatars/custom-animations.html|Custom Avatar Animations} for
* information on animation graphs.
* @function MyAvatar.setAnimGraphUrl
* @param {string} url - The URL of the animation graph JSON file to use.
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
index 2c36a92b0f..cd1fc7c7fc 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
@@ -207,7 +207,7 @@ public:
/**jsdoc
* Gets the default rotation of a joint (in the current avatar) relative to its parent.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function MyAvatar.getDefaultJointRotation
* @param {number} index - The joint index.
* @returns {Quat} The default rotation of the joint if the joint index is valid, otherwise {@link Quat(0)|Quat.IDENTITY}.
@@ -218,7 +218,7 @@ public:
* Gets the default translation of a joint (in the current avatar) relative to its parent, in model coordinates.
* Warning: These coordinates are not necessarily in meters.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function MyAvatar.getDefaultJointTranslation
* @param {number} index - The joint index.
* @returns {Vec3} The default translation of the joint (in model coordinates) if the joint index is valid, otherwise
diff --git a/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h b/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h
index abc15ae11b..b5fdad078e 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/ScriptAvatar.h
@@ -87,7 +87,7 @@ public slots:
/**jsdoc
* Gets the default rotation of a joint in the avatar relative to its parent.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function ScriptAvatar.getDefaultJointRotation
* @param {number} index - The joint index.
* @returns {Quat} The default rotation of the joint if avatar data are available and the joint index is valid, otherwise
@@ -99,7 +99,7 @@ public slots:
* Gets the default translation of a joint in the avatar relative to its parent, in model coordinates.
* Warning: These coordinates are not necessarily in meters.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function ScriptAvatar.getDefaultJointTranslation
* @param {number} index - The joint index.
* @returns {Vec3} The default translation of the joint (in model coordinates) if avatar data are available and the joint
diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h
index 40e3a056da..fac23a5f96 100755
--- a/libraries/avatars/src/AvatarData.h
+++ b/libraries/avatars/src/AvatarData.h
@@ -796,7 +796,7 @@ public:
* @param {Quat} rotation - The rotation of the joint relative to its parent.
* @param {Vec3} translation - The translation of the joint relative to its parent, in model coordinates.
* @example Set your avatar to it's default T-pose for a while.
- *
+ *
* // Set all joint translations and rotations to defaults.
* var i, length, rotation, translation;
* for (i = 0, length = MyAvatar.getJointNames().length; i < length; i++) {
@@ -860,7 +860,7 @@ public:
/**jsdoc
* Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointRotation
* @param {number} index - The index of the joint.
* @returns {Quat} The rotation of the joint relative to its parent.
@@ -871,7 +871,7 @@ public:
* Gets the translation of a joint relative to its parent, in model coordinates.
* Warning: These coordinates are not necessarily in meters.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointTranslation
* @param {number} index - The index of the joint.
* @returns {Vec3} The translation of the joint relative to its parent, in model coordinates.
@@ -904,7 +904,7 @@ public:
* @param {string} name - The name of the joint.
* @param {Quat} rotation - The rotation of the joint relative to its parent.
* @example Set your avatar to its default T-pose then rotate its right arm.
- *
+ *
* // Set all joint translations and rotations to defaults.
* var i, length, rotation, translation;
* for (i = 0, length = MyAvatar.getJointNames().length; i < length; i++) {
@@ -939,7 +939,7 @@ public:
* @param {Vec3} translation - The translation of the joint relative to its parent, in model coordinates.
* @example Stretch your avatar's neck. Depending on the avatar you are using, you will either see a gap between
* the head and body or you will see the neck stretched.
- *
+ *
* // Stretch your avatar's neck.
* MyAvatar.setJointTranslation("Neck", Vec3.multiply(2, MyAvatar.getJointTranslation("Neck")));
*
@@ -981,7 +981,7 @@ public:
/**jsdoc
* Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointRotation
* @param {string} name - The name of the joint.
* @returns {Quat} The rotation of the joint relative to its parent.
@@ -996,7 +996,7 @@ public:
* Gets the translation of a joint relative to its parent, in model coordinates.
* Warning: These coordinates are not necessarily in meters.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointTranslation
* @param {number} name - The name of the joint.
* @returns {Vec3} The translation of the joint relative to its parent, in model coordinates.
@@ -1041,7 +1041,7 @@ public:
* @param {Quat[]} jointRotations - The rotations for all joints in the avatar. The values are in the same order as the
* array returned by {@link MyAvatar.getJointNames}, or {@link Avatar.getJointNames} if using the Avatar
API.
* @example Set your avatar to its default T-pose then rotate its right arm.
- *
+ *
* // Set all joint translations and rotations to defaults.
* var i, length, rotation, translation;
* for (i = 0, length = MyAvatar.getJointNames().length; i < length; i++) {
@@ -1138,7 +1138,7 @@ public:
* set hasScriptedBlendshapes
back to false
when the animation is complete.
* @function Avatar.setBlendshape
* @param {string} name - The name of the blendshape, per the
- * {@link https://docs.highfidelity.com/create/avatars/avatar-standards.html#blendshapes Avatar Standards}.
+ * {@link https://docs.projectathena.dev/create/avatars/avatar-standards.html#blendshapes Avatar Standards}.
* @param {number} value - A value between 0.0
and 1.0
.
* @example Open your avatar's mouth wide.
* MyAvatar.hasScriptedBlendshapes = true;
diff --git a/libraries/avatars/src/ScriptAvatarData.h b/libraries/avatars/src/ScriptAvatarData.h
index 128bf9aef7..bddbf5f887 100644
--- a/libraries/avatars/src/ScriptAvatarData.h
+++ b/libraries/avatars/src/ScriptAvatarData.h
@@ -117,7 +117,7 @@ public:
/**jsdoc
* Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function ScriptAvatar.getJointRotation
* @param {number} index - The index of the joint.
* @returns {Quat} The rotation of the joint relative to its parent, or {@link Quat(0)|Quat.IDENTITY} if the avatar data
@@ -129,7 +129,7 @@ public:
* Gets the translation of a joint relative to its parent, in model coordinates.
* Warning: These coordinates are not necessarily in meters.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function ScriptAvatar.getJointTranslation
* @param {number} index - The index of the joint.
* @returns {Vec3} The translation of the joint relative to its parent, in model coordinates, or {@link Vec3(0)|Vec3.ZERO}
@@ -139,7 +139,7 @@ public:
/**jsdoc
* Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function ScriptAvatar.getJointRotation
* @param {string} name - The name of the joint.
* @returns {Quat} The rotation of the joint relative to its parent, or {@link Quat(0)|Quat.IDENTITY} if the avatar data
@@ -151,7 +151,7 @@ public:
* Gets the translation of a joint relative to its parent, in model coordinates.
* Warning: These coordinates are not necessarily in meters.
* For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function ScriptAvatar.getJointTranslation
* @param {number} name - The name of the joint.
* @returns {Vec3} The translation of the joint relative to its parent, in model coordinates, or {@link Vec3(0)|Vec3.ZERO}
diff --git a/libraries/image/src/image/TextureProcessing.h b/libraries/image/src/image/TextureProcessing.h
index c1817a08a6..677d48c61f 100644
--- a/libraries/image/src/image/TextureProcessing.h
+++ b/libraries/image/src/image/TextureProcessing.h
@@ -33,7 +33,7 @@ namespace TextureUsage {
/**jsdoc
* Describes the type of texture.
* See also: {@link Material} and
- * {@link https://docs.highfidelity.com/create/3d-models/pbr-materials-guide.html|PBR Materials Guide}.
+ * {@link https://docs.projectathena.dev/create/3d-models/pbr-materials-guide.html|PBR Materials Guide}.
*
*
* Value | Name | Description |
diff --git a/libraries/midi/src/Midi.h b/libraries/midi/src/Midi.h
index 5b7c82d6da..986682d7f9 100644
--- a/libraries/midi/src/Midi.h
+++ b/libraries/midi/src/Midi.h
@@ -23,7 +23,7 @@
/**jsdoc
* The Midi
API provides the ability to connect Interface with musical instruments and other external or virtual
* devices via the MIDI protocol. For further information and examples, see the tutorial:
- * Use MIDI to Control Your Environment.
+ * Use MIDI to Control Your Environment.
*
* Note: Only works on Windows.
*
diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h
index 71af673e6c..4265390995 100644
--- a/libraries/script-engine/src/ScriptEngine.h
+++ b/libraries/script-engine/src/ScriptEngine.h
@@ -417,7 +417,7 @@ public:
/**jsdoc
* Provides access to methods or objects provided in an external JavaScript or JSON file.
- * See {@link https://docs.highfidelity.com/script/js-tips.html} for further details.
+ * See {@link https://docs.projectathena.dev/script/js-tips.html} for further details.
* @function Script.require
* @param {string} module - The module to use. May be a JavaScript file, a JSON file, or the name of a system module such
* as "appUi"
(i.e., the "appUi.js" system module JavaScript file).
diff --git a/libraries/script-engine/src/Vec3.h b/libraries/script-engine/src/Vec3.h
index 86df912d0e..a8fe51efe8 100644
--- a/libraries/script-engine/src/Vec3.h
+++ b/libraries/script-engine/src/Vec3.h
@@ -24,7 +24,7 @@
/**jsdoc
* The Vec3
API provides facilities for generating and manipulating 3-dimensional vectors. High Fidelity uses a
* right-handed Cartesian coordinate system where the y-axis is the "up" and the negative z-axis is the "front" direction.
- *
+ *
*
* @namespace Vec3
* @variation 0
From b816d7053a89c7485cb88a7230fa942ed025dd4e Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Mon, 20 Jan 2020 21:07:33 +1300
Subject: [PATCH 004/105] Update models used in JSDoc examples
---
interface/src/avatar/MyAvatar.h | 10 +++++-----
libraries/avatars/src/AvatarData.h | 4 ++--
libraries/entities/src/EntityItemProperties.cpp | 4 ++--
.../graphics-scripting/GraphicsScriptingInterface.h | 4 ++--
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h
index 8ab532358b..6856e8b58c 100644
--- a/interface/src/avatar/MyAvatar.h
+++ b/interface/src/avatar/MyAvatar.h
@@ -665,7 +665,7 @@ public:
* @param {number} firstFrame - The frame to start the animation at.
* @param {number} lastFrame - The frame to end the animation at.
* @example Play a clapping animation on your avatar for three seconds.
- * var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
+ * var ANIM_URL = "https://apidocs.projectathena.dev/models/ClapHands_Standing.fbx";
* MyAvatar.overrideAnimation(ANIM_URL, 30, true, 0, 53);
* Script.setTimeout(function () {
* MyAvatar.restoreAnimation();
@@ -688,7 +688,7 @@ public:
* @param {number} firstFrame - The frame to start the animation at.
* @param {number} lastFrame - The frame to end the animation at.
* @example Override left hand animation for three seconds.
- * var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
+ * var ANIM_URL = "https://apidocs.projectathena.dev/models/ClapHands_Standing.fbx";
* MyAvatar.overrideHandAnimation(isLeft, ANIM_URL, 30, true, 0, 53);
* Script.setTimeout(function () {
* MyAvatar.restoreHandAnimation();
@@ -705,7 +705,7 @@ public:
* animation, this function has no effect.
* @function MyAvatar.restoreAnimation
* @example Play a clapping animation on your avatar for three seconds.
- * var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
+ * var ANIM_URL = "https://apidocs.projectathena.dev/models/ClapHands_Standing.fbx";
* MyAvatar.overrideAnimation(ANIM_URL, 30, true, 0, 53);
* Script.setTimeout(function () {
* MyAvatar.restoreAnimation();
@@ -722,7 +722,7 @@ public:
* @function MyAvatar.restoreHandAnimation
* @param isLeft {boolean} Set to true if using the left hand
* @example Override left hand animation for three seconds.
- * var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
+ * var ANIM_URL = "https://apidocs.projectathena.dev/models/ClapHands_Standing.fbx";
* MyAvatar.overrideHandAnimation(isLeft, ANIM_URL, 30, true, 0, 53);
* Script.setTimeout(function () {
* MyAvatar.restoreHandAnimation();
@@ -780,7 +780,7 @@ public:
* hanging at its sides when it is not moving, the avatar will stand and clap its hands. Note that just as it did before, as soon as the avatar
* starts to move, the animation will smoothly blend into the walk animation used by the "walkFwd" animation role.
* // An animation of the avatar clapping its hands while standing. Restore default after 30s.
- * var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
+ * var ANIM_URL = "https://apidocs.projectathena.dev/models/ClapHands_Standing.fbx";
* MyAvatar.overrideRoleAnimation("idleStand", ANIM_URL, 30, true, 0, 53);
* Script.setTimeout(function () {
* MyAvatar.restoreRoleAnimation();
diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h
index fac23a5f96..2f595fab08 100755
--- a/libraries/avatars/src/AvatarData.h
+++ b/libraries/avatars/src/AvatarData.h
@@ -1274,7 +1274,7 @@ public:
* null
to remove all attachments.
* @deprecated This function is deprecated and will be removed. Use avatar entities instead.
* @example Remove a hat attachment if your avatar is wearing it.
- * var hatURL = "https://s3.amazonaws.com/hifi-public/tony/cowboy-hat.fbx";
+ * var hatURL = "https://apidocs.projectathena.dev/models/cowboy-hat.fbx";
* var attachments = MyAvatar.getAttachmentData();
*
* for (var i = 0; i < attachments.length; i++) {
@@ -1311,7 +1311,7 @@ public:
* @deprecated This function is deprecated and will be removed. Use avatar entities instead.
* @example Attach a cowboy hat to your avatar's head.
* var attachment = {
- * modelURL: "https://s3.amazonaws.com/hifi-public/tony/cowboy-hat.fbx",
+ * modelURL: "https://apidocs.projectathena.dev/models/cowboy-hat.fbx",
* jointName: "Head",
* translation: {"x": 0, "y": 0.25, "z": 0},
* rotation: {"x": 0, "y": 0, "z": 0, "w": 1},
diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp
index 1d476af22f..ebdbbc4397 100644
--- a/libraries/entities/src/EntityItemProperties.cpp
+++ b/libraries/entities/src/EntityItemProperties.cpp
@@ -1036,8 +1036,8 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* type: "Model",
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -2 })),
* rotation: MyAvatar.orientation,
- * modelURL: "http://content.highfidelity.com/seefo/production/puck-attach/vive_tracker_puck.obj",
- * dimensions: { x: 0.0945, y: 0.0921, z: 0.0423 },
+ * modelURL: "https://apidocs.projectathena.dev/models/cowboy-hat.fbx",
+ * dimensions: { x: 0.8569, y: 0.3960, z: 1.0744 },
* lifetime: 300 // Delete after 5 minutes.
* });
*/
diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h
index 9b56433bf6..ed3e207eaf 100644
--- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h
+++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h
@@ -87,8 +87,8 @@ public slots:
* type: "Model",
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(Camera.orientation, { x: -0.5, y: 0, z: -3 })),
* rotation: MyAvatar.orientation,
- * modelURL: "http://content.highfidelity.com/seefo/production/puck-attach/vive_tracker_puck.obj",
- * dimensions: { x: 0.945, y: 0.921, z: 0.423 },
+ * modelURL: "https://apidocs.projectathena.dev/models/cowboy-hat.fbx",
+ * dimensions: { x: 0.8569, y: 0.3960, z: 1.0744 },
* lifetime: 300 // Delete after 5 minutes.
* });
* var shapeEntityID = Entities.addEntity({
From 0666c3bbb109ba03b36e518f66161863706e0fb1 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Mon, 20 Jan 2020 21:31:50 +1300
Subject: [PATCH 005/105] Document that MyAvatar goto methods have safe landing
---
interface/src/avatar/MyAvatar.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h
index 6856e8b58c..0d018eb007 100644
--- a/interface/src/avatar/MyAvatar.h
+++ b/interface/src/avatar/MyAvatar.h
@@ -2051,7 +2051,8 @@ public slots:
float getGravity();
/**jsdoc
- * Moves the avatar to a new position and/or orientation in the domain, while taking into account Avatar leg-length.
+ * Moves the avatar to a new position and/or orientation in the domain, with safe landing, while taking into account avatar
+ * leg length.
* @function MyAvatar.goToFeetLocation
* @param {Vec3} position - The new position for the avatar, in world coordinates.
* @param {boolean} [hasOrientation=false] - Set to true
to set the orientation of the avatar.
@@ -2076,14 +2077,14 @@ public slots:
bool hasOrientation = false, const glm::quat& newOrientation = glm::quat(),
bool shouldFaceLocation = false, bool withSafeLanding = true);
/**jsdoc
- * Moves the avatar to a new position and (optional) orientation in the domain.
+ * Moves the avatar to a new position and (optional) orientation in the domain, with safe landing.
* @function MyAvatar.goToLocation
* @param {MyAvatar.GoToProperties} target - The goto target.
*/
void goToLocation(const QVariant& properties);
/**jsdoc
- * Moves the avatar to a new position and then enables collisions.
+ * Moves the avatar to a new position, with safe landing, and enables collisions.
* @function MyAvatar.goToLocationAndEnableCollisions
* @param {Vec3} position - The new position for the avatar, in world coordinates.
*/
From 3c4e073874679c911189eb381687454f46deac01 Mon Sep 17 00:00:00 2001
From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com>
Date: Fri, 28 Feb 2020 23:52:24 -0500
Subject: [PATCH 006/105] Properties Editor using tabs
Properties Editor using tabs instead of collapsible sections to avoid painful scrolling.
---
.../html/entityProperties.html | 21 +-
.../html/js/entityProperties.js | 261 +++++++++++-------
.../entityProperties/html/tabs/base.png | Bin 0 -> 671 bytes
.../entityProperties/html/tabs/behavior.png | Bin 0 -> 754 bytes
.../entityProperties/html/tabs/collision.png | Bin 0 -> 693 bytes
.../entityProperties/html/tabs/grid.png | Bin 0 -> 711 bytes
.../entityProperties/html/tabs/image.png | Bin 0 -> 707 bytes
.../entityProperties/html/tabs/light.png | Bin 0 -> 811 bytes
.../entityProperties/html/tabs/material.png | Bin 0 -> 445 bytes
.../entityProperties/html/tabs/model.png | Bin 0 -> 902 bytes
.../entityProperties/html/tabs/particles.png | Bin 0 -> 770 bytes
.../html/tabs/particles_acceleration.png | Bin 0 -> 914 bytes
.../html/tabs/particles_alpha.png | Bin 0 -> 891 bytes
.../html/tabs/particles_color.png | Bin 0 -> 1753 bytes
.../html/tabs/particles_constraints.png | Bin 0 -> 1049 bytes
.../html/tabs/particles_emit.png | Bin 0 -> 915 bytes
.../html/tabs/particles_size.png | Bin 0 -> 757 bytes
.../html/tabs/particles_spin.png | Bin 0 -> 772 bytes
.../entityProperties/html/tabs/physics.png | Bin 0 -> 719 bytes
.../entityProperties/html/tabs/shape.png | Bin 0 -> 815 bytes
.../entityProperties/html/tabs/spatial.png | Bin 0 -> 692 bytes
.../entityProperties/html/tabs/tabs.css | 53 ++++
.../entityProperties/html/tabs/text.png | Bin 0 -> 567 bytes
.../create/entityProperties/html/tabs/web.png | Bin 0 -> 835 bytes
.../entityProperties/html/tabs/zone.png | Bin 0 -> 552 bytes
.../html/tabs/zone_ambient_light.png | Bin 0 -> 1549 bytes
.../html/tabs/zone_avatar_priority.png | Bin 0 -> 784 bytes
.../entityProperties/html/tabs/zone_bloom.png | Bin 0 -> 767 bytes
.../entityProperties/html/tabs/zone_haze.png | Bin 0 -> 594 bytes
.../html/tabs/zone_key_light.png | Bin 0 -> 947 bytes
.../html/tabs/zone_skybox.png | Bin 0 -> 921 bytes
31 files changed, 241 insertions(+), 94 deletions(-)
create mode 100644 scripts/system/create/entityProperties/html/tabs/base.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/behavior.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/collision.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/grid.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/image.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/light.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/material.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/model.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_acceleration.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_alpha.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_color.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_constraints.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_emit.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_size.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/particles_spin.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/physics.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/shape.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/spatial.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/tabs.css
create mode 100644 scripts/system/create/entityProperties/html/tabs/text.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/web.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone_ambient_light.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone_avatar_priority.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone_bloom.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone_haze.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone_key_light.png
create mode 100644 scripts/system/create/entityProperties/html/tabs/zone_skybox.png
diff --git a/scripts/system/create/entityProperties/html/entityProperties.html b/scripts/system/create/entityProperties/html/entityProperties.html
index 876e75ec35..241ddd1e75 100644
--- a/scripts/system/create/entityProperties/html/entityProperties.html
+++ b/scripts/system/create/entityProperties/html/entityProperties.html
@@ -1,4 +1,11 @@
+