From 7a2a391852ee613e149c06c39be74454dced6db3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 1 May 2015 11:53:20 -0700 Subject: [PATCH] add script to move joints for av rate testing --- examples/utilities/diagnostics/moveJoints.js | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/utilities/diagnostics/moveJoints.js diff --git a/examples/utilities/diagnostics/moveJoints.js b/examples/utilities/diagnostics/moveJoints.js new file mode 100644 index 0000000000..e20250d4e0 --- /dev/null +++ b/examples/utilities/diagnostics/moveJoints.js @@ -0,0 +1,29 @@ +// +// moveJoints.js +// examples/utilities/diagnostics +// +// Created by Stephen Birarda on 05/01/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 +// + +Script.include("../../libraries/globals.js"); + +var testAnimation = HIFI_PUBLIC_BUCKET + "ozan/animations/forStephen/sniperJump.fbx"; + +var FRAME_RATE = 24.0; // frames per second +var isAnimating = false; + +Controller.keyPressEvent.connect(function(event) { + if (event.text == "SHIFT") { + if (isAnimating) { + isAnimating = false; + MyAvatar.stopAnimation(testAnimation); + } else { + isAnimating = true; + MyAvatar.startAnimation(testAnimation, FRAME_RATE, 1.0, true, false); + } + } +});