mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 10:59:37 +02:00
Merge pull request #4409 from PhilipRosedale/master
Only catch moving objects with ToyBall.js
This commit is contained in:
commit
50ba8ecc9d
1 changed files with 25 additions and 22 deletions
|
@ -48,7 +48,7 @@ var rightHandEntity = false;
|
|||
var newSound = SoundCache.getSound("https://dl.dropboxusercontent.com/u/1864924/hifi-sounds/throw.raw");
|
||||
var catchSound = SoundCache.getSound("https://dl.dropboxusercontent.com/u/1864924/hifi-sounds/catch.raw");
|
||||
var throwSound = SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/Switches%20and%20sliders/slider%20-%20whoosh1.raw");
|
||||
var targetRadius = 1.0;
|
||||
var targetRadius = 0.25;
|
||||
|
||||
|
||||
var wantDebugging = false;
|
||||
|
@ -120,8 +120,10 @@ function checkControllerSide(whichSide) {
|
|||
var closestEntity = Entities.findClosestEntity(palmPosition, targetRadius);
|
||||
|
||||
if (closestEntity.isKnownID) {
|
||||
var foundProperties = Entities.getEntityProperties(closestEntity);
|
||||
if (Vec3.length(foundProperties.velocity) > 0.0) {
|
||||
|
||||
debugPrint(handMessage + " HAND- CAUGHT SOMETHING!!");
|
||||
debugPrint(handMessage + " - Catching a moving object!");
|
||||
|
||||
if (whichSide == LEFT_PALM) {
|
||||
leftBallAlreadyInHand = true;
|
||||
|
@ -146,6 +148,7 @@ function checkControllerSide(whichSide) {
|
|||
return; // exit early
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// change ball color logic...
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue