Better way to detect standing position, still minor issues with animations while in stand state (turning left, turning right still have problems)

This commit is contained in:
phr0z3nt04st
2010-08-11 22:11:13 -05:00
parent 7dc8d8a344
commit 78c2293dc4
4 changed files with 16 additions and 18 deletions

View File

@@ -137,6 +137,7 @@
#include "llviewerjoystick.h"
#include "llfollowcam.h"
// <edit>
#include "llao.h"
#include "llworldmapmessage.h"
// </edit>
using namespace LLVOAvatarDefines;
@@ -4957,6 +4958,10 @@ void LLAgent::onAnimStop(const LLUUID& id)
// handle automatic state transitions (based on completion of animation playback)
if (id == ANIM_AGENT_STAND)
{
// <edit>
if(LLAO::isEnabled())
LLAO::mTimer->resume();//Timer only pauses if its not paused, check is inside function.
// </edit>
stopFidget();
}
else if (id == ANIM_AGENT_AWAY)

View File

@@ -8,8 +8,6 @@
#include "llsdserialize.h"
#include "llagent.h"
#include "llvoavatar.h"
//this is for debugging ;D
//#define AO_DEBUG
//static variables
std::list<LLUUID> LLAO::mStandOverrides;
@@ -18,7 +16,6 @@ LLFloaterAO* LLFloaterAO::sInstance;
BOOL LLAO::mEnabled = FALSE;
F32 LLAO::mPeriod;
LLAOStandTimer* LLAO::mTimer = NULL;
S32 LLAO::playingStands = 0;
LLAOStandTimer::LLAOStandTimer(F32 period) : LLEventTimer(period)
{

View File

@@ -2,6 +2,9 @@
#ifndef LL_LLAO_H
#define LL_LLAO_H
//this is for debugging ;D
//#define AO_DEBUG
#include "llfloater.h"
#include "llcombobox.h"
@@ -21,7 +24,6 @@ class LLAO
{
public:
static void setup();
static S32 playingStands;
static std::map<LLUUID,LLUUID> mOverrides;
static std::list<LLUUID> mStandOverrides;
static BOOL isEnabled(){ return mEnabled; }

View File

@@ -2582,6 +2582,10 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
// trigger fidget anims
if (isAnyAnimationSignaled(AGENT_STAND_ANIMS, NUM_AGENT_STAND_ANIMS))
{
// <edit>
if(LLAO::isEnabled())
LLAO::mTimer->resume();//Timer only pauses if its not paused, check is inside function.
// </edit>
agent.fidget();
}
}
@@ -5161,12 +5165,6 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
{
if(LLAO::isEnabled())
{
if(LLAO::isStand(id))
{
if(LLAO::playingStands == 0)
LLAO::mTimer->resume();//Timer only resumes if its paused, check is inside function.
LLAO::playingStands++;
}
if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
{
// avoid infinite loops!
@@ -5202,7 +5200,10 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
return LLCharacter::startMotion(id, time_offset);
}
bool findStandAnim(const LLUUID& id,std::pair<LLUUID,S32> p)
{
return id != p.first && LLAO::isStand(p.first);
}
//-----------------------------------------------------------------------------
// stopMotion()
//-----------------------------------------------------------------------------
@@ -5213,13 +5214,6 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
// <edit>
if(LLAO::isEnabled())
{
if(LLAO::isStand(id) && LLAO::playingStands > 0) //LLAO::playingStands > 0 stops it from going negative
{
//help the timer get started again
LLAO::playingStands--;
if(LLAO::playingStands == 0)
LLAO::mTimer->pause();//Timer only pauses if its not paused, check is inside function.
}
if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
&& (id != LLAO::mOverrides[id]) )
{