mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Merge pull request #6298 from samcake/controllers
Controllers : Removing dead files
This commit is contained in:
commit
439bdbc0e4
4 changed files with 0 additions and 204 deletions
|
@ -1,101 +0,0 @@
|
|||
|
||||
//
|
||||
// controllerScriptingExamples.js
|
||||
// examples
|
||||
//
|
||||
// Created by Sam Gondelman on 6/2/15
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
// Assumes you only have the default keyboard connected
|
||||
|
||||
/*myFirstMapping = function() {
|
||||
return {
|
||||
"name": "example",
|
||||
"channels": [
|
||||
{ "from": "Keyboard.W", "to": "Actions.LONGITUDINAL_FORWARD" },
|
||||
{ "from": "Keyboard.S", "to": "Actions.LONGITUDINAL_BACKWARD" },
|
||||
|
||||
{ "from": "Keyboard.Left", "to": "Actions.LATERAL_LEFT" },
|
||||
{ "from": "Keyboard.Right", "to": "Actions.LATERAL_RIGHT" },
|
||||
|
||||
{ "from": "Keyboard.A", "to": "Actions.YAW_LEFT" },
|
||||
{ "from": "Keyboard.D", "to": "Actions.YAW_RIGHT" },
|
||||
|
||||
{ "from": "Keyboard.C", "to": "Actions.VERTICAL_DOWN" },
|
||||
{ "from": "Keyboard.E", "to": "Actions.VERTICAL_UP" },
|
||||
{
|
||||
"from": "Standard.LX",
|
||||
"filters": [ {
|
||||
"type": "scale",
|
||||
"params": [2.0],
|
||||
}
|
||||
],
|
||||
"to": "Actions.LATERAL_LEFT",
|
||||
}, {
|
||||
"from": "Keyboard.B",
|
||||
"to": "Actions.Yaw"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
*/
|
||||
mySecondMapping = function() {
|
||||
return {
|
||||
"name": "example2",
|
||||
"channels": [
|
||||
{ "from": "Standard.LY", "to": "Actions.TranslateZ" },
|
||||
{ "from": "Standard.LX", "to": "Actions.Yaw" },
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
//Script.include('mapping-test0.json');
|
||||
/*var myFirstMappingJSON = myFirstMapping();
|
||||
print('myFirstMappingJSON' + JSON.stringify(myFirstMappingJSON));
|
||||
|
||||
var mapping = Controller.parseMapping(JSON.stringify(myFirstMappingJSON));
|
||||
|
||||
|
||||
Controller.enableMapping("example3");
|
||||
|
||||
var mySecondMappingJSON = mySecondMapping();
|
||||
print('mySecondMappingJSON' + JSON.stringify(mySecondMappingJSON));
|
||||
|
||||
var mapping2 = Controller.parseMapping(JSON.stringify(mySecondMappingJSON));
|
||||
mapping2.enable();
|
||||
|
||||
Controller.enableMapping("example2");
|
||||
*/
|
||||
var mapping3 = Controller.loadMapping(Script.resolvePath("example3.json"));
|
||||
Controller.enableMapping("example3");
|
||||
|
||||
/*
|
||||
Object.keys(Controller.Standard).forEach(function (input) {
|
||||
print("Controller.Standard." + input + ":" + Controller.Standard[input]);
|
||||
});
|
||||
|
||||
Object.keys(Controller.Hardware).forEach(function (deviceName) {
|
||||
Object.keys(Controller.Hardware[deviceName]).forEach(function (input) {
|
||||
print("Controller.Hardware." + deviceName + "." + input + ":" + Controller.Hardware[deviceName][input]);
|
||||
});
|
||||
});
|
||||
|
||||
Object.keys(Controller.Actions).forEach(function (actionName) {
|
||||
print("Controller.Actions." + actionName + ":" + Controller.Actions[actionName]);
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
Controller.hardwareChanged.connect(function () {
|
||||
print("hardwareChanged ---------------------------------------------------");
|
||||
Object.keys(Controller.Hardware).forEach(function (deviceName) {
|
||||
Object.keys(Controller.Hardware[deviceName]).forEach(function (input) {
|
||||
print("Controller.Hardware." + deviceName + "." + input + ":" + Controller.Hardware[deviceName][input]);
|
||||
});
|
||||
});
|
||||
print("-------------------------------------------------------------------");
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"name": "Full Mapping config including the standard hydra and gamepad and one more thing",
|
||||
"mappings": [
|
||||
{ "src": "./mapping-hydra.json" },
|
||||
{ "src": "./mapping-xbox.json" },
|
||||
{
|
||||
"name": "example mapping for standard to js function",
|
||||
"channels": [ {
|
||||
"from": "Standard.B",
|
||||
"to": {
|
||||
"type":"js",
|
||||
"function": "function(value){ print(\"Standard.B = \" + value );}"
|
||||
}
|
||||
}, {
|
||||
"from": "Standard.B",
|
||||
"to": {
|
||||
"type":"js",
|
||||
"src": "http://www.theNextBigThing.com/hifiInputSignalHandler.js"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
"name": "example mapping from Standard to actions",
|
||||
"channels": [ {
|
||||
"from": "Standard.LY",
|
||||
"filters": [ {
|
||||
"type": "clamp",
|
||||
"min": 0,
|
||||
"max": 1
|
||||
}
|
||||
],
|
||||
"to": "Actions.Forward"
|
||||
}, {
|
||||
"from": "Standard.LY",
|
||||
"filters": [ {
|
||||
"type": "clamp",
|
||||
"min": -1,
|
||||
"max": 0
|
||||
}, {
|
||||
"type": "invert"
|
||||
}
|
||||
],
|
||||
"to": "Actions.Backward"
|
||||
}, {
|
||||
"from": "Standard.LX",
|
||||
"filters": [ {
|
||||
"type": "scale",
|
||||
"scale": 2.0
|
||||
}
|
||||
],
|
||||
"to": "Actions.Yaw"
|
||||
}, {
|
||||
"from": "Standard.A",
|
||||
"to": "Actions.Action0"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
{
|
||||
"name": "Standard to Action",
|
||||
"channels": [
|
||||
{ "from": "Standard.LY", "to": "Actions.TranslateZ" },
|
||||
{ "from": "Standard.LX", "to": "Actions.TranslateX" },
|
||||
{ "from": "Standard.RX", "to": "Actions.Yaw" },
|
||||
{ "from": "Standard.RY", "to": "Actions.Pitch" },
|
||||
{
|
||||
"from": "Standard.DU",
|
||||
"to": "Actions.LONGITUDINAL_FORWARD",
|
||||
"filters": [ { "type": "scale", "scale": 0.5 } ]
|
||||
},
|
||||
{
|
||||
"from": "Standard.DD",
|
||||
"to": "Actions.LONGITUDINAL_BACKWARD",
|
||||
"filters": [ { "type": "scale", "scale": 0.5 } ]
|
||||
},
|
||||
{
|
||||
"from": "Standard.DR",
|
||||
"to": "Actions.LATERAL_RIGHT",
|
||||
"filters": [ { "type": "scale", "scale": 0.5 } ]
|
||||
},
|
||||
{
|
||||
"from": "Standard.DL",
|
||||
"to": "Actions.LATERAL_LEFT",
|
||||
"filters": [ { "type": "scale", "scale": 0.5 } ]
|
||||
},
|
||||
{ "from": "Standard.Y", "to": "Actions.VERTICAL_UP" },
|
||||
{ "from": "Standard.X", "to": "Actions.VERTICAL_DOWN" },
|
||||
{
|
||||
"from": "Standard.RT",
|
||||
"to": "Actions.BOOM_IN",
|
||||
"filters": [ { "type": "scale", "scale": 0.1 } ]
|
||||
},
|
||||
{
|
||||
"from": "Standard.LT",
|
||||
"to": "Actions.BOOM_OUT",
|
||||
"filters": [ { "type": "scale", "scale": 0.1 } ]
|
||||
},
|
||||
{ "from": "Standard.LeftHand", "to": "Actions.LEFT_HAND" },
|
||||
{ "from": "Standard.RightHand", "to": "Actions.RIGHT_HAND" }
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue