mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 08:37:19 +02:00
Update controllers to include tips
This commit is contained in:
parent
7f91491f04
commit
55586ccedb
2 changed files with 72 additions and 16 deletions
|
@ -1,6 +1,7 @@
|
||||||
var DEBUG = false;
|
var DEBUG = false;
|
||||||
var VISIBLE_BY_DEFAULT = false;
|
var VISIBLE_BY_DEFAULT = false;
|
||||||
var PARENT_ID = MyAvatar.sessionUUID;
|
//var PARENT_ID = MyAvatar.sessionUUID;
|
||||||
|
var PARENT_ID = "{00000000-0000-0000-0000-000000000001}";
|
||||||
|
|
||||||
createControllerDisplay = function(config) {
|
createControllerDisplay = function(config) {
|
||||||
var controllerDisplay = {
|
var controllerDisplay = {
|
||||||
|
@ -166,7 +167,7 @@ createControllerDisplay = function(config) {
|
||||||
|
|
||||||
controllerDisplay.parts[partName] = controller.parts[partName];
|
controllerDisplay.parts[partName] = controller.parts[partName];
|
||||||
|
|
||||||
var overlayID = Overlays.addOverlay("model", {
|
var properties = {
|
||||||
url: part.modelURL,
|
url: part.modelURL,
|
||||||
localPosition: partPosition,
|
localPosition: partPosition,
|
||||||
localRotation: innerRotation,
|
localRotation: innerRotation,
|
||||||
|
@ -174,7 +175,15 @@ createControllerDisplay = function(config) {
|
||||||
parentJointIndex: controller.jointIndex,
|
parentJointIndex: controller.jointIndex,
|
||||||
ignoreRayIntersection: true,
|
ignoreRayIntersection: true,
|
||||||
//visible: false
|
//visible: false
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (part.defaultTextureLayer) {
|
||||||
|
var textures = {};
|
||||||
|
textures[part.textureName] = part.textureLayers[part.defaultTextureLayer].defaultTextureURL;
|
||||||
|
properties['textures'] = textures;
|
||||||
|
}
|
||||||
|
|
||||||
|
var overlayID = Overlays.addOverlay("model", properties);
|
||||||
|
|
||||||
if (part.type == "rotational") {
|
if (part.type == "rotational") {
|
||||||
var range = part.maxValue - part.minValue;
|
var range = part.maxValue - part.minValue;
|
||||||
|
@ -234,13 +243,6 @@ createControllerDisplay = function(config) {
|
||||||
mapping.from([yinput]).peek().invert().to(function(value) {
|
mapping.from([yinput]).peek().invert().to(function(value) {
|
||||||
//print("Y", value);
|
//print("Y", value);
|
||||||
});
|
});
|
||||||
if (part.defaultTextureURL) {
|
|
||||||
var textures = {};
|
|
||||||
textures[part.textureName] = part.defaultTextureURL;
|
|
||||||
Overlays.editOverlay(overlayID, {
|
|
||||||
textures: textures
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (part.type == "static") {
|
} else if (part.type == "static") {
|
||||||
} else {
|
} else {
|
||||||
print("TYPE NOT SUPPORTED: ", part.type);
|
print("TYPE NOT SUPPORTED: ", part.type);
|
||||||
|
|
|
@ -43,6 +43,7 @@ var viveNaturalPosition = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var viveModelURL = "https://hifi-public.s3.amazonaws.com/huffman/controllers/vive_body.fbx";
|
var viveModelURL = "https://hifi-public.s3.amazonaws.com/huffman/controllers/vive_body.fbx";
|
||||||
|
var viveTipsModelURL = "https://hifi-content.s3.amazonaws.com/DomainContent/Tutorial/Models/vive_tips.fbx"
|
||||||
|
|
||||||
VIVE_CONTROLLER_CONFIGURATION = {
|
VIVE_CONTROLLER_CONFIGURATION = {
|
||||||
name: "Vive",
|
name: "Vive",
|
||||||
|
@ -57,6 +58,33 @@ VIVE_CONTROLLER_CONFIGURATION = {
|
||||||
dimensions: viveNaturalDimensions,
|
dimensions: viveNaturalDimensions,
|
||||||
|
|
||||||
parts: {
|
parts: {
|
||||||
|
tips: {
|
||||||
|
type: "static",
|
||||||
|
modelURL: viveTipsModelURL,
|
||||||
|
naturalPosition: {"x":-0.004377640783786774,"y":-0.034371938556432724,"z":0.06769277155399323},
|
||||||
|
|
||||||
|
textureName: "Tex.Blank",
|
||||||
|
|
||||||
|
defaultTextureLayer: "trigger",
|
||||||
|
textureLayers: {
|
||||||
|
blank: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Blank.png",
|
||||||
|
},
|
||||||
|
trigger: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Trigger.png",
|
||||||
|
},
|
||||||
|
arrows: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Rotate.png",
|
||||||
|
},
|
||||||
|
grip: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Grip.png",
|
||||||
|
},
|
||||||
|
teleport: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Teleport.png",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// The touchpad type draws a dot indicating the current touch/thumb position
|
// The touchpad type draws a dot indicating the current touch/thumb position
|
||||||
// and swaps in textures based on the thumb position.
|
// and swaps in textures based on the thumb position.
|
||||||
touchpad: {
|
touchpad: {
|
||||||
|
@ -70,10 +98,10 @@ VIVE_CONTROLLER_CONFIGURATION = {
|
||||||
maxValue: 1.0,
|
maxValue: 1.0,
|
||||||
minPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
minPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
||||||
maxPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
maxPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
||||||
textureName: "Tex.touchpad-blank",
|
disable_textureName: "Tex.touchpad-blank",
|
||||||
|
|
||||||
defaultTextureLayer: "blank",
|
disable_defaultTextureLayer: "blank",
|
||||||
textureLayers: {
|
disable_textureLayers: {
|
||||||
blank: {
|
blank: {
|
||||||
defaultTextureURL: "https://hifi-public.s3.amazonaws.com/huffman/controllers/vive_trackpad.fbx/Touchpad.fbm/touchpad-blank.jpg",
|
defaultTextureURL: "https://hifi-public.s3.amazonaws.com/huffman/controllers/vive_trackpad.fbx/Touchpad.fbm/touchpad-blank.jpg",
|
||||||
},
|
},
|
||||||
|
@ -211,6 +239,32 @@ VIVE_CONTROLLER_CONFIGURATION = {
|
||||||
},
|
},
|
||||||
|
|
||||||
parts: {
|
parts: {
|
||||||
|
tips: {
|
||||||
|
type: "static",
|
||||||
|
modelURL: viveTipsModelURL,
|
||||||
|
naturalPosition: {"x":-0.004377640783786774,"y":-0.034371938556432724,"z":0.06769277155399323},
|
||||||
|
|
||||||
|
textureName: "Tex.Blank",
|
||||||
|
|
||||||
|
defaultTextureLayer: "trigger",
|
||||||
|
textureLayers: {
|
||||||
|
blank: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Blank.png",
|
||||||
|
},
|
||||||
|
trigger: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Trigger.png",
|
||||||
|
},
|
||||||
|
arrows: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Rotate.png",
|
||||||
|
},
|
||||||
|
grip: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Grip.png",
|
||||||
|
},
|
||||||
|
teleport: {
|
||||||
|
defaultTextureURL: viveTipsModelURL + "/Controller-Tips.fbm/Teleport.png",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// The touchpad type draws a dot indicating the current touch/thumb position
|
// The touchpad type draws a dot indicating the current touch/thumb position
|
||||||
// and swaps in textures based on the thumb position.
|
// and swaps in textures based on the thumb position.
|
||||||
|
@ -225,10 +279,10 @@ VIVE_CONTROLLER_CONFIGURATION = {
|
||||||
maxValue: 1.0,
|
maxValue: 1.0,
|
||||||
minPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
minPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
||||||
maxPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
maxPosition: { x: -0.035, y: 0.004, z: -0.005 },
|
||||||
textureName: "Tex.touchpad-blank",
|
disable_textureName: "Tex.touchpad-blank",
|
||||||
|
|
||||||
defaultTextureLayer: "blank",
|
disable_defaultTextureLayer: "blank",
|
||||||
textureLayers: {
|
disable_textureLayers: {
|
||||||
blank: {
|
blank: {
|
||||||
defaultTextureURL: "https://hifi-public.s3.amazonaws.com/huffman/controllers/vive_trackpad.fbx/Touchpad.fbm/touchpad-blank.jpg",
|
defaultTextureURL: "https://hifi-public.s3.amazonaws.com/huffman/controllers/vive_trackpad.fbx/Touchpad.fbm/touchpad-blank.jpg",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue