Permalink
Browse files

Alchemy llcharacter and llcommon merge pass.

  • Loading branch information...
Shyotl committed Mar 31, 2017
1 parent f95be54 commit 1230748ef56cf7df0846607523a8fafd495da9c2
Showing with 301 additions and 304 deletions.
  1. +2 −2 indra/llcharacter/llanimationstates.cpp
  2. +1 −1 indra/llcharacter/llanimationstates.h
  3. +7 −6 indra/llcharacter/llheadrotmotion.cpp
  4. +4 −4 indra/llcharacter/lljointstate.h
  5. +8 −12 indra/llcharacter/llkeyframemotion.cpp
  6. +10 −5 indra/llcharacter/llkeyframewalkmotion.cpp
  7. +2 −4 indra/llcharacter/llmotioncontroller.cpp
  8. +8 −8 indra/llcharacter/llmultigesture.cpp
  9. +3 −0 indra/llcommon/CMakeLists.txt
  10. +5 −6 indra/llcommon/is_approx_equal_fraction.h
  11. +0 −2 indra/llcommon/linden_common.h
  12. +2 −2 indra/llcommon/llallocator_heap_profile.cpp
  13. +29 −29 indra/llcommon/llbase64.cpp
  14. +0 −1 indra/llcommon/llcallbacklist.cpp
  15. +4 −4 indra/llcommon/lldate.cpp
  16. +2 −2 indra/llcommon/lldate.h
  17. +1 −1 indra/llcommon/lldependencies.cpp
  18. +5 −5 indra/llcommon/lldependencies.h
  19. +1 −1 indra/llcommon/lldictionary.h
  20. +1 −1 indra/llcommon/llevent.cpp
  21. +1 −1 indra/llcommon/lleventdispatcher.cpp
  22. +2 −9 indra/llcommon/lleventdispatcher.h
  23. +2 −3 indra/llcommon/lleventfilter.cpp
  24. +4 −5 indra/llcommon/lleventfilter.h
  25. +3 −4 indra/llcommon/llhandle.h
  26. +8 −3 indra/llcommon/llinitparam.cpp
  27. +8 −13 indra/llcommon/llinitparam.h
  28. +35 −35 indra/llcommon/llmd5.cpp
  29. +9 −9 indra/llcommon/llmd5.h
  30. +6 −12 indra/llcommon/llprocessor.cpp
  31. +4 −6 indra/llcommon/llptrto.h
  32. +1 −1 indra/llcommon/llrun.cpp
  33. +2 −2 indra/llcommon/llrun.h
  34. +2 −4 indra/llcommon/llsd.cpp
  35. +5 −8 indra/llcommon/llsdparam.cpp
  36. +2 −3 indra/llcommon/llsdparam.h
  37. +4 −5 indra/llcommon/llsdutil.cpp
  38. +2 −3 indra/llcommon/llstacktrace.cpp
  39. +1 −1 indra/llcommon/llstaticstringtable.h
  40. +15 −4 indra/llcommon/llstl.h
  41. +2 −2 indra/llcommon/llstreamtools.cpp
  42. +1 −1 indra/llcommon/llstrider.h
  43. +8 −10 indra/llcommon/llstring.cpp
  44. +6 −2 indra/llcommon/llstring.h
  45. +2 −2 indra/llcommon/llstringtable.cpp
  46. +1 −1 indra/llcommon/llstringtable.h
  47. +8 −0 indra/llcommon/llsys.cpp
  48. +10 −11 indra/llcommon/lltreeiterators.h
  49. +6 −7 indra/llcommon/lluri.cpp
  50. +1 −1 indra/llinventory/llfoldertype.cpp
  51. +8 −4 indra/llinventory/llinventory.cpp
  52. +1 −4 indra/llinventory/llinventory.h
  53. +1 −1 indra/newview/llagent.cpp
  54. +1 −1 indra/newview/llfoldervieweventlistener.h
  55. +1 −1 indra/newview/llgiveinventory.cpp
  56. +17 −14 indra/newview/llinventorybridge.cpp
  57. +5 −5 indra/newview/llinventorybridge.h
  58. +1 −1 indra/newview/llinventorypanel.cpp
  59. +3 −3 indra/newview/llinventorypanel.h
  60. +3 −2 indra/newview/llpanelobjectinventory.cpp
  61. +4 −4 indra/newview/llvoavatar.cpp
@@ -46,7 +46,7 @@ LLUUID const ANIM_AGENT_BLOW_KISS ("db84829b-462c-ee83-1e27-9bbee66b
LLUUID const ANIM_AGENT_BORED ("b906c4ba-703b-1940-32a3-0c7f7d791510");
LLUUID const ANIM_AGENT_BOW ("82e99230-c906-1403-4d9c-3889dd98daba");
LLUUID const ANIM_AGENT_BRUSH ("349a3801-54f9-bf2c-3bd0-1ac89772af01");
LLUUID const ANIM_AGENT_BUSY ("efcf670c-2d18-8128-973a-034ebc806b67");
LLUUID const ANIM_AGENT_DO_NOT_DISTURB ("efcf670c-2d18-8128-973a-034ebc806b67");
LLUUID const ANIM_AGENT_CLAP ("9b0c1c4e-8ac7-7969-1494-28c874c4f668");
LLUUID const ANIM_AGENT_COURTBOW ("9ba1c942-08be-e43a-fb29-16ad440efc50");
LLUUID const ANIM_AGENT_CROUCH ("201f3fdf-cb1f-dbec-201f-7333e328ae7c");
@@ -211,7 +211,7 @@ LLAnimationLibrary::LLAnimationLibrary() :
mAnimMap[ANIM_AGENT_BORED]= mAnimStringTable.addString("express_bored");
mAnimMap[ANIM_AGENT_BOW]= mAnimStringTable.addString("bow");
mAnimMap[ANIM_AGENT_BRUSH]= mAnimStringTable.addString("brush");
mAnimMap[ANIM_AGENT_BUSY]= mAnimStringTable.addString("busy");
mAnimMap[ANIM_AGENT_DO_NOT_DISTURB]= mAnimStringTable.addString("busy");
mAnimMap[ANIM_AGENT_CLAP]= mAnimStringTable.addString("clap");
mAnimMap[ANIM_AGENT_COURTBOW]= mAnimStringTable.addString("courtbow");
mAnimMap[ANIM_AGENT_CROUCH]= mAnimStringTable.addString("crouch");
@@ -56,7 +56,7 @@ extern const LLUUID ANIM_AGENT_BLOW_KISS;
extern const LLUUID ANIM_AGENT_BORED;
extern const LLUUID ANIM_AGENT_BOW;
extern const LLUUID ANIM_AGENT_BRUSH;
extern const LLUUID ANIM_AGENT_BUSY;
extern const LLUUID ANIM_AGENT_DO_NOT_DISTURB;
extern const LLUUID ANIM_AGENT_CLAP;
extern const LLUUID ANIM_AGENT_COURTBOW;
extern const LLUUID ANIM_AGENT_CROUCH;
@@ -80,13 +80,14 @@ LLHeadRotMotion::LLHeadRotMotion(LLUUID const& id, LLMotionController* controlle
AIMaskedMotion(id, controller, ANIM_AGENT_HEAD_ROT),
mCharacter(NULL),
mTorsoJoint(NULL),
mHeadJoint(NULL)
mHeadJoint(NULL),
mRootJoint(NULL),
mPelvisJoint(NULL),
mHeadState(new LLJointState),
mTorsoState(new LLJointState),
mNeckState(new LLJointState)
{
mName = "head_rot";
mTorsoState = new LLJointState;
mNeckState = new LLJointState;
mHeadState = new LLJointState;
}
@@ -388,7 +389,7 @@ void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_s
// calculate vergence
F32 interocular_dist = (left_eye_state.getJoint()->getWorldPosition() - right_eye_state.getJoint()->getWorldPosition()).magVec();
vergence = -atan2((interocular_dist / 2.f), lookAtDistance);
llclamp(vergence, -F_PI_BY_TWO, 0.f);
vergence = llclamp(vergence, -F_PI_BY_TWO, 0.f);
}
else
{
@@ -70,15 +70,15 @@ class LLJointState : public LLRefCount
public:
// Constructor
LLJointState()
: mUsage(0)
, mJoint(NULL)
: mJoint(NULL)
, mUsage(0)
, mWeight(0.f)
, mPriority(LLJoint::USE_MOTION_PRIORITY)
{}
LLJointState(LLJoint* joint)
: mUsage(0)
, mJoint(joint)
: mJoint(joint)
, mUsage(0)
, mWeight(0.f)
, mPriority(LLJoint::USE_MOTION_PRIORITY)
{}
@@ -447,7 +447,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
//-----------------------------------------------------------------------------
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id, LLMotionController* controller)
: LLMotion(id, controller),
mJointMotionList(NULL),
mPelvisp(NULL),
mCharacter(NULL),
mLastSkeletonSerialNum(0),
mLastUpdateTime(0.f),
mLastLoopedTime(0.f),
@@ -1101,11 +1103,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
if (constraint->mSharedData->mChainLength != 0 &&
dist_vec_squared(root_pos, target_pos) * 0.95f > constraint->mTotalLength * constraint->mTotalLength)
{
constraint->mWeight = lerp(constraint->mWeight, 0.f, LLSmoothInterpolation::getInterpolant(0.1f));
constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 0.f, 0.1f);
}
else
{
constraint->mWeight = lerp(constraint->mWeight, 1.f, LLSmoothInterpolation::getInterpolant(0.3f));
constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 1.f, 0.3f);
}
F32 weight = constraint->mWeight * ((shared_data->mEaseOutStopTime == 0.f) ? 1.f :
@@ -1783,36 +1785,32 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
for(S32 i = 0; i < num_constraints; ++i)
{
// read in constraint data
JointConstraintSharedData* constraintp = new JointConstraintSharedData;
auto constraintp = new JointConstraintSharedData;
std::unique_ptr<JointConstraintSharedData> watcher(constraintp);
U8 byte = 0;
if (!dp.unpackU8(byte, "chain_length"))
{
LL_WARNS() << "can't read constraint chain length" << LL_ENDL;
delete constraintp;
return FALSE;
}
constraintp->mChainLength = (S32) byte;
if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions())
{
LL_WARNS() << "invalid constraint chain length" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackU8(byte, "constraint_type"))
{
LL_WARNS() << "can't read constraint type" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( byte >= NUM_CONSTRAINT_TYPES )
{
LL_WARNS() << "invalid constraint type" << LL_ENDL;
delete constraintp;
return FALSE;
}
constraintp->mConstraintType = (EConstraintType)byte;
@@ -1822,7 +1820,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume"))
{
LL_WARNS() << "can't read source volume name" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1834,7 +1831,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if(constraintp->mSourceConstraintVolume == -1)
{
LL_WARNS() << "can't get source constraint volume" << LL_ENDL;
delete constraintp;
return FALSE;
}
// </edit>
@@ -1924,12 +1920,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
return FALSE;
}
constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; // note: mChainLength is size-limited - comes from a byte
if (singu_new_joint_motion_list)
{
mJointMotionList->mConstraints.push_front(watcher.release());
}
constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; // note: mChainLength is size-limited - comes from a byte
LLJoint* joint = mCharacter->findCollisionVolume(constraintp->mSourceConstraintVolume);
// get joint to which this collision volume is attached
@@ -2168,7 +2164,7 @@ void LLKeyframeMotion::setEmote(const LLUUID& emote_id)
}
else
{
mJointMotionList->mEmoteName = "";
mJointMotionList->mEmoteName.clear();
}
}
@@ -140,14 +140,18 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
//-----------------------------------------------------------------------------
LLWalkAdjustMotion::LLWalkAdjustMotion(LLUUID const& id, LLMotionController* controller) :
AIMaskedMotion(id, controller, ANIM_AGENT_WALK_ADJUST),
mCharacter(NULL),
mLastTime(0.f),
mAnimSpeed(0.f),
mAdjustedSpeed(0.f),
mRelativeDir(0.f),
mAnkleOffset(0.f)
mAnkleOffset(0.f),
mLeftAnkleJoint(NULL),
mRightAnkleJoint(NULL),
mPelvisJoint(NULL),
mPelvisState(new LLJointState)
{
mName = "walk_adjust";
mPelvisState = new LLJointState;
}
//-----------------------------------------------------------------------------
@@ -287,7 +291,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
F32 desired_speed_multiplier = llclamp(speed / foot_speed, min_speed_multiplier, ANIM_SPEED_MAX);
// blend towards new speed adjustment value
F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLSmoothInterpolation::getInterpolant(SPEED_ADJUST_TIME_CONSTANT));
F32 new_speed_adjust = LLSmoothInterpolation::lerp(mAdjustedSpeed, desired_speed_multiplier, SPEED_ADJUST_TIME_CONSTANT);
// limit that rate at which the speed adjustment changes
F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time);
@@ -305,7 +309,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
{ // standing/turning
// damp out speed adjustment to 0
mAnimSpeed = lerp(mAnimSpeed, 1.f, LLSmoothInterpolation::getInterpolant(0.2f));
mAnimSpeed = LLSmoothInterpolation::lerp(mAnimSpeed, 1.f, 0.2f);
//mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLSmoothInterpolation::getInterpolant(0.2f));
}
@@ -333,6 +337,7 @@ void LLWalkAdjustMotion::onDeactivate()
//-----------------------------------------------------------------------------
LLFlyAdjustMotion::LLFlyAdjustMotion(LLUUID const& id, LLMotionController* controller)
: AIMaskedMotion(id, controller, ANIM_AGENT_FLY_ADJUST),
mCharacter(NULL),
mRoll(0.f)
{
mName = "fly_adjust";
@@ -384,7 +389,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor;
// roll is critically damped interpolation between current roll and angular velocity-derived target roll
mRoll = lerp(mRoll, target_roll, LLSmoothInterpolation::getInterpolant(0.1f));
mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, U32Milliseconds(100));
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
mPelvisState->setRotation(roll);
@@ -83,7 +83,7 @@ LLMotionRegistry::~LLMotionRegistry()
BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
{
// LL_INFOS() << "Registering motion: " << name << LL_ENDL;
return mMotionTable.insert(std::make_pair(id,constructor)).second;
return mMotionTable.emplace(id, constructor).second;
}
//-----------------------------------------------------------------------------
@@ -582,9 +582,7 @@ static LLTrace::BlockTimerStatHandle FTM_MOTION_ON_UPDATE("Motion onUpdate");
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
{
BOOL update_result = TRUE;
U8 last_joint_signature[LL_CHARACTER_MAX_ANIMATED_JOINTS];
memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS);
U8 last_joint_signature[LL_CHARACTER_MAX_ANIMATED_JOINTS] = {0};
// iterate through active motions in chronological order
for (motion_list_t::iterator iter = mActiveMotions.begin();
@@ -180,34 +180,34 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
{
case STEP_ANIMATION:
{
LLGestureStepAnimation* step = new LLGestureStepAnimation();
std::unique_ptr<LLGestureStep> step(new LLGestureStepAnimation());
BOOL ok = step->deserialize(dp);
if (!ok) return FALSE;
mSteps.push_back(step);
mSteps.push_back(step.release());
break;
}
case STEP_SOUND:
{
LLGestureStepSound* step = new LLGestureStepSound();
std::unique_ptr<LLGestureStep> step(new LLGestureStepSound());
BOOL ok = step->deserialize(dp);
if (!ok) return FALSE;
mSteps.push_back(step);
mSteps.push_back(step.release());
break;
}
case STEP_CHAT:
{
LLGestureStepChat* step = new LLGestureStepChat();
std::unique_ptr<LLGestureStep> step(new LLGestureStepChat());
BOOL ok = step->deserialize(dp);
if (!ok) return FALSE;
mSteps.push_back(step);
mSteps.push_back(step.release());
break;
}
case STEP_WAIT:
{
LLGestureStepWait* step = new LLGestureStepWait();
std::unique_ptr<LLGestureStep> step(new LLGestureStepWait());
BOOL ok = step->deserialize(dp);
if (!ok) return FALSE;
mSteps.push_back(step);
mSteps.push_back(step.release());
break;
}
default:
@@ -8,6 +8,7 @@ include(LLCommon)
include(APR)
include(Linking)
include(Boost)
include(OpenSSL)
include(LLSharedLibs)
include(GoogleBreakpad)
include(Copy3rdPartyLibs)
@@ -16,6 +17,7 @@ include(ZLIB)
include_directories(
${EXPAT_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${BREAKPAD_INCLUDE_DIRECTORIES}
)
@@ -284,6 +286,7 @@ target_link_libraries(
${APRUTIL_LIBRARIES}
${APR_LIBRARIES}
${EXPAT_LIBRARIES}
${OPENSSL_LIBRARIES}
${ZLIB_LIBRARIES}
${WINDOWS_LIBRARIES}
${Boost_CONTEXT_LIBRARY}
@@ -49,9 +49,8 @@
* signatures.
*/
template <typename FTYPE>
inline BOOL is_approx_equal_fraction_impl(FTYPE x, FTYPE y, U32 frac_bits)
inline bool is_approx_equal_fraction_impl(FTYPE x, FTYPE y, U32 frac_bits)
{
BOOL ret = TRUE;
FTYPE diff = (FTYPE) fabs(x - y);
S32 diffInt = (S32) diff;
@@ -64,20 +63,20 @@ inline BOOL is_approx_equal_fraction_impl(FTYPE x, FTYPE y, U32 frac_bits)
// based on the number of bits used for packing decimal portion.
if (diffInt != 0 || diffFracTolerance > 1)
{
ret = FALSE;
return false;
}
return ret;
return true;
}
/// F32 flavor
inline BOOL is_approx_equal_fraction(F32 x, F32 y, U32 frac_bits)
inline bool is_approx_equal_fraction(F32 x, F32 y, U32 frac_bits)
{
return is_approx_equal_fraction_impl<F32>(x, y, frac_bits);
}
/// F64 flavor
inline BOOL is_approx_equal_fraction(F64 x, F64 y, U32 frac_bits)
inline bool is_approx_equal_fraction(F64 x, F64 y, U32 frac_bits)
{
return is_approx_equal_fraction_impl<F64>(x, y, frac_bits);
}
@@ -43,11 +43,9 @@
#endif
#if defined(LL_WINDOWS) && defined(_DEBUG)
# if _MSC_VER >= 1400 // Visual C++ 2005 or later
# define _CRTDBG_MAP_ALLOC
# include <stdlib.h>
# include <crtdbg.h>
# endif
#endif
#include "llpreprocessor.h"
@@ -40,7 +40,7 @@
#include <boost/lexical_cast.hpp>
#include <boost/range/iterator_range.hpp>
static const std::string HEAP_PROFILE_MAGIC_STR = "heap profile:";
static const std::string HEAP_PROFILE_MAGIC_STR("heap profile:");
static bool is_separator(char c)
{
@@ -70,7 +70,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text)
range_t prof_range(prof_begin, prof_text.end());
boost::algorithm::split(prof_lines,
prof_range,
boost::bind(std::equal_to<llwchar>(), '\n', _1));
std::bind(std::equal_to<llwchar>(), '\n', std::placeholders::_1));
std::vector< range_t >::const_iterator i;
for(i = prof_lines.begin(); i != prof_lines.end() && !i->empty(); ++i)
Oops, something went wrong.

0 comments on commit 1230748

Please sign in to comment.