History

Tablet should work even when not connected to any domain.

handControllerGrab.js and WebTablet.js now parents objects to the AVATAR_SELF_ID parentID, instead of using MyAvatar.sessionUUID, which is unavailable when not connected to any domain. I removed several early returns handControllerGrab.js that prevented grabbing from working if MyAvatar.sessionUUID was invalid. There were places in the EntityItem.cpp and EntityScriptingInterface.cpp C++ that would log an error if parentID was set to AVATAR_SELF_ID. This was to prevent AVATAR_SELF_ID from ever going over the network. Instead, we now prevent this by replacing all outgoing references of AVATAR_SELF_ID with the sessionID of the current node.

Anthony J. Thibault committed 9 years ago

Commit e2e19881 parent 5a0990f4 files · +25 −21Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+0−8
@@ -190,11 +190,6 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 189 unmodified lines
190190 propertiesWithSimID.setOwningAvatarID(myNodeID);
191191 }
192192
193− if (propertiesWithSimID.getParentID() == AVATAR_SELF_ID) {
194− qCDebug(entities) << "ERROR: Cannot set entity parent ID to the local-only MyAvatar ID";
195− propertiesWithSimID.setParentID(QUuid());
196− }
197−
198193 auto dimensions = propertiesWithSimID.getDimensions();
199194 float volume = dimensions.x * dimensions.y * dimensions.z;
200195 auto density = propertiesWithSimID.getDensity();
@@ -371,9 +366,6 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 170 unmodified lines
371366
372367 if (!scriptSideProperties.parentIDChanged()) {
373368 properties.setParentID(entity->getParentID());
374− } else if (scriptSideProperties.getParentID() == AVATAR_SELF_ID) {
375− qCDebug(entities) << "ERROR: Cannot set entity parent ID to the local-only MyAvatar ID";
376− properties.setParentID(QUuid());
377369 }
378370 if (!scriptSideProperties.parentJointIndexChanged()) {
379371 properties.setParentJointIndex(entity->getParentJointIndex());

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t