summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llcontrolavatar.cpp55
-rw-r--r--indra/newview/llmeshrepository.h1
-rw-r--r--indra/newview/llskinningutil.cpp4
-rw-r--r--indra/newview/llvoavatar.cpp84
-rw-r--r--indra/newview/llvoavatar.h5
5 files changed, 25 insertions, 124 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 8291df7705..36e728f26d 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -34,10 +34,6 @@
#include "llmeshrepository.h"
#include "llviewerregion.h"
-#if LL_WINDOWS
- #pragma optimize("", off)
-#endif
-
LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) :
LLVOAvatar(id, pcode, regionp),
mPlaying(false),
@@ -68,41 +64,6 @@ void LLControlAvatar::initInstance()
hideSkirt();
}
-// AXON move to math
-bool box_valid_and_non_zero(const LLVector3* box)
-{
- if (!box[0].isFinite() || !box[1].isFinite())
- {
- return false;
- }
- LLVector3 zero_vec;
- zero_vec.clear();
- if ((box[0] != zero_vec) || (box[1] != zero_vec))
- {
- return true;
- }
- return false;
-}
-
-// AXON move to math
-LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box)
-{
- LLVector3 offset;
- for (S32 k=0; k<3; k++)
- {
- offset[k] = 0;
- if (pos[k] < box[0][k])
- {
- offset[k] = pos[k] - box[0][k];
- }
- else if (pos[k] > box[1][k])
- {
- offset[k] = pos[k] - box[1][k];
- }
- }
- return offset;
-}
-
void LLControlAvatar::matchVolumeTransform()
{
if (mRootVolp)
@@ -157,11 +118,11 @@ void LLControlAvatar::matchVolumeTransform()
F32 target_dist = (offset_dist - MAX_LEGAL_OFFSET);
pos_box_offset *= target_dist/offset_dist;
}
- LL_DEBUGS("FixBox") << getFullname() << " fixup needed for offset "
- << pos_box_offset[0] << "," << pos_box_offset[1] << "," << pos_box_offset[2]
- << " current fixup "
- << mPositionConstraintFixup[0] << "," << mPositionConstraintFixup[1] << "," << mPositionConstraintFixup[2]
- << " dist " << offset_dist << LL_ENDL;
+ //LL_DEBUGS("FixBox") << getFullname() << " fixup needed for offset "
+ // << pos_box_offset[0] << "," << pos_box_offset[1] << "," << pos_box_offset[2]
+ // << " current fixup "
+ // << mPositionConstraintFixup[0] << "," << mPositionConstraintFixup[1] << "," << mPositionConstraintFixup[2]
+ // << " dist " << offset_dist << LL_ENDL;
}
mPositionConstraintFixup = pos_box_offset;
@@ -380,6 +341,12 @@ void LLControlAvatar::updateDebugText()
addDebugText(llformat("flags %s", animated_object_flag_string.c_str()));
addDebugText(llformat("tris %d (est %.1f, streaming %.1f), verts %d", total_tris, est_tris, est_streaming_tris, total_verts));
addDebugText(llformat("pxarea %s rank %d", LLStringOps::getReadableNumber(getPixelArea()).c_str(), getVisibilityRank()));
+ if (mPositionConstraintFixup.length() > 0.0f)
+ {
+ addDebugText(llformat("pos fix (%.1f %.1f %.1f)",
+ mPositionConstraintFixup[0], mPositionConstraintFixup[1], mPositionConstraintFixup[2]));
+ }
+
#if 0
std::string region_name = "no region";
if (mRootVolp->getRegion())
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index df8f5c5ff4..cb3903b1d0 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -652,7 +652,6 @@ public:
extern LLMeshRepository gMeshRepo;
-// AXON make sure this is consistent with the final simulator-side values.
const F32 ANIMATED_OBJECT_BASE_COST = 15.0f;
const F32 ANIMATED_OBJECT_COST_PER_KTRI = 1.5f;
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp
index db9877f302..0878cee1a3 100644
--- a/indra/newview/llskinningutil.cpp
+++ b/indra/newview/llskinningutil.cpp
@@ -34,10 +34,6 @@
#include "llvolume.h"
#include "llrigginginfo.h"
-//#if LL_WINDOWS
-//#pragma optimize("", off)
-//#endif
-
void LLSkinningUtil::initClass()
{
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6896632597..728155382f 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1346,7 +1346,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- // AXON is this right? Don't we need to look at children of attached_object as well?
+ // AXON Don't we need to look at children of attached_object as well?
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object && !attached_object->isHUDAttachment())
{
@@ -1389,10 +1389,11 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
{
// AXON try to cache unless something has changed about attached rigged meshes.
// Needs more logic based on volume states.
+
//if (mRiggingInfoTab.needsUpdate())
{
updateRiggingInfo();
- mJointRiggingInfoTab.setNeedsUpdate(false);
+ //mJointRiggingInfoTab.setNeedsUpdate(false);
}
for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++)
{
@@ -1403,12 +1404,6 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
rig_info = &mJointRiggingInfoTab[joint_num];
}
- // FIXME TEMP HACK FOR TESTING
- //if (joint)
- //{
- // rig_info.setIsRiggedTo(true);
- //}
-
if (joint && rig_info && rig_info->isRiggedTo())
{
LLViewerJointAttachment *as_joint_attach = dynamic_cast<LLViewerJointAttachment*>(joint);
@@ -1574,7 +1569,7 @@ void LLVOAvatar::renderBones()
}
else
{
- if (jointIsRiggedTo(jointp->getName()))
+ if (jointIsRiggedTo(jointp))
{
occ_color = RIGGED_COLOR_OCCLUDED;
visible_color = RIGGED_COLOR_VISIBLE;
@@ -2702,7 +2697,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
{
ext[0].load3(mLastAnimExtents[0].mV);
ext[1].load3(mLastAnimExtents[1].mV);
- // AXON just do this once per frame
+ // Expensive. Just call this once per frame, in updateSpatialExtents();
//calculateSpatialExtents(ext[0], ext[1]);
LLVector4a diff;
diff.setSub(ext[1], mImpostorExtents[1]);
@@ -5827,13 +5822,11 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id)
return false;
}
-// AXON update to use LLRiggingInfo
-bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name)
+bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const
{
- LLJoint *joint = getJoint(joint_name);
if (joint)
{
- LLJointRiggingInfoTab& tab = mJointRiggingInfoTab;
+ const LLJointRiggingInfoTab& tab = mJointRiggingInfoTab;
S32 joint_num = joint->getJointNum();
if (joint_num < tab.size() && tab[joint_num].isRiggedTo())
{
@@ -5841,60 +5834,6 @@ bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name)
}
}
return false;
-#if 0
- for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
- iter != mAttachmentPoints.end();
- ++iter)
- {
- LLViewerJointAttachment* attachment = iter->second;
- for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
- attachment_iter != attachment->mAttachedObjects.end();
- ++attachment_iter)
- {
- const LLViewerObject* attached_object = (*attachment_iter);
- if (attached_object && jointIsRiggedTo(joint_name, attached_object))
- {
- return true;
- }
- }
- }
- return false;
-#endif
-}
-
-// AXON update to use LLRiggingInfo
-bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo)
-{
- // Process all children
- LLViewerObject::const_child_list_t& children = vo->getChildren();
- for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
- it != children.end(); ++it)
- {
- LLViewerObject *childp = *it;
- if (jointIsRiggedTo(joint_name,childp))
- {
- return true;
- }
- }
-
- const LLVOVolume *vobj = dynamic_cast<const LLVOVolume*>(vo);
- if (!vobj)
- {
- return false;
- }
-
- const LLMeshSkinInfo* pSkinData = vobj->getSkinInfo();
-
- if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData )
- {
- if (std::find(pSkinData->mJointNames.begin(), pSkinData->mJointNames.end(), joint_name) !=
- pSkinData->mJointNames.end())
- {
- return true;
- }
- }
-
- return false;
}
void LLVOAvatar::clearAttachmentOverrides()
@@ -9554,10 +9493,9 @@ void showRigInfoTabExtents(LLVOAvatar *avatar, LLJointRiggingInfoTab& tab, S32&
}
}
-// AXON move to member
-void getAssociatedVolumes(LLVOAvatar *av, std::vector<LLVOVolume*>& volumes)
+void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
{
- for ( LLVOAvatar::attachment_map_t::iterator iter = av->mAttachmentPoints.begin(); iter != av->mAttachmentPoints.end(); ++iter )
+ for ( LLVOAvatar::attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter )
{
LLViewerJointAttachment* attachment = iter->second;
LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_end = attachment->mAttachedObjects.end();
@@ -9584,7 +9522,7 @@ void getAssociatedVolumes(LLVOAvatar *av, std::vector<LLVOVolume*>& volumes)
}
}
}
- LLControlAvatar *control_av = dynamic_cast<LLControlAvatar*>(av);
+ LLControlAvatar *control_av = dynamic_cast<LLControlAvatar*>(this);
if (control_av)
{
LLVOVolume *volp = control_av->mRootVolp;
@@ -9612,7 +9550,7 @@ void LLVOAvatar::updateRiggingInfo()
LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL;
mJointRiggingInfoTab.clear();
std::vector<LLVOVolume*> volumes;
- getAssociatedVolumes(this, volumes);
+ getAssociatedVolumes(volumes);
for (std::vector<LLVOVolume*>::iterator it = volumes.begin(); it != volumes.end(); ++it)
{
LLVOVolume *vol = *it;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index d80f0ad713..25c89f96d7 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -208,8 +208,7 @@ public:
void addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LLUUID>* meshes_seen = NULL, bool recursive = true);
void removeAttachmentOverridesForObject(const LLUUID& mesh_id);
void removeAttachmentOverridesForObject(LLViewerObject *vo);
- bool jointIsRiggedTo(const std::string& joint_name);
- bool jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo);
+ bool jointIsRiggedTo(const LLJoint *joint) const;
void clearAttachmentOverrides();
void rebuildAttachmentOverrides();
void updateAttachmentOverrides();
@@ -217,6 +216,8 @@ public:
void getAttachmentOverrideNames(std::set<std::string>& pos_names,
std::set<std::string>& scale_names) const;
+ void getAssociatedVolumes(std::vector<LLVOVolume*>& volumes);
+
// virtual
void updateRiggingInfo();