mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 19:10:01 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into dont-use-other-avatar-sounds
This commit is contained in:
commit
fb26e85faf
3 changed files with 34 additions and 9 deletions
|
@ -154,7 +154,7 @@ function entityIsGrabbedByOther(entityID) {
|
|||
}
|
||||
|
||||
|
||||
function MyController(hand, triggerAction) {
|
||||
function MyController(hand) {
|
||||
this.hand = hand;
|
||||
if (this.hand === RIGHT_HAND) {
|
||||
this.getHandPosition = MyAvatar.getRightPalmPosition;
|
||||
|
@ -166,7 +166,6 @@ function MyController(hand, triggerAction) {
|
|||
|
||||
var SPATIAL_CONTROLLERS_PER_PALM = 2;
|
||||
var TIP_CONTROLLER_OFFSET = 1;
|
||||
this.triggerAction = triggerAction;
|
||||
this.palm = SPATIAL_CONTROLLERS_PER_PALM * hand;
|
||||
this.tip = SPATIAL_CONTROLLERS_PER_PALM * hand + TIP_CONTROLLER_OFFSET;
|
||||
|
||||
|
@ -282,7 +281,6 @@ function MyController(hand, triggerAction) {
|
|||
// smooth out trigger value
|
||||
this.triggerValue = (this.triggerValue * TRIGGER_SMOOTH_RATIO) +
|
||||
(triggerValue * (1.0 - TRIGGER_SMOOTH_RATIO));
|
||||
|
||||
};
|
||||
|
||||
this.triggerSmoothedSqueezed = function() {
|
||||
|
@ -441,7 +439,7 @@ function MyController(hand, triggerAction) {
|
|||
var handRotation = Quat.multiply(MyAvatar.orientation, Controller.getPoseValue(controllerHandInput).rotation);
|
||||
var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity, ["position", "rotation",
|
||||
"gravity", "ignoreForCollisions",
|
||||
|
||||
"collisionsWillMove"]);
|
||||
var now = Date.now();
|
||||
|
||||
// add the action and initialize some variables
|
||||
|
@ -906,8 +904,8 @@ function MyController(hand, triggerAction) {
|
|||
};
|
||||
}
|
||||
|
||||
var rightController = new MyController(RIGHT_HAND, Controller.Standard.RT);
|
||||
var leftController = new MyController(LEFT_HAND, Controller.Standard.LT);
|
||||
var rightController = new MyController(RIGHT_HAND);
|
||||
var leftController = new MyController(LEFT_HAND);
|
||||
|
||||
var MAPPING_NAME = "com.highfidelity.handControllerGrab";
|
||||
|
||||
|
|
|
@ -58,15 +58,15 @@ namespace controller {
|
|||
// Left Analog stick
|
||||
LX = 0,
|
||||
LY,
|
||||
LZ,
|
||||
// Right Analog stick
|
||||
RX,
|
||||
RY,
|
||||
RZ,
|
||||
// Triggers
|
||||
LT,
|
||||
RT,
|
||||
NUM_STANDARD_AXES
|
||||
NUM_STANDARD_AXES,
|
||||
LZ = LT,
|
||||
RZ = RT
|
||||
};
|
||||
|
||||
// No correlation to SDL
|
||||
|
|
|
@ -18,6 +18,33 @@
|
|||
|
||||
#include "SDL2Manager.h"
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
static_assert(
|
||||
controller::A == SDL_CONTROLLER_BUTTON_A &&
|
||||
controller::B == SDL_CONTROLLER_BUTTON_B &&
|
||||
controller::X == SDL_CONTROLLER_BUTTON_X &&
|
||||
controller::Y == SDL_CONTROLLER_BUTTON_Y &&
|
||||
controller::BACK == SDL_CONTROLLER_BUTTON_BACK &&
|
||||
controller::GUIDE == SDL_CONTROLLER_BUTTON_GUIDE &&
|
||||
controller::START == SDL_CONTROLLER_BUTTON_START &&
|
||||
controller::LS == SDL_CONTROLLER_BUTTON_LEFTSTICK &&
|
||||
controller::RS == SDL_CONTROLLER_BUTTON_RIGHTSTICK &&
|
||||
controller::LB == SDL_CONTROLLER_BUTTON_LEFTSHOULDER &&
|
||||
controller::RB == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER &&
|
||||
controller::DU == SDL_CONTROLLER_BUTTON_DPAD_UP &&
|
||||
controller::DD == SDL_CONTROLLER_BUTTON_DPAD_DOWN &&
|
||||
controller::DL == SDL_CONTROLLER_BUTTON_DPAD_LEFT &&
|
||||
controller::DR == SDL_CONTROLLER_BUTTON_DPAD_RIGHT &&
|
||||
controller::LX == SDL_CONTROLLER_AXIS_LEFTX &&
|
||||
controller::LY == SDL_CONTROLLER_AXIS_LEFTY &&
|
||||
controller::RX == SDL_CONTROLLER_AXIS_RIGHTX &&
|
||||
controller::RY == SDL_CONTROLLER_AXIS_RIGHTY &&
|
||||
controller::LT == SDL_CONTROLLER_AXIS_TRIGGERLEFT &&
|
||||
controller::RT == SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
|
||||
"SDL2 equvalence: Enums and values from StandardControls.h are assumed to match enums from SDL_gamecontroller.h");
|
||||
#endif
|
||||
|
||||
|
||||
const QString SDL2Manager::NAME = "SDL2";
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
|
|
Loading…
Reference in a new issue