mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 04:03:59 +02:00
guitar is now auto-attached
This commit is contained in:
parent
95f6bcbbd6
commit
4a1672957e
1 changed files with 10 additions and 1 deletions
|
@ -25,6 +25,9 @@ function vMinus(a, b) {
|
|||
return rval;
|
||||
}
|
||||
|
||||
// The model file to be used for the guitar
|
||||
var guitarModel = "https://s3-us-west-1.amazonaws.com/highfidelity-public/models/attachments/guitar.fst";
|
||||
|
||||
// Load sounds that will be played
|
||||
|
||||
var chords = new Array();
|
||||
|
@ -57,6 +60,8 @@ var lastPosition = { x: 0.0,
|
|||
var soundPlaying = false;
|
||||
var selectorPressed = false;
|
||||
|
||||
MyAvatar.attach(guitarModel, "Hips", {x: -0.0, y: -0.0, z: 0.0}, Quat.fromPitchYawRollDegrees(0, 0, 0), 1.0);
|
||||
|
||||
function checkHands(deltaTime) {
|
||||
for (var palm = 0; palm < 2; palm++) {
|
||||
var palmVelocity = Controller.getSpatialControlVelocity(palm * 2 + 1);
|
||||
|
@ -117,5 +122,9 @@ function checkHands(deltaTime) {
|
|||
}
|
||||
}
|
||||
|
||||
function scriptEnding() {
|
||||
MyAvatar.detachOne(guitarModel);
|
||||
}
|
||||
// Connect a call back that happens every frame
|
||||
Script.update.connect(checkHands);
|
||||
Script.update.connect(checkHands);
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
|
|
Loading…
Reference in a new issue