[Opensim-dev] Walk animation doesn't stop
Oren Hurvitz
orenh at kitely.com
Thu Apr 12 14:44:26 UTC 2012
I found the problem. The walking script is notified whenever the user presses
or releases a movement key, e.g. the Forward key. When that happens, the
script checks which movement animation the avatar is currently using, and
starts or stops the custom animation according to whether the movement
animation is "WALK" or not. There were several problems with this:
1. In ScenePresence, when the client moves, the "control" notification was
sent to the scripts before the avatar's animation had been updated, so the
walking script was using the wrong animation to make its decisions. Now the
scripts are notified only after the animation has been updated.
2. Sometimes multiple threads were trying to update the avatar's movement
animation at once, again causing the script to see the wrong animation. I
added a lock to prevent threads from interfering with each other.
3. When choosing the avatar's movement animation, if the avatar stopped
walking while it was falling (even if the "fall" was really just a tiny bump
in the ground) then the avatar animation remained on "WALK". I changed it to
set the animation to "STAND" in this case. (It would have changed to "STAND"
soon anyway, but that delay caused the walking script to fail.) Note that
this only affects the beginning of a fall; if the fall takes a long time
then the avatar switches to the "FALLING" animation, and I didn't change
that.
The situation is much improved now: I haven't been able to cause the walking
animation bug to happen anymore (although it's possible that there are other
cases I haven't hit upon). I will submit this patch after I finish updating
our system to OpenSim 0.7.3.
--
View this message in context: http://opensim-dev.2196679.n2.nabble.com/Walk-animation-doesn-t-stop-tp7453403p7459646.html
Sent from the opensim-dev mailing list archive at Nabble.com.
More information about the Opensim-dev
mailing list