summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-10-30 04:20:12 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-10-30 04:20:12 -0400
commit58e2d58daf603824872308245a451c2e32394706 (patch)
treef2fb9d23ce92946b6bf75ce4840a67df684aefad /indra
parent5c8d902c1bab6f0577750e8e2470384a31880947 (diff)
SL-93 - WIP on managing pelvis fixups using new joint offset framework
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llappearance/llavatarappearance.cpp36
-rwxr-xr-xindra/llappearance/llavatarappearance.h8
-rwxr-xr-xindra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/llaisapi.cpp3
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp6
-rwxr-xr-xindra/newview/llvoavatar.cpp50
-rwxr-xr-xindra/newview/llvoavatar.h8
-rwxr-xr-xindra/newview/llvovolume.cpp8
8 files changed, 73 insertions, 57 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index c0ad8315af..d1eb389013 100755
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -675,6 +675,42 @@ void LLAvatarAppearance::clearSkeleton()
mSkeleton.clear();
}
+//------------------------------------------------------------------------
+// addPelvisFixup
+//------------------------------------------------------------------------
+void LLAvatarAppearance::addPelvisFixup( F32 fixup, const LLUUID& mesh_id )
+{
+ LLVector3 pos(0.0,0.0,fixup);
+ mPelvisFixups.add(mesh_id,pos);
+}
+
+//------------------------------------------------------------------------
+// addPelvisFixup
+//------------------------------------------------------------------------
+void LLAvatarAppearance::removePelvisFixup( const LLUUID& mesh_id )
+{
+ mPelvisFixups.remove(mesh_id);
+}
+
+//------------------------------------------------------------------------
+// hasPelvisFixup
+//------------------------------------------------------------------------
+bool LLAvatarAppearance::hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const
+{
+ LLVector3 pos;
+ if (mPelvisFixups.findActiveOverride(mesh_id,pos))
+ {
+ fixup = pos[2];
+ return true;
+ }
+ return false;
+}
+
+bool LLAvatarAppearance::hasPelvisFixup( F32& fixup ) const
+{
+ LLUUID mesh_id;
+ return hasPelvisFixup( fixup, mesh_id );
+}
//-----------------------------------------------------------------------------
// LLAvatarAppearance::buildCharacter()
// Deferred initialization and rebuild of the avatar.
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index 1e898026c0..a0ef49b7cb 100755
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -152,11 +152,17 @@ protected:
BOOL mIsBuilt; // state of deferred character building
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
avatar_joint_list_t mSkeleton;
-
+ LLPosOverrideMap mPelvisFixups;
+
//--------------------------------------------------------------------
// Pelvis height adjustment members.
//--------------------------------------------------------------------
public:
+ void addPelvisFixup( F32 fixup, const LLUUID& mesh_id );
+ void removePelvisFixup( const LLUUID& mesh_id );
+ bool hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const;
+ bool hasPelvisFixup( F32& fixup ) const;
+
LLVector3 mBodySize;
LLVector3 mAvatarOffset;
protected:
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 22d64d4d14..3d97d0525e 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4731,6 +4731,17 @@
<key>Value</key>
<integer>7</integer>
</map>
+ <key>InventoryDisableAISv3</key>
+ <map>
+ <key>Comment</key>
+ <string>Force AISv3 support to off.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>InvertMouse</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 96de15bf75..9842bf2a66 100755
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -124,7 +124,8 @@ bool AISCommand::isAPIAvailable()
{
if (gAgent.getRegion())
{
- return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3");
+ bool force_disable = gSavedSettings.getBOOL("InventoryDisableAISv3");
+ return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3") && !force_disable;
}
return false;
}
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 73bf7f3e23..0c81ab7e79 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3244,7 +3244,11 @@ U32 LLModelPreview::calcResourceCost()
if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() )
{
- getPreviewAvatar()->setPelvisOffset( mPelvisZOffset );
+ // FIXME if preview avatar ever gets reused, this fake mesh ID stuff will fail.
+ // see also call to addAttachmentPosOverride.
+ LLUUID fake_mesh_id;
+ fake_mesh_id.generate();
+ getPreviewAvatar()->addPelvisFixup( mPelvisZOffset, fake_mesh_id );
}
F32 streaming_cost = 0.f;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index e01bdd92b0..fb25a2ddec 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -708,7 +708,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mVisualComplexity(0),
mVisualComplexityStale(TRUE),
mLoadedCallbacksPaused(FALSE),
- mHasPelvisOffset( FALSE ),
mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)),
mLastRezzedStatus(-1),
mIsEditingAppearance(FALSE),
@@ -770,10 +769,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mRuthTimer.reset();
mRuthDebugTimer.reset();
mDebugExistenceTimer.reset();
- mPelvisOffset = LLVector3(0.0f,0.0f,0.0f);
- mLastPelvisToFoot = 0.0f;
- mPelvisFixup = 0.0f;
- mLastPelvisFixup = 0.0f;
if(LLSceneMonitor::getInstance()->isEnabled())
{
@@ -1258,17 +1253,18 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
- if ( !mHasPelvisOffset )
- {
- return mDrawable->getPositionAgent();
- }
- else
+ F32 fixup;
+ if ( hasPelvisFixup( fixup) )
{
//Apply a pelvis fixup (as defined by the avs skin)
LLVector3 pos = mDrawable->getPositionAgent();
- pos[VZ] += mPelvisFixup;
+ pos[VZ] += fixup;
return pos;
}
+ else
+ {
+ return mDrawable->getPositionAgent();
+ }
}
else
{
@@ -3724,21 +3720,6 @@ void LLVOAvatar::updateHeadOffset()
}
}
//------------------------------------------------------------------------
-// setPelvisOffset
-//------------------------------------------------------------------------
-void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount, F32 pelvisFixup )
-{
- mHasPelvisOffset = hasOffset;
- if ( mHasPelvisOffset )
- {
- //Store off last pelvis to foot value
- mLastPelvisToFoot = mPelvisToFoot;
- mPelvisOffset = offsetAmount;
- mLastPelvisFixup = mPelvisFixup;
- mPelvisFixup = pelvisFixup;
- }
-}
-//------------------------------------------------------------------------
// postPelvisSetRecalc
//------------------------------------------------------------------------
void LLVOAvatar::postPelvisSetRecalc( void )
@@ -3748,15 +3729,6 @@ void LLVOAvatar::postPelvisSetRecalc( void )
dirtyMesh(2);
}
//------------------------------------------------------------------------
-// setPelvisOffset
-//------------------------------------------------------------------------
-void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount )
-{
- mHasPelvisOffset = true;
- mLastPelvisFixup = mPelvisFixup;
- mPelvisFixup = pelvisFixupAmount;
-}
-//------------------------------------------------------------------------
// updateVisibility()
//------------------------------------------------------------------------
void LLVOAvatar::updateVisibility()
@@ -5104,22 +5076,18 @@ void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id)
{
LLJoint* pJoint = (*iter);
//Reset joints except for pelvis
- if ( pJoint && pJoint != pJointPelvis)
+ if ( pJoint )
{
pJoint->setId( LLUUID::null );
pJoint->removeAttachmentPosOverride(mesh_id, avString());
}
- else
if ( pJoint && pJoint == pJointPelvis)
{
- pJoint->setId( LLUUID::null );
+ removePelvisFixup( mesh_id );
pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) );
}
}
- //make sure we don't apply the joint offset
- mHasPelvisOffset = false;
- mPelvisFixup = mLastPelvisFixup;
postPelvisSetRecalc();
}
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index a582922c03..d7cf4a2c0c 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -356,19 +356,11 @@ protected:
/*virtual*/ LLAvatarJointMesh* createAvatarJointMesh(); // Returns LLViewerJointMesh
public:
void updateHeadOffset();
- void setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ;
- bool hasPelvisOffset( void ) { return mHasPelvisOffset; }
void postPelvisSetRecalc( void );
- void setPelvisOffset( F32 pelvixFixupAmount );
/*virtual*/ BOOL loadSkeletonNode();
/*virtual*/ void buildCharacter();
- bool mHasPelvisOffset;
- LLVector3 mPelvisOffset;
- F32 mLastPelvisToFoot;
- F32 mPelvisFixup;
- F32 mLastPelvisFixup;
LLVector3 mCurRootToHeadOffset;
LLVector3 mTargetRootToHeadOffset;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 4c21203c43..7c9bdc19a6 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4632,11 +4632,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
//If joint is a pelvis then handle old/new pelvis to foot values
if ( lookingForJoint == "mPelvis" )
{
- if ( !pAvatarVO->hasPelvisOffset() )
- {
- pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset );
- pelvisGotSet = true;
- }
+ // FIXME move
+ pAvatarVO->addPelvisFixup( pelvisZOffset, mesh_id );
+ pelvisGotSet = true;
}
}
}