@@ -1811,6 +1811,46 @@ void MyAvatar::prepareAvatarEntityDataForReload() {
1811
1811
}
1812
1812
1813
1813
AvatarEntityMap MyAvatar::getAvatarEntityData () const {
1814
+ // NOTE: the return value is expected to be a map of unfortunately-formatted-binary-blobs
1815
+ AvatarEntityMap data;
1816
+
1817
+ auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
1818
+ EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree () : nullptr ;
1819
+ if (!entityTree) {
1820
+ return data;
1821
+ }
1822
+
1823
+ QList<QUuid> avatarEntityIDs;
1824
+ _avatarEntitiesLock.withReadLock ([&] {
1825
+ avatarEntityIDs = _packedAvatarEntityData.keys ();
1826
+ });
1827
+ for (const auto & entityID : avatarEntityIDs) {
1828
+ auto entity = entityTree->findEntityByID (entityID);
1829
+ if (!entity) {
1830
+ continue ;
1831
+ }
1832
+
1833
+ EncodeBitstreamParams params;
1834
+ auto desiredProperties = entity->getEntityProperties (params);
1835
+ desiredProperties += PROP_LOCAL_POSITION;
1836
+ desiredProperties += PROP_LOCAL_ROTATION;
1837
+ desiredProperties += PROP_LOCAL_VELOCITY;
1838
+ desiredProperties += PROP_LOCAL_ANGULAR_VELOCITY;
1839
+ desiredProperties += PROP_LOCAL_DIMENSIONS;
1840
+ EntityItemProperties properties = entity->getProperties (desiredProperties);
1841
+
1842
+ QByteArray blob;
1843
+ {
1844
+ std::lock_guard<std::mutex> guard (_scriptEngineLock);
1845
+ EntityItemProperties::propertiesToBlob (*_scriptEngine, getID (), properties, blob, true );
1846
+ }
1847
+
1848
+ data[entityID] = blob;
1849
+ }
1850
+ return data;
1851
+ }
1852
+
1853
+ AvatarEntityMap MyAvatar::getAvatarEntityDataNonDefault () const {
1814
1854
// NOTE: the return value is expected to be a map of unfortunately-formatted-binary-blobs
1815
1855
updateStaleAvatarEntityBlobs ();
1816
1856
AvatarEntityMap result;
@@ -2522,6 +2562,9 @@ QVariantList MyAvatar::getAvatarEntitiesVariant() {
2522
2562
auto desiredProperties = entity->getEntityProperties (params);
2523
2563
desiredProperties += PROP_LOCAL_POSITION;
2524
2564
desiredProperties += PROP_LOCAL_ROTATION;
2565
+ desiredProperties += PROP_LOCAL_VELOCITY;
2566
+ desiredProperties += PROP_LOCAL_ANGULAR_VELOCITY;
2567
+ desiredProperties += PROP_LOCAL_DIMENSIONS;
2525
2568
QVariantMap avatarEntityData;
2526
2569
avatarEntityData[" id" ] = entityID;
2527
2570
EntityItemProperties entityProperties = entity->getProperties (desiredProperties);
0 commit comments