overte/scripts/tutorials/makeAvatarClap.js

40 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2014-01-03 17:58:00 -08:00
//
2016-04-26 11:21:56 -07:00
// Created by James B. Pollack @imgntn on April 18, 2016.
// Copyright 2016 High Fidelity, Inc.
//
2014-01-03 17:58:00 -08:00
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
2014-01-03 17:58:00 -08:00
2016-04-26 11:21:56 -07:00
// An animation of the avatar clapping its hands while standing
2022-08-21 13:35:28 +02:00
var ANIM_URL = "https://content.overte.org/Developer/Tutorials/avatarAnimation/clap.fbx";
2016-04-26 11:21:56 -07:00
// overrideRoleAnimation only replaces a single animation at a time. the rest of the motion is driven normally
// @animationRole - name of animation
// @animationURL - url
// @playbackRate - frames per second
// @loopFlag - should loop
// @startFrame
// @endFrame
MyAvatar.overrideRoleAnimation("idleStand", ANIM_URL, 30, true, 0, 53);
//stop a a minute because your hands got tired.
Script.setTimeout(function(){
MyAvatar.restoreRoleAnimation("idleStand");
Script.stop();
},60000)
//or stop when the script is manually stopped
Script.scriptEnding.connect(function () {
MyAvatar.restoreRoleAnimation("idleStand");
2014-07-08 11:43:06 -07:00
});
2016-04-26 11:21:56 -07:00
//overRideAnimation replaces all animations, so you dont have to provide a role name
// @animationURL - url
// @playbackRate - frames per second
// @loopFlag - should loop
// @startFrame
// @endFrame
//MyAvatar.overrideAnimation(ANIM_URL, 30, true, 0, 53);