Converted overlay getProperty calls to Entities.getEntityProperties
This commit is contained in:
parent
6c1fd88fb1
commit
589ca2a399
@ -1117,6 +1117,7 @@ void ScriptManager::timerFired() {
|
|||||||
return; // bail early
|
return; // bail early
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SCRIPT_TIMER_PERFORMANCE_STATISTICS
|
||||||
_timerCallCounter++;
|
_timerCallCounter++;
|
||||||
if (_timerCallCounter % 100 == 0) {
|
if (_timerCallCounter % 100 == 0) {
|
||||||
qCDebug(scriptengine) << "Script engine: " << _engine->manager()->getFilename()
|
qCDebug(scriptengine) << "Script engine: " << _engine->manager()->getFilename()
|
||||||
@ -1124,6 +1125,7 @@ void ScriptManager::timerFired() {
|
|||||||
}
|
}
|
||||||
QElapsedTimer callTimer;
|
QElapsedTimer callTimer;
|
||||||
callTimer.start();
|
callTimer.start();
|
||||||
|
#endif
|
||||||
|
|
||||||
QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());
|
QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());
|
||||||
CallbackData timerData = _timerFunctionMap.value(callingTimer);
|
CallbackData timerData = _timerFunctionMap.value(callingTimer);
|
||||||
@ -1146,7 +1148,9 @@ void ScriptManager::timerFired() {
|
|||||||
qCWarning(scriptengine) << "timerFired -- invalid function" << timerData.function.toVariant().toString();
|
qCWarning(scriptengine) << "timerFired -- invalid function" << timerData.function.toVariant().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SCRIPT_TIMER_PERFORMANCE_STATISTICS
|
||||||
_totalTimeInTimerEvents_s += callTimer.elapsed() / 1000.0;
|
_totalTimeInTimerEvents_s += callTimer.elapsed() / 1000.0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimer* ScriptManager::setupTimerWithInterval(const ScriptValue& function, int intervalMS, bool isSingleShot) {
|
QTimer* ScriptManager::setupTimerWithInterval(const ScriptValue& function, int intervalMS, bool isSingleShot) {
|
||||||
|
@ -552,7 +552,7 @@ void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> v
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScriptObjectV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
|
void ScriptObjectV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
|
||||||
qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
|
//qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
|
||||||
v8::HandleScope handleScope(info.GetIsolate());
|
v8::HandleScope handleScope(info.GetIsolate());
|
||||||
auto context = info.GetIsolate()->GetCurrentContext();
|
auto context = info.GetIsolate()->GetCurrentContext();
|
||||||
v8::Context::Scope contextScope(context);
|
v8::Context::Scope contextScope(context);
|
||||||
@ -897,7 +897,7 @@ void ScriptVariantV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value>
|
|||||||
|
|
||||||
void ScriptVariantV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
|
void ScriptVariantV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
|
||||||
//V8TODO: Only methods from the prototype should be listed.
|
//V8TODO: Only methods from the prototype should be listed.
|
||||||
qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
|
//qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
|
||||||
v8::HandleScope handleScope(info.GetIsolate());
|
v8::HandleScope handleScope(info.GetIsolate());
|
||||||
auto context = info.GetIsolate()->GetCurrentContext();
|
auto context = info.GetIsolate()->GetCurrentContext();
|
||||||
v8::Context::Scope contextScope(context);
|
v8::Context::Scope contextScope(context);
|
||||||
@ -1387,6 +1387,7 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SCRIPT_EVENT_PERFORMANCE_STATISTICS
|
||||||
_callCounter++;
|
_callCounter++;
|
||||||
if (_callCounter % 1000 == 0) {
|
if (_callCounter % 1000 == 0) {
|
||||||
qCDebug(scriptengine_v8) << "Script engine: " << _engine->manager()->getFilename() << " Signal proxy " << fullName()
|
qCDebug(scriptengine_v8) << "Script engine: " << _engine->manager()->getFilename() << " Signal proxy " << fullName()
|
||||||
@ -1394,6 +1395,7 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu
|
|||||||
}
|
}
|
||||||
QElapsedTimer callTimer;
|
QElapsedTimer callTimer;
|
||||||
callTimer.start();
|
callTimer.start();
|
||||||
|
#endif
|
||||||
|
|
||||||
auto isolate = _engine->getIsolate();
|
auto isolate = _engine->getIsolate();
|
||||||
v8::Locker locker(isolate);
|
v8::Locker locker(isolate);
|
||||||
@ -1488,8 +1490,9 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu
|
|||||||
}
|
}
|
||||||
//});
|
//});
|
||||||
|
|
||||||
|
#ifdef SCRIPT_EVENT_PERFORMANCE_STATISTICS
|
||||||
_totalCallTime_s += callTimer.elapsed() / 1000.0f;
|
_totalCallTime_s += callTimer.elapsed() / 1000.0f;
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
properties.forEach(function(prop) {
|
properties.forEach(function(prop) {
|
||||||
Object.defineProperty(that.prototype, prop, {
|
Object.defineProperty(that.prototype, prop, {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
//V8TODO:
|
||||||
return Overlays.getProperty(this._id, prop);
|
return Overlays.getProperty(this._id, prop);
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
|
@ -47,7 +47,7 @@ Script.include("/~/system/libraries/utils.js");
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.isGrabbedThingVisible = function() {
|
this.isGrabbedThingVisible = function() {
|
||||||
return Overlays.getProperty(this.grabbedThingID, "visible");
|
return Entities.getEntityProperties(this.grabbedThingID, ["visible"]).visible;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.thisHandIsParent = function(props) {
|
this.thisHandIsParent = function(props) {
|
||||||
@ -78,10 +78,10 @@ Script.include("/~/system/libraries/utils.js");
|
|||||||
|
|
||||||
this.getGrabbedProperties = function() {
|
this.getGrabbedProperties = function() {
|
||||||
return {
|
return {
|
||||||
position: Overlays.getProperty(this.grabbedThingID, "position"),
|
position: Entities.getEntityProperties(this.grabbedThingID, ["position"]).position,
|
||||||
rotation: Overlays.getProperty(this.grabbedThingID, "rotation"),
|
rotation: Entities.getEntityProperties(this.grabbedThingID, ["rotation"]).rotation,
|
||||||
parentID: Overlays.getProperty(this.grabbedThingID, "parentID"),
|
parentID: Entities.getEntityProperties(this.grabbedThingID, ["parentID"]).parentID,
|
||||||
parentJointIndex: Overlays.getProperty(this.grabbedThingID, "parentJointIndex"),
|
parentJointIndex: Entities.getEntityProperties(this.grabbedThingID, ["parentJointIndex"]).parentJointIndex,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
shapeType: "none"
|
shapeType: "none"
|
||||||
};
|
};
|
||||||
@ -164,7 +164,7 @@ Script.include("/~/system/libraries/utils.js");
|
|||||||
this.getTargetID = function(overlays, controllerData) {
|
this.getTargetID = function(overlays, controllerData) {
|
||||||
var sensorScaleFactor = MyAvatar.sensorToWorldScale;
|
var sensorScaleFactor = MyAvatar.sensorToWorldScale;
|
||||||
for (var i = 0; i < overlays.length; i++) {
|
for (var i = 0; i < overlays.length; i++) {
|
||||||
var overlayPosition = Overlays.getProperty(overlays[i], "position");
|
var overlayPosition = Entities.getEntityProperties(overlays[i], ["position"]).position;
|
||||||
var handPosition = controllerData.controllerLocations[this.hand].position;
|
var handPosition = controllerData.controllerLocations[this.hand].position;
|
||||||
var distance = Vec3.distance(overlayPosition, handPosition);
|
var distance = Vec3.distance(overlayPosition, handPosition);
|
||||||
if (distance <= NEAR_GRAB_RADIUS * sensorScaleFactor) {
|
if (distance <= NEAR_GRAB_RADIUS * sensorScaleFactor) {
|
||||||
@ -202,7 +202,8 @@ Script.include("/~/system/libraries/utils.js");
|
|||||||
|
|
||||||
var candidateOverlays = controllerData.nearbyOverlayIDs[this.hand];
|
var candidateOverlays = controllerData.nearbyOverlayIDs[this.hand];
|
||||||
var grabbableOverlays = candidateOverlays.filter(function(overlayID) {
|
var grabbableOverlays = candidateOverlays.filter(function(overlayID) {
|
||||||
return Overlays.getProperty(overlayID, "grabbable");
|
// V8TODO: check if this works
|
||||||
|
return Entities.getEntityProperties(overlayID, ["grab"]).grab.grabbable;
|
||||||
});
|
});
|
||||||
|
|
||||||
var targetID = this.getTargetID(grabbableOverlays, controllerData);
|
var targetID = this.getTargetID(grabbableOverlays, controllerData);
|
||||||
|
@ -31,7 +31,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getOverlayDistance(controllerPosition, overlayID) {
|
function getOverlayDistance(controllerPosition, overlayID) {
|
||||||
var position = Overlays.getProperty(overlayID, "position");
|
var position = Entities.getEntityProperties(overlayID, ["position"]).position;
|
||||||
return {
|
return {
|
||||||
id: overlayID,
|
id: overlayID,
|
||||||
distance: Vec3.distance(position, controllerPosition)
|
distance: Vec3.distance(position, controllerPosition)
|
||||||
@ -98,7 +98,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
|
|
||||||
for (i = 0; i < candidateOverlays.length; i++) {
|
for (i = 0; i < candidateOverlays.length; i++) {
|
||||||
if (!(HMD.tabletID && candidateOverlays[i] === HMD.tabletID) &&
|
if (!(HMD.tabletID && candidateOverlays[i] === HMD.tabletID) &&
|
||||||
Overlays.getProperty(candidateOverlays[i], "visible")) {
|
Entities.getEntityProperties(candidateOverlays[i], ["visible"]).visible) {
|
||||||
stylusTarget = getOverlayDistance(controllerPosition, candidateOverlays[i]);
|
stylusTarget = getOverlayDistance(controllerPosition, candidateOverlays[i]);
|
||||||
if (stylusTarget) {
|
if (stylusTarget) {
|
||||||
stylusTargets.push(stylusTarget);
|
stylusTargets.push(stylusTarget);
|
||||||
@ -108,7 +108,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
|
|
||||||
// add the tabletScreen, if it is valid
|
// add the tabletScreen, if it is valid
|
||||||
if (HMD.tabletScreenID && HMD.tabletScreenID !== Uuid.NULL &&
|
if (HMD.tabletScreenID && HMD.tabletScreenID !== Uuid.NULL &&
|
||||||
Overlays.getProperty(HMD.tabletScreenID, "visible")) {
|
Entities.getEntityProperties(HMD.tabletScreenID, ["visible"]).visible) {
|
||||||
stylusTarget = getOverlayDistance(controllerPosition, HMD.tabletScreenID);
|
stylusTarget = getOverlayDistance(controllerPosition, HMD.tabletScreenID);
|
||||||
if (stylusTarget) {
|
if (stylusTarget) {
|
||||||
stylusTargets.push(stylusTarget);
|
stylusTargets.push(stylusTarget);
|
||||||
@ -117,7 +117,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
|
|
||||||
// add the tablet home button.
|
// add the tablet home button.
|
||||||
if (HMD.homeButtonID && HMD.homeButtonID !== Uuid.NULL &&
|
if (HMD.homeButtonID && HMD.homeButtonID !== Uuid.NULL &&
|
||||||
Overlays.getProperty(HMD.homeButtonID, "visible")) {
|
Entities.getEntityProperties(HMD.homeButtonID, ["visible"]).visible) {
|
||||||
stylusTarget = getOverlayDistance(controllerPosition, HMD.homeButtonID);
|
stylusTarget = getOverlayDistance(controllerPosition, HMD.homeButtonID);
|
||||||
if (stylusTarget) {
|
if (stylusTarget) {
|
||||||
stylusTargets.push(stylusTarget);
|
stylusTargets.push(stylusTarget);
|
||||||
@ -125,7 +125,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the mini tablet.
|
// Add the mini tablet.
|
||||||
if (HMD.miniTabletScreenID && Overlays.getProperty(HMD.miniTabletScreenID, "visible") &&
|
if (HMD.miniTabletScreenID && Entities.getEntityProperties(HMD.miniTabletScreenID, ["visible"]).visible &&
|
||||||
this.hand != HMD.miniTabletHand) {
|
this.hand != HMD.miniTabletHand) {
|
||||||
stylusTarget = getOverlayDistance(controllerPosition, HMD.miniTabletScreenID);
|
stylusTarget = getOverlayDistance(controllerPosition, HMD.miniTabletScreenID);
|
||||||
if (stylusTarget) {
|
if (stylusTarget) {
|
||||||
|
@ -215,7 +215,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
var avatarSensorPosition = Mat4.transformPoint(worldToSensorMatrix, MyAvatar.position);
|
var avatarSensorPosition = Mat4.transformPoint(worldToSensorMatrix, MyAvatar.position);
|
||||||
avatarSensorPosition.y = 0;
|
avatarSensorPosition.y = 0;
|
||||||
|
|
||||||
var targetRotation = Overlays.getProperty(_this.targetOverlayID, "rotation");
|
var targetRotation = Entities.getEntityProperties(_this.targetOverlayID, ["rotation"]).rotation;
|
||||||
var relativePlayAreaCenterOffset =
|
var relativePlayAreaCenterOffset =
|
||||||
Vec3.sum(_this.playAreaCenterOffset, { x: 0, y: -TARGET_MODEL_DIMENSIONS.y / 2, z: 0 });
|
Vec3.sum(_this.playAreaCenterOffset, { x: 0, y: -TARGET_MODEL_DIMENSIONS.y / 2, z: 0 });
|
||||||
var localPosition = Vec3.multiplyQbyV(Quat.inverse(targetRotation),
|
var localPosition = Vec3.multiplyQbyV(Quat.inverse(targetRotation),
|
||||||
@ -507,7 +507,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Set play area position and rotation in local coordinates with parenting.
|
// Set play area position and rotation in local coordinates with parenting.
|
||||||
var targetRotation = Overlays.getProperty(_this.targetOverlayID, "rotation");
|
var targetRotation = Entities.getEntityProperties(_this.targetOverlayID, ["rotation"]).rotation;
|
||||||
var sensorToTargetRotation = Quat.multiply(Quat.inverse(targetRotation), sensorToWorldRotation);
|
var sensorToTargetRotation = Quat.multiply(Quat.inverse(targetRotation), sensorToWorldRotation);
|
||||||
var relativePlayAreaCenterOffset =
|
var relativePlayAreaCenterOffset =
|
||||||
Vec3.sum(_this.playAreaCenterOffset, { x: 0, y: -TARGET_MODEL_DIMENSIONS.y / 2, z: 0 });
|
Vec3.sum(_this.playAreaCenterOffset, { x: 0, y: -TARGET_MODEL_DIMENSIONS.y / 2, z: 0 });
|
||||||
|
@ -58,7 +58,8 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
if (nearGrabModule) {
|
if (nearGrabModule) {
|
||||||
var candidateOverlays = controllerData.nearbyOverlayIDs[this.hand];
|
var candidateOverlays = controllerData.nearbyOverlayIDs[this.hand];
|
||||||
var grabbableOverlays = candidateOverlays.filter(function(overlayID) {
|
var grabbableOverlays = candidateOverlays.filter(function(overlayID) {
|
||||||
return Overlays.getProperty(overlayID, "grabbable");
|
//V8TODO: this needs to be checked if it works
|
||||||
|
return Entities.getEntityProperties(overlayID, ["grab"]).grab.grabbable;
|
||||||
});
|
});
|
||||||
var target = nearGrabModule.getTargetID(grabbableOverlays, controllerData);
|
var target = nearGrabModule.getTargetID(grabbableOverlays, controllerData);
|
||||||
if (target) {
|
if (target) {
|
||||||
@ -105,7 +106,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||||||
if (intersection.type === Picks.INTERSECTED_OVERLAY) {
|
if (intersection.type === Picks.INTERSECTED_OVERLAY) {
|
||||||
var overlayIndex = this.ignoredObjects.indexOf(objectID);
|
var overlayIndex = this.ignoredObjects.indexOf(objectID);
|
||||||
|
|
||||||
var overlayName = Overlays.getProperty(objectID, "name");
|
var overlayName = Entities.getEntityProperties(objectID, ["name"]).name;
|
||||||
if (overlayName !== "Loading-Destination-Card-Text" && overlayName !== "Loading-Destination-Card-GoTo-Image" &&
|
if (overlayName !== "Loading-Destination-Card-Text" && overlayName !== "Loading-Destination-Card-GoTo-Image" &&
|
||||||
overlayName !== "Loading-Destination-Card-GoTo-Image-Hover") {
|
overlayName !== "Loading-Destination-Card-GoTo-Image-Hover") {
|
||||||
var data = {
|
var data = {
|
||||||
|
@ -237,8 +237,8 @@
|
|||||||
var connectionToDomainFailed = false;
|
var connectionToDomainFailed = false;
|
||||||
|
|
||||||
function getAnchorLocalYOffset() {
|
function getAnchorLocalYOffset() {
|
||||||
var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position");
|
var loadingSpherePosition = Entities.getEntityProperties(loadingSphereID, ["position"]).position;
|
||||||
var loadingSphereOrientation = Overlays.getProperty(loadingSphereID, "rotation");
|
var loadingSphereOrientation = Entities.getEntityProperties(loadingSphereID, ["rotation"]).rotation;
|
||||||
var overlayXform = new Xform(loadingSphereOrientation, loadingSpherePosition);
|
var overlayXform = new Xform(loadingSphereOrientation, loadingSpherePosition);
|
||||||
var worldToOverlayXform = overlayXform.inv();
|
var worldToOverlayXform = overlayXform.inv();
|
||||||
var headPosition = MyAvatar.getHeadPosition();
|
var headPosition = MyAvatar.getHeadPosition();
|
||||||
|
@ -435,9 +435,9 @@ var projectOntoEntityXYPlane = function (entityID, worldPos, popProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var projectOntoOverlayXYPlane = function projectOntoOverlayXYPlane(overlayID, worldPos) {
|
var projectOntoOverlayXYPlane = function projectOntoOverlayXYPlane(overlayID, worldPos) {
|
||||||
var position = Overlays.getProperty(overlayID, "position");
|
var position = Entities.getEntityProperties(overlayID, ["position"]).position;
|
||||||
var rotation = Overlays.getProperty(overlayID, "rotation");
|
var rotation = Entities.getEntityProperties(overlayID, ["rotation"]).rotation;
|
||||||
var dimensions = Overlays.getProperty(overlayID, "dimensions");
|
var dimensions = Entities.getEntityProperties(overlayID, ["dimensions"]).dimensions;
|
||||||
dimensions.z = 0.01; // we are projecting onto the XY plane of the overlay, so ignore the z dimension
|
dimensions.z = 0.01; // we are projecting onto the XY plane of the overlay, so ignore the z dimension
|
||||||
|
|
||||||
return projectOntoXYPlane(worldPos, position, rotation, dimensions, DEFAULT_REGISTRATION_POINT);
|
return projectOntoXYPlane(worldPos, position, rotation, dimensions, DEFAULT_REGISTRATION_POINT);
|
||||||
|
@ -152,13 +152,13 @@ function composeTouchTargetFromIntersection(intersection) {
|
|||||||
|
|
||||||
// will return undefined if overlayID does not exist.
|
// will return undefined if overlayID does not exist.
|
||||||
function calculateTouchTargetFromOverlay(touchTip, overlayID) {
|
function calculateTouchTargetFromOverlay(touchTip, overlayID) {
|
||||||
var overlayPosition = Overlays.getProperty(overlayID, "position");
|
var overlayPosition = Entities.getEntityProperties(overlayID, ["position"]).position;
|
||||||
if (overlayPosition === undefined) {
|
if (overlayPosition === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// project touchTip onto overlay plane.
|
// project touchTip onto overlay plane.
|
||||||
var overlayRotation = Overlays.getProperty(overlayID, "rotation");
|
var overlayRotation = Entities.getEntityProperties(overlayID, ["rotation"]).rotation;
|
||||||
if (overlayRotation === undefined) {
|
if (overlayRotation === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -170,7 +170,8 @@ function calculateTouchTargetFromOverlay(touchTip, overlayID) {
|
|||||||
var invRot = Quat.inverse(overlayRotation);
|
var invRot = Quat.inverse(overlayRotation);
|
||||||
var localPos = Vec3.multiplyQbyV(invRot, Vec3.subtract(position, overlayPosition));
|
var localPos = Vec3.multiplyQbyV(invRot, Vec3.subtract(position, overlayPosition));
|
||||||
|
|
||||||
var dimensions = Overlays.getProperty(overlayID, "dimensions");
|
// V8TODO: check if this is correct for entities
|
||||||
|
var dimensions = Entities.getEntityProperties(overlayID, ["dimensions"]).dimensions;
|
||||||
if (dimensions === undefined) {
|
if (dimensions === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -376,7 +376,7 @@ resizeTablet = function (width, newParentJointIndex, sensorToWorldScaleOverride)
|
|||||||
var sensorScaleFactor = sensorToWorldScaleOverride || MyAvatar.sensorToWorldScale;
|
var sensorScaleFactor = sensorToWorldScaleOverride || MyAvatar.sensorToWorldScale;
|
||||||
var sensorScaleOffsetOverride = 1;
|
var sensorScaleOffsetOverride = 1;
|
||||||
var SENSOR_TO_ROOM_MATRIX = 65534;
|
var SENSOR_TO_ROOM_MATRIX = 65534;
|
||||||
var parentJointIndex = newParentJointIndex || Overlays.getProperty(HMD.tabletID, "parentJointIndex");
|
var parentJointIndex = newParentJointIndex || Entities.getEntityProperties(HMD.tabletID, ["parentJointIndex"]).parentJointIndex;
|
||||||
if (parentJointIndex === SENSOR_TO_ROOM_MATRIX) {
|
if (parentJointIndex === SENSOR_TO_ROOM_MATRIX) {
|
||||||
sensorScaleOffsetOverride = 1 / sensorScaleFactor;
|
sensorScaleOffsetOverride = 1 / sensorScaleFactor;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ function setTabletVisibleInSecondaryCamera(visibleInSecondaryCam) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if we're hiding the tablet, check to see if it was visible in the first place
|
// if we're hiding the tablet, check to see if it was visible in the first place
|
||||||
tabletShouldBeVisibleInSecondaryCamera = Overlays.getProperty(HMD.tabletID, "isVisibleInSecondaryCamera");
|
tabletShouldBeVisibleInSecondaryCamera = Entities.getEntityProperties(HMD.tabletID, ["isVisibleInSecondaryCamera"]).isVisibleInSecondaryCamera;
|
||||||
}
|
}
|
||||||
|
|
||||||
Overlays.editOverlay(HMD.tabletID, { isVisibleInSecondaryCamera: visibleInSecondaryCam });
|
Overlays.editOverlay(HMD.tabletID, { isVisibleInSecondaryCamera: visibleInSecondaryCam });
|
||||||
|
@ -354,7 +354,7 @@ function main() {
|
|||||||
settingsApp.isActiveChanged.connect(function(isActive) {
|
settingsApp.isActiveChanged.connect(function(isActive) {
|
||||||
updateButtonText();
|
updateButtonText();
|
||||||
if (Overlays.getOverlayType(HMD.tabletScreenID)) {
|
if (Overlays.getOverlayType(HMD.tabletScreenID)) {
|
||||||
var fromMode = Overlays.getProperty(HMD.tabletScreenID, 'inputMode'),
|
var fromMode = Entities.getEntityProperties(HMD.tabletScreenID, ['inputMode']).inputMode,
|
||||||
inputMode = isActive ? "Mouse" : "Touch";
|
inputMode = isActive ? "Mouse" : "Touch";
|
||||||
log('switching HMD.tabletScreenID from inputMode', fromMode, 'to', inputMode);
|
log('switching HMD.tabletScreenID from inputMode', fromMode, 'to', inputMode);
|
||||||
Overlays.editOverlay(HMD.tabletScreenID, { inputMode: inputMode });
|
Overlays.editOverlay(HMD.tabletScreenID, { inputMode: inputMode });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user