mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 01:10:44 +02:00
walk.js 1.25 comments removal
This commit is contained in:
parent
54608b9cb3
commit
10d981e6d5
4 changed files with 61 additions and 71 deletions
4
examples/html/jquery-2.1.4.min.js
vendored
4
examples/html/jquery-2.1.4.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -192,9 +192,9 @@ Motion = function() {
|
|||
|
||||
// Quat.safeEulerAngles(MyAvatar.orientation).y tends to repeat values between frames, so values are filtered
|
||||
var YAW_SMOOTHING = 22;
|
||||
this.yawFilter = filter.createAveragingFilter(YAW_SMOOTHING); //createButterworthFilter(); //
|
||||
this.deltaTimeFilter = filter.createAveragingFilter(YAW_SMOOTHING); //createButterworthFilter(); //
|
||||
this.yawDeltaAccelerationFilter = filter.createAveragingFilter(YAW_SMOOTHING); //createButterworthFilter(); //
|
||||
this.yawFilter = filter.createAveragingFilter(YAW_SMOOTHING);
|
||||
this.deltaTimeFilter = filter.createAveragingFilter(YAW_SMOOTHING);
|
||||
this.yawDeltaAccelerationFilter = filter.createAveragingFilter(YAW_SMOOTHING);
|
||||
|
||||
// assess locomotion state
|
||||
this.assess = function(deltaTime) {
|
||||
|
@ -298,7 +298,7 @@ Motion = function() {
|
|||
var surfaceMotion = isOnSurface && this.isMoving;
|
||||
var acceleratingAndAirborne = this.isAccelerating && !isOnSurface;
|
||||
var goingTooFastToWalk = !this.isDecelerating && this.isFlyingSpeed;
|
||||
var movingDirectlyUpOrDown = (this.direction === UP || this.direction === DOWN) // && lateralVelocity < MOVE_THRESHOLD;
|
||||
var movingDirectlyUpOrDown = (this.direction === UP || this.direction === DOWN)
|
||||
var maybeBouncing = Math.abs(this.acceleration.y > BOUNCE_ACCELERATION_THRESHOLD) ? true : false;
|
||||
|
||||
// we now have enough information to set the appropriate locomotion mode
|
||||
|
@ -339,8 +339,7 @@ Motion = function() {
|
|||
|
||||
case AIR_MOTION:
|
||||
var airMotionToSurfaceMotion = (surfaceMotion || aboutToLand) && !movingDirectlyUpOrDown;
|
||||
var airMotionToStatic = !this.isMoving && this.direction === this.lastDirection; //||
|
||||
//this.isDeceleratingFast || isOnSurface;
|
||||
var airMotionToStatic = !this.isMoving && this.direction === this.lastDirection;
|
||||
if (airMotionToSurfaceMotion){
|
||||
this.nextState = SURFACE_MOTION;
|
||||
} else if (airMotionToStatic) {
|
||||
|
@ -621,7 +620,7 @@ TransitionParameters = function() {
|
|||
|
||||
// constructor for animation Transition
|
||||
Transition = function(nextAnimation, lastAnimation, lastTransition, playTransitionReachPoses) {
|
||||
//if (isDefined(lastAnimation) && isDefined(nextAnimation)) walkTools.toLog(lastAnimation.name + ' to '+ nextAnimation.name + ': started');
|
||||
|
||||
if (playTransitionReachPoses === undefined) {
|
||||
playTransitionReachPoses = true;
|
||||
}
|
||||
|
@ -721,7 +720,6 @@ Transition = function(nextAnimation, lastAnimation, lastTransition, playTransiti
|
|||
this.lastTransition.incrementRecursion();
|
||||
}
|
||||
|
||||
|
||||
// end of transition initialisation. begin Transition public methods
|
||||
|
||||
// keep up the pace for the frequency time wheel for the last animation
|
||||
|
@ -794,7 +792,6 @@ Transition = function(nextAnimation, lastAnimation, lastTransition, playTransiti
|
|||
|
||||
// update transition progress
|
||||
this.filteredProgress = filter.bezier(this.progress, this.parameters.easingLower, this.parameters.easingUpper);
|
||||
//if (this.progress >= 1) walkTools.toLog(this.lastAnimation.name + ' to '+ this.nextAnimation.name + ': done');
|
||||
return this.progress >= 1 ? TRANSITION_COMPLETE : false;
|
||||
};
|
||||
|
||||
|
|
|
@ -118,7 +118,6 @@ WaveSynth = function(waveShape, numHarmonics, smoothing) {
|
|||
HarmonicsFilter = function(magnitudes, phaseAngles) {
|
||||
this.magnitudes = magnitudes;
|
||||
this.phaseAngles = phaseAngles;
|
||||
|
||||
this.calculate = function(twoPiFT) {
|
||||
var harmonics = 0;
|
||||
var numHarmonics = magnitudes.length;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// version 1.25
|
||||
//
|
||||
// Created by David Wooldridge, June 2015
|
||||
// Copyright © 2014 - 2015 High Fidelity, Inc.
|
||||
// Copyright © 2014 - 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Animates an avatar using procedural animation techniques.
|
||||
//
|
||||
|
@ -326,8 +326,9 @@ function determineStride() {
|
|||
motion.advanceFrequencyTimeWheel(wheelAdvance);
|
||||
|
||||
// walking? then see if it's a good time to measure the stride length (needs to be at least 97% of max walking speed)
|
||||
var JUST_UNDER_ONE = 0.97;
|
||||
if (avatar.currentAnimation === avatar.selectedWalkBlend &&
|
||||
(Vec3.length(motion.velocity) / MAX_WALK_SPEED > 0.97)) {
|
||||
(Vec3.length(motion.velocity) / MAX_WALK_SPEED > JUST_UNDER_ONE)) {
|
||||
|
||||
var strideMaxAt = avatar.currentAnimation.calibration.strideMaxAt;
|
||||
var tolerance = 1.0;
|
||||
|
@ -362,7 +363,6 @@ function updateTransitions() {
|
|||
}
|
||||
}
|
||||
}
|
||||
// update the Transition progress
|
||||
if (motion.currentTransition.updateProgress() === TRANSITION_COMPLETE) {
|
||||
motion.currentTransition = nullTransition;
|
||||
}
|
||||
|
@ -432,7 +432,6 @@ function renderMotion() {
|
|||
// factor any leaning into the hips offset
|
||||
hipsTranslations.z += avatar.calibration.hipsToFeet * Math.sin(filter.degToRad(leanPitch));
|
||||
hipsTranslations.x += avatar.calibration.hipsToFeet * Math.sin(filter.degToRad(leanRoll));
|
||||
|
||||
// ensure skeleton offsets are within the 1m limit
|
||||
hipsTranslations.x = hipsTranslations.x > 1 ? 1 : hipsTranslations.x;
|
||||
hipsTranslations.x = hipsTranslations.x < -1 ? -1 : hipsTranslations.x;
|
||||
|
@ -470,7 +469,7 @@ function renderMotion() {
|
|||
var joint = walkAssets.animationReference.joints[jointName];
|
||||
var jointRotations = undefined;
|
||||
|
||||
// ignore arms / head rotations if options are selected
|
||||
// ignore arms / head rotations if avatar options are selected
|
||||
if (avatar.armsFree && (joint.IKChain === "LeftArm" || joint.IKChain === "RightArm")) {
|
||||
continue;
|
||||
}
|
||||
|
@ -495,7 +494,6 @@ function renderMotion() {
|
|||
jointRotations.x += leanPitch;
|
||||
jointRotations.z += leanRoll;
|
||||
}
|
||||
|
||||
// apply rotations
|
||||
MyAvatar.setJointData(jointName, Quat.fromVec3Degrees(jointRotations));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue