mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:17:24 +02:00
Merge pull request #9247 from huffman/feat/tutorial-touch-grip
Add support for new Touch grip mappings to tutorial
This commit is contained in:
commit
368f48f0a7
8 changed files with 84 additions and 25 deletions
Binary file not shown.
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 123 KiB |
Binary file not shown.
Binary file not shown.
|
@ -195,6 +195,8 @@ var STATE_OVERLAY_TOUCHING = 8;
|
||||||
var holdEnabled = true;
|
var holdEnabled = true;
|
||||||
var nearGrabEnabled = true;
|
var nearGrabEnabled = true;
|
||||||
var farGrabEnabled = true;
|
var farGrabEnabled = true;
|
||||||
|
var myAvatarScalingEnabled = true;
|
||||||
|
var objectScalingEnabled = true;
|
||||||
|
|
||||||
// "collidesWith" is specified by comma-separated list of group names
|
// "collidesWith" is specified by comma-separated list of group names
|
||||||
// the possible group names are: static, dynamic, kinematic, myAvatar, otherAvatar
|
// the possible group names are: static, dynamic, kinematic, myAvatar, otherAvatar
|
||||||
|
@ -2312,6 +2314,10 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.maybeScale = function(props) {
|
this.maybeScale = function(props) {
|
||||||
|
if (!objectScalingEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.shouldScale) {
|
if (!this.shouldScale) {
|
||||||
// If both secondary triggers squeezed, and the non-holding hand is empty, start scaling
|
// If both secondary triggers squeezed, and the non-holding hand is empty, start scaling
|
||||||
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed() && this.getOtherHandController().state === STATE_OFF) {
|
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed() && this.getOtherHandController().state === STATE_OFF) {
|
||||||
|
@ -2331,6 +2337,10 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.maybeScaleMyAvatar = function() {
|
this.maybeScaleMyAvatar = function() {
|
||||||
|
if (!myAvatarScalingEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.shouldScale) {
|
if (!this.shouldScale) {
|
||||||
// If both secondary triggers squeezed, start scaling
|
// If both secondary triggers squeezed, start scaling
|
||||||
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed()) {
|
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed()) {
|
||||||
|
@ -3016,6 +3026,14 @@ var handleHandMessages = function(channel, message, sender) {
|
||||||
print("farGrabEnabled: ", data.farGrabEnabled);
|
print("farGrabEnabled: ", data.farGrabEnabled);
|
||||||
farGrabEnabled = data.farGrabEnabled;
|
farGrabEnabled = data.farGrabEnabled;
|
||||||
}
|
}
|
||||||
|
if (data.myAvatarScalingEnabled !== undefined) {
|
||||||
|
print("myAvatarScalingEnabled: ", data.myAvatarScalingEnabled);
|
||||||
|
myAvatarScalingEnabled = data.myAvatarScalingEnabled;
|
||||||
|
}
|
||||||
|
if (data.objectScalingEnabled !== undefined) {
|
||||||
|
print("objectScalingEnabled: ", data.objectScalingEnabled);
|
||||||
|
objectScalingEnabled = data.objectScalingEnabled;
|
||||||
|
}
|
||||||
} else if (channel === 'Hifi-Hand-Grab') {
|
} else if (channel === 'Hifi-Hand-Grab') {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(message);
|
data = JSON.parse(message);
|
||||||
|
|
|
@ -74,6 +74,9 @@ TOUCH_CONTROLLER_CONFIGURATION_LEFT = {
|
||||||
teleport: {
|
teleport: {
|
||||||
defaultTextureURL: BASE_URL + "Oculus-Labels-L.fbx/Oculus-Labels-L.fbm/Teleport.png"
|
defaultTextureURL: BASE_URL + "Oculus-Labels-L.fbx/Oculus-Labels-L.fbm/Teleport.png"
|
||||||
},
|
},
|
||||||
|
both_triggers: {
|
||||||
|
defaultTextureURL: BASE_URL + "Oculus-Labels-L.fbx/Oculus-Labels-L.fbm/Grip-Trigger.png"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -212,7 +215,7 @@ TOUCH_CONTROLLER_CONFIGURATION_RIGHT = {
|
||||||
modelURL: BASE_URL + "Oculus-Labels-R.fbx",
|
modelURL: BASE_URL + "Oculus-Labels-R.fbx",
|
||||||
naturalPosition: { x: 0.009739525616168976, y: -0.0017818436026573181, z: 0.016794726252555847 },
|
naturalPosition: { x: 0.009739525616168976, y: -0.0017818436026573181, z: 0.016794726252555847 },
|
||||||
|
|
||||||
textureName: "Texture",
|
textureName: "blank",
|
||||||
defaultTextureLayer: "blank",
|
defaultTextureLayer: "blank",
|
||||||
textureLayers: {
|
textureLayers: {
|
||||||
blank: {
|
blank: {
|
||||||
|
@ -230,6 +233,9 @@ TOUCH_CONTROLLER_CONFIGURATION_RIGHT = {
|
||||||
teleport: {
|
teleport: {
|
||||||
defaultTextureURL: BASE_URL + "Oculus-Labels-R.fbx/Oculus-Labels-R.fbm/Teleport.png"
|
defaultTextureURL: BASE_URL + "Oculus-Labels-R.fbx/Oculus-Labels-R.fbm/Teleport.png"
|
||||||
},
|
},
|
||||||
|
both_triggers: {
|
||||||
|
defaultTextureURL: BASE_URL + "Oculus-Labels-R.fbx/Oculus-Labels-R.fbm/Grip-Trigger.png"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ const appIcon = path.join(__dirname, '../resources/console.png');
|
||||||
const DELETE_LOG_FILES_OLDER_THAN_X_SECONDS = 60 * 60 * 24 * 7; // 7 Days
|
const DELETE_LOG_FILES_OLDER_THAN_X_SECONDS = 60 * 60 * 24 * 7; // 7 Days
|
||||||
const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/;
|
const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/;
|
||||||
|
|
||||||
const HOME_CONTENT_URL = "http://cachefly.highfidelity.com/home-tutorial-release-5572.tar.gz";
|
const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial-28.tar.gz";
|
||||||
|
|
||||||
function getBuildInfo() {
|
function getBuildInfo() {
|
||||||
var buildInfoPath = null;
|
var buildInfoPath = null;
|
||||||
|
|
|
@ -58,6 +58,9 @@ function info() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CONTROLLER_TOUCH = 'touch';
|
||||||
|
const CONTROLLER_VIVE = 'vive';
|
||||||
|
|
||||||
var NEAR_BOX_SPAWN_NAME = "tutorial/nearGrab/box_spawn";
|
var NEAR_BOX_SPAWN_NAME = "tutorial/nearGrab/box_spawn";
|
||||||
var FAR_BOX_SPAWN_NAME = "tutorial/farGrab/box_spawn";
|
var FAR_BOX_SPAWN_NAME = "tutorial/farGrab/box_spawn";
|
||||||
var GUN_SPAWN_NAME = "tutorial/gun_spawn";
|
var GUN_SPAWN_NAME = "tutorial/gun_spawn";
|
||||||
|
@ -323,7 +326,7 @@ function hideEntitiesWithTag(tag) {
|
||||||
//});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the entity properties for an entity with a given name if it is in our
|
* Return the entity properties for an entity with a given name if it is in our
|
||||||
* cached list of entities. Otherwise, return undefined.
|
* cached list of entities. Otherwise, return undefined.
|
||||||
*/
|
*/
|
||||||
|
@ -371,6 +374,8 @@ function disableEverything() {
|
||||||
nearGrabEnabled: true,
|
nearGrabEnabled: true,
|
||||||
holdEnabled: false,
|
holdEnabled: false,
|
||||||
farGrabEnabled: false,
|
farGrabEnabled: false,
|
||||||
|
myAvatarScalingEnabled: false,
|
||||||
|
objectScalingEnabled: false,
|
||||||
}));
|
}));
|
||||||
setControllerPartLayer('touchpad', 'blank');
|
setControllerPartLayer('touchpad', 'blank');
|
||||||
setControllerPartLayer('trigger', 'blank');
|
setControllerPartLayer('trigger', 'blank');
|
||||||
|
@ -399,6 +404,8 @@ function reenableEverything() {
|
||||||
nearGrabEnabled: true,
|
nearGrabEnabled: true,
|
||||||
holdEnabled: true,
|
holdEnabled: true,
|
||||||
farGrabEnabled: true,
|
farGrabEnabled: true,
|
||||||
|
myAvatarScalingEnabled: true,
|
||||||
|
objectScalingEnabled: true,
|
||||||
}));
|
}));
|
||||||
setControllerPartLayer('touchpad', 'blank');
|
setControllerPartLayer('touchpad', 'blank');
|
||||||
setControllerPartLayer('trigger', 'blank');
|
setControllerPartLayer('trigger', 'blank');
|
||||||
|
@ -516,12 +523,14 @@ stepOrient.prototype = {
|
||||||
// STEP: Near Grab //
|
// STEP: Near Grab //
|
||||||
// //
|
// //
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
var stepNearGrab = function() {
|
var stepNearGrab = function(tutorialManager) {
|
||||||
this.name = 'nearGrab';
|
this.name = 'nearGrab';
|
||||||
this.tag = "nearGrab";
|
this.tags = ["bothGrab", "nearGrab", "nearGrab-" + tutorialManager.controllerName];
|
||||||
this.tempTag = "nearGrab-temporary";
|
this.tempTag = "nearGrab-temporary";
|
||||||
this.birdIDs = [];
|
this.birdIDs = [];
|
||||||
|
|
||||||
|
this.controllerName = tutorialManager.controllerName;
|
||||||
|
|
||||||
Messages.subscribe("Entity-Exploded");
|
Messages.subscribe("Entity-Exploded");
|
||||||
Messages.messageReceived.connect(this.onMessage.bind(this));
|
Messages.messageReceived.connect(this.onMessage.bind(this));
|
||||||
}
|
}
|
||||||
|
@ -530,12 +539,17 @@ stepNearGrab.prototype = {
|
||||||
this.finished = false;
|
this.finished = false;
|
||||||
this.onFinish = onFinish;
|
this.onFinish = onFinish;
|
||||||
|
|
||||||
setControllerPartLayer('tips', 'trigger');
|
if (this.controllerName === CONTROLLER_TOUCH) {
|
||||||
setControllerPartLayer('trigger', 'highlight');
|
setControllerPartLayer('tips', 'both_triggers');
|
||||||
|
setControllerPartLayer('trigger', 'highlight');
|
||||||
|
setControllerPartLayer('grip', 'highlight');
|
||||||
|
} else {
|
||||||
|
setControllerPartLayer('tips', 'trigger');
|
||||||
|
setControllerPartLayer('trigger', 'highlight');
|
||||||
|
}
|
||||||
|
|
||||||
// Spawn content set
|
// Show content set
|
||||||
showEntitiesWithTag(this.tag, { visible: true });
|
showEntitiesWithTags(this.tags);
|
||||||
showEntitiesWithTag('bothGrab', { visible: true });
|
|
||||||
|
|
||||||
var boxSpawnPosition = getEntityWithName(NEAR_BOX_SPAWN_NAME).position;
|
var boxSpawnPosition = getEntityWithName(NEAR_BOX_SPAWN_NAME).position;
|
||||||
function createBlock(fireworkNumber) {
|
function createBlock(fireworkNumber) {
|
||||||
|
@ -573,8 +587,8 @@ stepNearGrab.prototype = {
|
||||||
this.finished = true;
|
this.finished = true;
|
||||||
setControllerPartLayer('tips', 'blank');
|
setControllerPartLayer('tips', 'blank');
|
||||||
setControllerPartLayer('trigger', 'normal');
|
setControllerPartLayer('trigger', 'normal');
|
||||||
hideEntitiesWithTag(this.tag, { visible: false});
|
setControllerPartLayer('grip', 'normal');
|
||||||
hideEntitiesWithTag('bothGrab', { visible: false});
|
hideEntitiesWithTags(this.tags);
|
||||||
deleteEntitiesWithTag(this.tempTag);
|
deleteEntitiesWithTag(this.tempTag);
|
||||||
if (this.positionWatcher) {
|
if (this.positionWatcher) {
|
||||||
this.positionWatcher.destroy();
|
this.positionWatcher.destroy();
|
||||||
|
@ -696,6 +710,7 @@ PositionWatcher.prototype = {
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
var stepEquip = function(tutorialManager) {
|
var stepEquip = function(tutorialManager) {
|
||||||
const controllerName = tutorialManager.controllerName;
|
const controllerName = tutorialManager.controllerName;
|
||||||
|
this.controllerName = controllerName;
|
||||||
|
|
||||||
this.name = 'equip';
|
this.name = 'equip';
|
||||||
|
|
||||||
|
@ -714,8 +729,13 @@ var stepEquip = function(tutorialManager) {
|
||||||
}
|
}
|
||||||
stepEquip.prototype = {
|
stepEquip.prototype = {
|
||||||
start: function(onFinish) {
|
start: function(onFinish) {
|
||||||
setControllerPartLayer('tips', 'trigger');
|
if (this.controllerName === CONTROLLER_TOUCH) {
|
||||||
setControllerPartLayer('trigger', 'highlight');
|
setControllerPartLayer('tips', 'grip');
|
||||||
|
setControllerPartLayer('grip', 'highlight');
|
||||||
|
} else {
|
||||||
|
setControllerPartLayer('tips', 'trigger');
|
||||||
|
setControllerPartLayer('trigger', 'highlight');
|
||||||
|
}
|
||||||
|
|
||||||
Messages.sendLocalMessage('Hifi-Grab-Disable', JSON.stringify({
|
Messages.sendLocalMessage('Hifi-Grab-Disable', JSON.stringify({
|
||||||
holdEnabled: true,
|
holdEnabled: true,
|
||||||
|
|
|
@ -52,6 +52,16 @@ TUTORIAL_TAG_TO_ENTITY_IDS_MAP = {
|
||||||
"tag": "farGrab"
|
"tag": "farGrab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nearGrab-vive": {
|
||||||
|
"{88221a22-b710-4d35-852b-5257b0aa77dc}": {
|
||||||
|
"tag": "nearGrab-vive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nearGrab-touch": {
|
||||||
|
"{7c0f2fde-6c5c-459b-bf82-421979cebf2e}": {
|
||||||
|
"tag": "nearGrab-touch"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nearGrab": {
|
"nearGrab": {
|
||||||
"{55c861ef-60ca-4722-a6c5-9c6967966ec5}": {
|
"{55c861ef-60ca-4722-a6c5-9c6967966ec5}": {
|
||||||
"tag": "nearGrab"
|
"tag": "nearGrab"
|
||||||
|
@ -59,9 +69,6 @@ TUTORIAL_TAG_TO_ENTITY_IDS_MAP = {
|
||||||
"{644d655b-ae66-43b1-9bab-a44b9a8ad632}": {
|
"{644d655b-ae66-43b1-9bab-a44b9a8ad632}": {
|
||||||
"tag": "nearGrab"
|
"tag": "nearGrab"
|
||||||
},
|
},
|
||||||
"{88221a22-b710-4d35-852b-5257b0aa77dc}": {
|
|
||||||
"tag": "nearGrab"
|
|
||||||
},
|
|
||||||
"{8bf0baa1-88d0-448a-a782-100d4413bd82}": {
|
"{8bf0baa1-88d0-448a-a782-100d4413bd82}": {
|
||||||
"tag": "nearGrab"
|
"tag": "nearGrab"
|
||||||
},
|
},
|
||||||
|
@ -70,13 +77,20 @@ TUTORIAL_TAG_TO_ENTITY_IDS_MAP = {
|
||||||
"tag": "nearGrab"
|
"tag": "nearGrab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"equip-part1-touch": {
|
||||||
|
"{470f0634-8be7-4b52-a8bd-5183d489fcb6}": {
|
||||||
|
"tag": "equip-part1-touch"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"equip-part1-vive": {
|
||||||
|
"{97ced5e7-fc81-40f9-a9e8-f85b4b30f24c}": {
|
||||||
|
"tag": "equip-part1-vive"
|
||||||
|
}
|
||||||
|
},
|
||||||
"equip-part1": {
|
"equip-part1": {
|
||||||
"{d73822ca-0a34-4cf4-a530-3258ac459a14}": {
|
"{d73822ca-0a34-4cf4-a530-3258ac459a14}": {
|
||||||
"tag": "equip-part1"
|
"tag": "equip-part1"
|
||||||
},
|
},
|
||||||
"{97ced5e7-fc81-40f9-a9e8-f85b4b30f24c}": {
|
|
||||||
"tag": "equip-part1"
|
|
||||||
},
|
|
||||||
"{8572d991-5777-45df-97bf-7243d7b12f81}": {
|
"{8572d991-5777-45df-97bf-7243d7b12f81}": {
|
||||||
"tag": "equip-part1"
|
"tag": "equip-part1"
|
||||||
},
|
},
|
||||||
|
@ -102,16 +116,17 @@ TUTORIAL_TAG_TO_ENTITY_IDS_MAP = {
|
||||||
"equip-part2-vive": {
|
"equip-part2-vive": {
|
||||||
"{b5d17eda-90ab-40cf-b973-efcecb2e992e}": {
|
"{b5d17eda-90ab-40cf-b973-efcecb2e992e}": {
|
||||||
"tag": "equip-part2-vive"
|
"tag": "equip-part2-vive"
|
||||||
|
},
|
||||||
|
"{6307cd16-dd1d-4988-a339-578178436b45}": {
|
||||||
|
"tag": "equip-part2-vive"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"equip-part2-touch": {
|
"equip-part2-touch": {
|
||||||
"{69195139-e020-4739-bb2c-50faebc6860a}": {
|
"{69195139-e020-4739-bb2c-50faebc6860a}": {
|
||||||
"tag": "equip-part2-touch"
|
"tag": "equip-part2-touch"
|
||||||
}
|
},
|
||||||
},
|
"{9b0a99ae-221b-4e59-ba3c-d8e64a083774}": {
|
||||||
"equip-part2": {
|
"tag": "equip-part2-touch"
|
||||||
"{6307cd16-dd1d-4988-a339-578178436b45}": {
|
|
||||||
"tag": "equip-part2"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bothGrab": {
|
"bothGrab": {
|
||||||
|
|
Loading…
Reference in a new issue