mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 12:23:24 +02:00
making requested changes
This commit is contained in:
parent
416a47cfc7
commit
8779d52ad3
6 changed files with 34 additions and 20 deletions
|
@ -246,7 +246,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
Pointers.getPrevPickResult(_this.leftHudPointer),
|
||||
Pointers.getPrevPickResult(_this.rightHudPointer)
|
||||
];
|
||||
var mouseRayPick = RayPick.getPrevRayPickResult(_this.mouseRayPick);
|
||||
var mouseRayPick = Pointers.getPrevPickResult(_this.mouseRayPick);
|
||||
// if the pickray hit something very nearby, put it into the nearby entities list
|
||||
for (h = LEFT_HAND; h <= RIGHT_HAND; h++) {
|
||||
|
||||
|
@ -435,7 +435,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
distanceScaleEnd: true,
|
||||
hand: RIGHT_HAND
|
||||
});
|
||||
this.mouseRayPick = RayPick.createRayPick({
|
||||
this.mouseRayPick = Pointers.createPointer(PickType.Ray, {
|
||||
joint: "Mouse",
|
||||
filter: Picks.PICK_ENTITIES | Picks.PICK_OVERLAYS,
|
||||
enabled: true
|
||||
|
@ -472,7 +472,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
this.cleanup = function () {
|
||||
Script.update.disconnect(_this.update);
|
||||
Controller.disableMapping(MAPPING_NAME);
|
||||
this.pointerManager.removePointers();
|
||||
_this.pointerManager.removePointers();
|
||||
Pointers.removePointer(this.mouseRayPick);
|
||||
};
|
||||
}
|
||||
function mouseReleaseOnOverlay(overlayID, event) {
|
||||
|
@ -480,7 +481,22 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
Messages.sendLocalMessage("home", overlayID);
|
||||
}
|
||||
}
|
||||
|
||||
var HAPTIC_STYLUS_STRENGTH = 1.0;
|
||||
var HAPTIC_STYLUS_DURATION = 20.0;
|
||||
function mousePress(id, event) {
|
||||
if (HMD.active) {
|
||||
var runningPlugins = controllerDispatcher.runningPluginNames;
|
||||
if (event.id === controllerDispatcher.leftPointer && event.button === "Primary" && runningPlugins.LeftWebSurfaceLaserInput) {
|
||||
Controller.triggerHapticPulse(HAPTIC_STYLUS_STRENGTH, HAPTIC_STYLUS_DURATION, LEFT_HAND);
|
||||
} else if (event.id === controllerDispatcher.rightPointer && event.button === "Primary" && runningPlugins.RightWebSurfaceLaserInput) {
|
||||
Controller.triggerHapticPulse(HAPTIC_STYLUS_STRENGTH, HAPTIC_STYLUS_DURATION, RIGHT_HAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
Overlays.mouseReleaseOnOverlay.connect(mouseReleaseOnOverlay);
|
||||
Overlays.mousePressOnOverlay.connect(mousePress);
|
||||
Entities.mousePressOnEntity.connect(mousePress);
|
||||
var controllerDispatcher = new ControllerDispatcher();
|
||||
Messages.subscribe('Hifi-Hand-RayPick-Blacklist');
|
||||
Messages.messageReceived.connect(controllerDispatcher.handleHandMessage);
|
||||
|
|
|
@ -539,8 +539,6 @@ Script.include("/~/system/libraries/Xform.js");
|
|||
enableDispatcherModule("RightFarActionGrabEntity", rightFarActionGrabEntity);
|
||||
|
||||
function cleanup() {
|
||||
leftFarActionGrabEntity.cleanup();
|
||||
rightFarActionGrabEntity.cleanup();
|
||||
disableDispatcherModule("LeftFarActionGrabEntity");
|
||||
disableDispatcherModule("RightFarActionGrabEntity");
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ Script.include("/~/system/libraries/utils.js");
|
|||
}
|
||||
}
|
||||
|
||||
var overlayLaser = getEnabledModuleByName(this.hand === RIGHT_HAND ? "RightOverlayLaserInput" : "LeftOverlayLaserInput");
|
||||
var overlayLaser = getEnabledModuleByName(this.hand === RIGHT_HAND ? "RightWebSurfaceLaserInput" : "LeftWebSurfaceLaserInput");
|
||||
if (overlayLaser) {
|
||||
var overlayLaserReady = overlayLaser.isReady(controllerData);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
};
|
||||
}
|
||||
|
||||
function TabletStylusInput(hand) {
|
||||
function StylusInput(hand) {
|
||||
this.hand = hand;
|
||||
|
||||
this.parameters = makeDispatcherModuleParameters(
|
||||
|
@ -71,8 +71,8 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
};
|
||||
|
||||
this.overlayLaserActive = function(controllerData) {
|
||||
var rightOverlayLaserModule = getEnabledModuleByName("RightOverlayLaserInput");
|
||||
var leftOverlayLaserModule = getEnabledModuleByName("LeftOverlayLaserInput");
|
||||
var rightOverlayLaserModule = getEnabledModuleByName("RightWebSurfaceLaserInput");
|
||||
var leftOverlayLaserModule = getEnabledModuleByName("LeftWebSurfaceLaserInput");
|
||||
var rightModuleRunning = rightOverlayLaserModule ? rightOverlayLaserModule.isReady(controllerData).active : false;
|
||||
var leftModuleRunning = leftOverlayLaserModule ? leftOverlayLaserModule.isReady(controllerData).active : false;
|
||||
return leftModuleRunning || rightModuleRunning;
|
||||
|
@ -185,15 +185,15 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
}
|
||||
}
|
||||
|
||||
var leftTabletStylusInput = new TabletStylusInput(LEFT_HAND);
|
||||
var rightTabletStylusInput = new TabletStylusInput(RIGHT_HAND);
|
||||
var leftTabletStylusInput = new StylusInput(LEFT_HAND);
|
||||
var rightTabletStylusInput = new StylusInput(RIGHT_HAND);
|
||||
|
||||
enableDispatcherModule("LeftTabletStylusInput", leftTabletStylusInput);
|
||||
enableDispatcherModule("RightTabletStylusInput", rightTabletStylusInput);
|
||||
|
||||
Overlays.hoverEnterOverlay.connect(mouseHoverEnter);
|
||||
Overlays.hoverLeaveOverlay.connect(mouseHoverLeave);
|
||||
Overlays.mousePressOnOverlay.connect(mousePress);
|
||||
Overlays.mousePressOnOverlay.connect(mousePress);
|
||||
|
||||
this.cleanup = function () {
|
||||
leftTabletStylusInput.cleanup();
|
|
@ -16,7 +16,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
Script.include("/~/system/libraries/controllers.js");
|
||||
|
||||
(function() {
|
||||
function OverlayLaserInput(hand) {
|
||||
function WebSurfaceLaserInput(hand) {
|
||||
this.hand = hand;
|
||||
this.running = false;
|
||||
|
||||
|
@ -99,15 +99,15 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
};
|
||||
}
|
||||
|
||||
var leftOverlayLaserInput = new OverlayLaserInput(LEFT_HAND);
|
||||
var rightOverlayLaserInput = new OverlayLaserInput(RIGHT_HAND);
|
||||
var leftOverlayLaserInput = new WebSurfaceLaserInput(LEFT_HAND);
|
||||
var rightOverlayLaserInput = new WebSurfaceLaserInput(RIGHT_HAND);
|
||||
|
||||
enableDispatcherModule("LeftOverlayLaserInput", leftOverlayLaserInput);
|
||||
enableDispatcherModule("RightOverlayLaserInput", rightOverlayLaserInput);
|
||||
enableDispatcherModule("LeftWebSurfaceLaserInput", leftOverlayLaserInput);
|
||||
enableDispatcherModule("RightWebSurfaceLaserInput", rightOverlayLaserInput);
|
||||
|
||||
function cleanup() {
|
||||
disableDispatcherModule("LeftOverlayLaserInput");
|
||||
disableDispatcherModule("RightOverlayLaserInput");
|
||||
disableDispatcherModule("LeftWebSurfaceLaserInput");
|
||||
disableDispatcherModule("RightWebSurfaceLaserInput");
|
||||
}
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
}());
|
||||
|
|
|
@ -19,7 +19,7 @@ var CONTOLLER_SCRIPTS = [
|
|||
"controllerModules/nearParentGrabOverlay.js",
|
||||
"controllerModules/nearActionGrabEntity.js",
|
||||
"controllerModules/farActionGrabEntity.js",
|
||||
"controllerModules/tabletStylusInput.js",
|
||||
"controllerModules/stylusInput.js",
|
||||
"controllerModules/equipEntity.js",
|
||||
"controllerModules/nearTrigger.js",
|
||||
"controllerModules/webSurfaceLaserInput.js",
|
||||
|
|
Loading…
Reference in a new issue