Marked places where 3D overlays need to be replaced with local entities

This commit is contained in:
ksuprynowicz 2023-03-17 00:25:05 +01:00
parent 37a1320a30
commit 91d7abc883
21 changed files with 34 additions and 1 deletions

View file

@ -48,6 +48,7 @@
if (HMD.active) { if (HMD.active) {
// 3D overlay attached to avatar. // 3D overlay attached to avatar.
//V8TODO: change to local entity
hmdOverlay = Overlays.addOverlay("text3d", { hmdOverlay = Overlays.addOverlay("text3d", {
text: recordingText, text: recordingText,
dimensions: { x: 3 * HMD_FONT_SIZE, y: HMD_FONT_SIZE }, dimensions: { x: 3 * HMD_FONT_SIZE, y: HMD_FONT_SIZE },

View file

@ -19,6 +19,7 @@ Script.include("/~/system/libraries/controllers.js");
var isShowingOverlays = true; var isShowingOverlays = true;
var debugOverlays = {}; var debugOverlays = {};
//V8TODO: change to local entity
var textSizeOverlay = Overlays.addOverlay("text3d", { var textSizeOverlay = Overlays.addOverlay("text3d", {
position: MyAvatar.position, position: MyAvatar.position,
lineHeight: 0.1, lineHeight: 0.1,

View file

@ -31,6 +31,7 @@ function updateOverlay(entityID, queryAACube) {
size: queryAACube.scale size: queryAACube.scale
}); });
} else { } else {
//V8TODO: change to local entity
overlays[entityID] = Overlays.addOverlay("cube", { overlays[entityID] = Overlays.addOverlay("cube", {
position: cubeCenter, position: cubeCenter,
size: queryAACube.scale, size: queryAACube.scale,

View file

@ -11,6 +11,7 @@ var JOINT_NAME = HMD.active ? HAND_JOINT : 'Mouse';
var UPDATE_MS = 1000/30; var UPDATE_MS = 1000/30;
// create tect3d overlay to display hover results // create tect3d overlay to display hover results
//V8TODO: change to local entity
var overlayID = Overlays.addOverlay('text3d', { var overlayID = Overlays.addOverlay('text3d', {
text: 'hover', text: 'hover',
visible: false, visible: false,

View file

@ -46,6 +46,7 @@ var entitySphere = Entities.addEntity({
}); });
var overlaySpherePosition = Vec3.sum(tablePosition, {x: sphereDimensions.x, y: tableDimensions.y/2 + sphereDimensions.y/2, z: 0}); var overlaySpherePosition = Vec3.sum(tablePosition, {x: sphereDimensions.x, y: tableDimensions.y/2 + sphereDimensions.y/2, z: 0});
//V8TODO: change to local entity
var overlaySphere = Overlays.addOverlay("sphere", { var overlaySphere = Overlays.addOverlay("sphere", {
position: overlaySpherePosition, position: overlaySpherePosition,
size: 0.01, size: 0.01,

View file

@ -23,7 +23,8 @@ SPAWNER = function (properties) {
} }
function makeObject(properties) { function makeObject(properties) {
//V8TODO: change to local entity
var overlay = Overlays.addOverlay("web3d", { var overlay = Overlays.addOverlay("web3d", {
name: "Web", name: "Web",
url: "https://www.reddit.com/r/random", url: "https://www.reddit.com/r/random",

View file

@ -41,6 +41,7 @@
} }
if (HMD.active) { if (HMD.active) {
//V8TODO: change to local entity
warningOverlayID = Overlays.addOverlay("text3d", { warningOverlayID = Overlays.addOverlay("text3d", {
name: "Muted-Warning", name: "Muted-Warning",
localPosition: { x: 0.0, y: -0.45, z: -1.0 }, localPosition: { x: 0.0, y: -0.45, z: -1.0 },

View file

@ -27,6 +27,7 @@ var POSSIBLE_AC_AVATARS = [
AvatarFinderBeacon = function(avatar) { AvatarFinderBeacon = function(avatar) {
var visible = false; var visible = false;
var avatarSessionUUID = avatar.sessionUUID; var avatarSessionUUID = avatar.sessionUUID;
//V8TODO: change to local entity
this.overlay = Overlays.addOverlay('line3d', { this.overlay = Overlays.addOverlay('line3d', {
color: BEAM_COLOR, color: BEAM_COLOR,
dashed: false, dashed: false,

View file

@ -89,6 +89,7 @@ function stopAwayAnimation() {
// OVERLAY // OVERLAY
var overlay = Overlays.addOverlay("image", OVERLAY_DATA); var overlay = Overlays.addOverlay("image", OVERLAY_DATA);
//V8TODO: change to local entity
var overlayHMD = Overlays.addOverlay("image3d", OVERLAY_DATA_HMD); var overlayHMD = Overlays.addOverlay("image3d", OVERLAY_DATA_HMD);
function showOverlay() { function showOverlay() {

View file

@ -21,6 +21,7 @@
// Affects bubble height // Affects bubble height
var BUBBLE_HEIGHT_SCALE = 0.15; var BUBBLE_HEIGHT_SCALE = 0.15;
// The bubble model itself // The bubble model itself
//V8TODO: change to local entity
var bubbleOverlay = Overlays.addOverlay("model", { var bubbleOverlay = Overlays.addOverlay("model", {
url: Script.resolvePath("assets/models/Bubble-v14.fbx"), // If you'd like to change the model, modify this line (and the dimensions below) url: Script.resolvePath("assets/models/Bubble-v14.fbx"), // If you'd like to change the model, modify this line (and the dimensions below)
dimensions: { x: MyAvatar.sensorToWorldScale, y: 0.75 * MyAvatar.sensorToWorldScale, z: MyAvatar.sensorToWorldScale }, dimensions: { x: MyAvatar.sensorToWorldScale, y: 0.75 * MyAvatar.sensorToWorldScale, z: MyAvatar.sensorToWorldScale },

View file

@ -45,6 +45,7 @@
var speechBubbleLineHeight = 0.05; // The height of a line of text in the speech bubble. var speechBubbleLineHeight = 0.05; // The height of a line of text in the speech bubble.
var SPEECH_BUBBLE_MAX_WIDTH = 1; // meters var SPEECH_BUBBLE_MAX_WIDTH = 1; // meters
//V8TODO: change to local entity
var textSizeOverlay = Overlays.addOverlay("text3d", { var textSizeOverlay = Overlays.addOverlay("text3d", {
position: MyAvatar.position, position: MyAvatar.position,
lineHeight: speechBubbleLineHeight, lineHeight: speechBubbleLineHeight,

View file

@ -313,6 +313,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
Overlays.editOverlay(this.grabSphereOverlays[h], { position: controllerLocations[h].position }); Overlays.editOverlay(this.grabSphereOverlays[h], { position: controllerLocations[h].position });
} else { } else {
var grabSphereSize = findRadius * 2; var grabSphereSize = findRadius * 2;
//V8TODO: change to local entity
this.grabSphereOverlays[h] = Overlays.addOverlay("sphere", { this.grabSphereOverlays[h] = Overlays.addOverlay("sphere", {
position: controllerLocations[h].position, position: controllerLocations[h].position,
dimensions: { x: grabSphereSize, y: grabSphereSize, z: grabSphereSize }, dimensions: { x: grabSphereSize, y: grabSphereSize, z: grabSphereSize },

View file

@ -172,6 +172,7 @@ createControllerDisplay = function(config) {
controller.naturalPosition = { x: 0, y: 0, z: 0 }; controller.naturalPosition = { x: 0, y: 0, z: 0 };
} }
//V8TODO: change to local entity
var baseOverlayID = Overlays.addOverlay("model", { var baseOverlayID = Overlays.addOverlay("model", {
url: controller.modelURL, url: controller.modelURL,
dimensions: Vec3.multiply(sensorScaleFactor, controller.dimensions), dimensions: Vec3.multiply(sensorScaleFactor, controller.dimensions),
@ -206,6 +207,7 @@ createControllerDisplay = function(config) {
properties.textures = textures; properties.textures = textures;
} }
//V8TODO: change to local entity
var overlayID = Overlays.addOverlay("model", properties); var overlayID = Overlays.addOverlay("model", properties);
if (part.type === "rotational") { if (part.type === "rotational") {

View file

@ -74,6 +74,7 @@ EquipHotspotBuddy.prototype.updateHotspot = function(hotspot, timestamp) {
} }
// override default sphere with a user specified model, if it exists. // override default sphere with a user specified model, if it exists.
//V8TODO: change to local entity
overlayInfoSet.overlays.push(Overlays.addOverlay("model", { overlayInfoSet.overlays.push(Overlays.addOverlay("model", {
name: "hotspot overlay", name: "hotspot overlay",
url: hotspot.indicatorURL ? hotspot.indicatorURL : DEFAULT_SPHERE_MODEL_URL, url: hotspot.indicatorURL ? hotspot.indicatorURL : DEFAULT_SPHERE_MODEL_URL,

View file

@ -142,6 +142,7 @@ WebTablet = function (url, width, dpi, hand, location, visible) {
this.cleanUpOldTablets(); this.cleanUpOldTablets();
cleanUpOldMaterialEntities(); cleanUpOldMaterialEntities();
//V8TODO: change to local entity
this.tabletEntityID = Overlays.addOverlay("model", tabletProperties); this.tabletEntityID = Overlays.addOverlay("model", tabletProperties);
if (this.webOverlayID) { if (this.webOverlayID) {
@ -152,6 +153,7 @@ WebTablet = function (url, width, dpi, hand, location, visible) {
var WEB_ENTITY_Y_OFFSET = 1.25 * tabletScaleFactor; var WEB_ENTITY_Y_OFFSET = 1.25 * tabletScaleFactor;
var screenWidth = 0.9367 * tabletWidth; var screenWidth = 0.9367 * tabletWidth;
var screenHeight = 0.9000 * tabletHeight; var screenHeight = 0.9000 * tabletHeight;
//V8TODO: change to local entity
this.webOverlayID = Overlays.addOverlay("web3d", { this.webOverlayID = Overlays.addOverlay("web3d", {
name: "WebTablet Web", name: "WebTablet Web",
url: url, url: url,
@ -172,6 +174,7 @@ WebTablet = function (url, width, dpi, hand, location, visible) {
var HOME_BUTTON_X_OFFSET = 0.00079 * sensorScaleFactor; var HOME_BUTTON_X_OFFSET = 0.00079 * sensorScaleFactor;
var HOME_BUTTON_Y_OFFSET = -1 * ((tabletHeight / 2) - (4.0 * tabletScaleFactor / 2)); var HOME_BUTTON_Y_OFFSET = -1 * ((tabletHeight / 2) - (4.0 * tabletScaleFactor / 2));
var HOME_BUTTON_Z_OFFSET = (tabletDepth / 1.9) * sensorScaleFactor; var HOME_BUTTON_Z_OFFSET = (tabletDepth / 1.9) * sensorScaleFactor;
//V8TODO: change to local entity
this.homeButtonID = Overlays.addOverlay("circle3d", { this.homeButtonID = Overlays.addOverlay("circle3d", {
name: "homeButton", name: "homeButton",
localPosition: { x: HOME_BUTTON_X_OFFSET, y: HOME_BUTTON_Y_OFFSET, z: -HOME_BUTTON_Z_OFFSET }, localPosition: { x: HOME_BUTTON_X_OFFSET, y: HOME_BUTTON_Y_OFFSET, z: -HOME_BUTTON_Z_OFFSET },
@ -185,6 +188,7 @@ WebTablet = function (url, width, dpi, hand, location, visible) {
parentJointIndex: -1 parentJointIndex: -1
}); });
//V8TODO: change to local entity
this.homeButtonHighlightID = Overlays.addOverlay("circle3d", { this.homeButtonHighlightID = Overlays.addOverlay("circle3d", {
name: "homeButtonHighlight", name: "homeButtonHighlight",
localPosition: { x: -HOME_BUTTON_X_OFFSET, y: HOME_BUTTON_Y_OFFSET, z: -HOME_BUTTON_Z_OFFSET }, localPosition: { x: -HOME_BUTTON_X_OFFSET, y: HOME_BUTTON_Y_OFFSET, z: -HOME_BUTTON_Z_OFFSET },

View file

@ -12,6 +12,7 @@
// OverlayGroup provides a way to create composite overlays and control their // OverlayGroup provides a way to create composite overlays and control their
// position relative to a settable rootPosition and rootRotation. // position relative to a settable rootPosition and rootRotation.
// //
//V8TODO: check if it uses 3D overlays
OverlayGroup = function(opts) { OverlayGroup = function(opts) {
var that = {}; var that = {};

View file

@ -465,6 +465,7 @@
} }
function create() { function create() {
//V8TODO: change to local entity
miniOverlay = Overlays.addOverlay("model", { miniOverlay = Overlays.addOverlay("model", {
url: MINI_MODEL, url: MINI_MODEL,
dimensions: Vec3.multiply(MyAvatar.sensorToWorldScale, MINI_DIMENSIONS), dimensions: Vec3.multiply(MyAvatar.sensorToWorldScale, MINI_DIMENSIONS),
@ -474,6 +475,7 @@
drawInFront: false, drawInFront: false,
visible: false visible: false
}); });
//V8TODO: change to local entity
miniUIOverlay = Overlays.addOverlay("web3d", { miniUIOverlay = Overlays.addOverlay("web3d", {
url: handsAreTracked() ? MINI_HAND_UI_HTML : MINI_UI_HTML, url: handsAreTracked() ? MINI_HAND_UI_HTML : MINI_UI_HTML,
parentID: miniOverlay, parentID: miniOverlay,

View file

@ -134,6 +134,7 @@ function updateOverlays() {
modOverlays[avatarID]=[newKickOverlay]; modOverlays[avatarID]=[newKickOverlay];
if (Users.canKick) { if (Users.canKick) {
//V8TODO: change to local entity
var newMuteOverlay = Overlays.addOverlay("image3d", { var newMuteOverlay = Overlays.addOverlay("image3d", {
url: muteOverlayURL(), url: muteOverlayURL(),
position: muteOverlayPosition, position: muteOverlayPosition,

View file

@ -77,6 +77,7 @@ function ExtendedOverlay(key, type, properties, selected, hasModel) { // A wrapp
this.key = key; this.key = key;
this.selected = selected || false; // not undefined this.selected = selected || false; // not undefined
this.hovering = false; this.hovering = false;
//V8TODO: check if it uses 3d overlays
this.activeOverlay = Overlays.addOverlay(type, properties); // We could use different overlays for (un)selected... this.activeOverlay = Overlays.addOverlay(type, properties); // We could use different overlays for (un)selected...
} }
// Instance methods: // Instance methods:
@ -183,6 +184,7 @@ ExtendedOverlay.applyPickRay = function (pickRay, hit, noHit) {
// //
function HighlightedEntity(id, entityProperties) { function HighlightedEntity(id, entityProperties) {
this.id = id; this.id = id;
//V8TODO: change to local entity
this.overlay = Overlays.addOverlay('cube', { this.overlay = Overlays.addOverlay('cube', {
position: entityProperties.position, position: entityProperties.position,
rotation: entityProperties.rotation, rotation: entityProperties.rotation,

View file

@ -38,6 +38,7 @@
var oopsDimensions = {x: 4.2, y: 0.8}; var oopsDimensions = {x: 4.2, y: 0.8};
//V8TODO: change to local entity
var redirectOopsText = Overlays.addOverlay("text3d", { var redirectOopsText = Overlays.addOverlay("text3d", {
name: "oopsText", name: "oopsText",
position: {x: 0, y: 1.6763916015625, z: 1.45927095413208}, position: {x: 0, y: 1.6763916015625, z: 1.45927095413208},
@ -55,6 +56,7 @@
grabbable: false, grabbable: false,
}); });
//V8TODO: change to local entity
var tryAgainImageNeutral = Overlays.addOverlay("image3d", { var tryAgainImageNeutral = Overlays.addOverlay("image3d", {
name: "tryAgainImage", name: "tryAgainImage",
localPosition: {x: -0.6, y: -0.6, z: 0.0}, localPosition: {x: -0.6, y: -0.6, z: 0.0},
@ -68,6 +70,7 @@
parentID: redirectOopsText parentID: redirectOopsText
}); });
//V8TODO: change to local entity
var tryAgainImageHover = Overlays.addOverlay("image3d", { var tryAgainImageHover = Overlays.addOverlay("image3d", {
name: "tryAgainImageHover", name: "tryAgainImageHover",
localPosition: {x: -0.6, y: -0.6, z: 0.0}, localPosition: {x: -0.6, y: -0.6, z: 0.0},
@ -81,6 +84,7 @@
parentID: redirectOopsText parentID: redirectOopsText
}); });
//V8TODO: change to local entity
var tryAgainText = Overlays.addOverlay("text3d", { var tryAgainText = Overlays.addOverlay("text3d", {
name: "tryAgainText", name: "tryAgainText",
localPosition: {x: -0.6, y: -0.962, z: 0.0}, localPosition: {x: -0.6, y: -0.962, z: 0.0},
@ -96,6 +100,7 @@
parentID: redirectOopsText parentID: redirectOopsText
}); });
//V8TODO: change to local entity
var backImageNeutral = Overlays.addOverlay("image3d", { var backImageNeutral = Overlays.addOverlay("image3d", {
name: "backImage", name: "backImage",
localPosition: {x: 0.6, y: -0.6, z: 0.0}, localPosition: {x: 0.6, y: -0.6, z: 0.0},
@ -109,6 +114,7 @@
parentID: redirectOopsText parentID: redirectOopsText
}); });
//V8TODO: change to local entity
var backImageHover = Overlays.addOverlay("image3d", { var backImageHover = Overlays.addOverlay("image3d", {
name: "backImageHover", name: "backImageHover",
localPosition: {x: 0.6, y: -0.6, z: 0.0}, localPosition: {x: 0.6, y: -0.6, z: 0.0},
@ -122,6 +128,7 @@
parentID: redirectOopsText parentID: redirectOopsText
}); });
//V8TODO: change to local entity
var backText = Overlays.addOverlay("text3d", { var backText = Overlays.addOverlay("text3d", {
name: "backText", name: "backText",
localPosition: {x: 0.6, y: -0.962, z: 0.0}, localPosition: {x: 0.6, y: -0.962, z: 0.0},

View file

@ -249,6 +249,7 @@
tabletShown = false; tabletShown = false;
// also cause the stylus model to be loaded // also cause the stylus model to be loaded
//V8TODO: change to local entity
var tmpStylusID = Overlays.addOverlay("model", { var tmpStylusID = Overlays.addOverlay("model", {
name: "stylus", name: "stylus",
url: Script.resourcesPath() + "meshes/tablet-stylus-fat.fbx", url: Script.resourcesPath() + "meshes/tablet-stylus-fat.fbx",