mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 14:42:09 +02:00
Added laserPointer script
This commit is contained in:
parent
35caef1882
commit
91e980f96e
1 changed files with 23 additions and 0 deletions
23
examples/laserPointer.js
Normal file
23
examples/laserPointer.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// laserPointer.js
|
||||
// examples
|
||||
//
|
||||
// Created by Clément Brisset on 7/18/14.
|
||||
// Copyright 2014 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
|
||||
//
|
||||
|
||||
var LEFT = 0;
|
||||
var RIGHT = 1;
|
||||
var LEFT_HAND_FLAG = 1;
|
||||
var RIGHT_HAND_FLAG = 2;
|
||||
|
||||
function update() {
|
||||
var state = ((Controller.getTriggerValue(LEFT) > 0.9) ? LEFT_HAND_FLAG : 0) +
|
||||
((Controller.getTriggerValue(RIGHT) > 0.9) ? RIGHT_HAND_FLAG : 0);
|
||||
MyAvatar.setHandState(state);
|
||||
}
|
||||
|
||||
Script.update.connect(update);
|
Loading…
Reference in a new issue