Merge axon
commit
b5b4b58cc0
|
|
@ -238,7 +238,7 @@ protected:
|
|||
** RENDERING
|
||||
**/
|
||||
public:
|
||||
BOOL mIsDummy; // for special views
|
||||
BOOL mIsDummy; // for special views and animated object controllers; local to viewer
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Morph masks
|
||||
|
|
|
|||
|
|
@ -710,6 +710,7 @@ set(viewer_SOURCE_FILES
|
|||
lltransientfloatermgr.cpp
|
||||
lltranslate.cpp
|
||||
lltwitterconnect.cpp
|
||||
lluiavatar.cpp
|
||||
lluilistener.cpp
|
||||
lluploaddialog.cpp
|
||||
llurl.cpp
|
||||
|
|
@ -1456,6 +1457,7 @@ set(viewer_HEADER_FILES
|
|||
lltranslate.h
|
||||
lltwitterconnect.h
|
||||
lluiconstants.h
|
||||
lluiavatar.h
|
||||
lluilistener.h
|
||||
lluploaddialog.h
|
||||
lluploadfloaterobservers.h
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
<key>tags</key>
|
||||
<array>
|
||||
<!-- sample entry for debugging specific items
|
||||
<string>AXON</string>
|
||||
<string>AnimatedObjects</string>
|
||||
<string>Avatar</string>
|
||||
<string>Inventory</string>
|
||||
<string>SceneLoadTiming</string>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer
|
|||
mGlobalScale(1.0f),
|
||||
mMarkedForDeath(false)
|
||||
{
|
||||
mIsDummy = TRUE;
|
||||
mIsControlAvatar = true;
|
||||
mEnableDefaultMotions = false;
|
||||
}
|
||||
|
|
@ -52,10 +53,15 @@ LLControlAvatar::~LLControlAvatar()
|
|||
// virtual
|
||||
void LLControlAvatar::initInstance()
|
||||
{
|
||||
// AXON - potential optimizations here: avoid creating system
|
||||
// Potential optimizations here: avoid creating system
|
||||
// avatar mesh content since it's not used. For now we just clean some
|
||||
// things up after the fact in releaseMeshData().
|
||||
LLVOAvatar::initInstance();
|
||||
|
||||
createDrawable(&gPipeline);
|
||||
updateJointLODs();
|
||||
updateGeometry(mDrawable);
|
||||
hideSkirt();
|
||||
}
|
||||
|
||||
void LLControlAvatar::matchVolumeTransform()
|
||||
|
|
@ -185,13 +191,6 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj)
|
|||
LLControlAvatar *cav = (LLControlAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), CO_FLAG_CONTROL_AVATAR);
|
||||
|
||||
cav->mRootVolp = obj;
|
||||
|
||||
cav->createDrawable(&gPipeline);
|
||||
cav->mIsDummy = TRUE;
|
||||
cav->mSpecialRenderMode = 1;
|
||||
cav->updateJointLODs();
|
||||
cav->updateGeometry(cav->mDrawable);
|
||||
cav->hideSkirt();
|
||||
|
||||
// Sync up position/rotation with object
|
||||
cav->matchVolumeTransform();
|
||||
|
|
@ -280,10 +279,11 @@ void LLControlAvatar::updateDebugText()
|
|||
type_string += "-";
|
||||
}
|
||||
}
|
||||
addDebugText(llformat("CAV obj %d anim %d active %s",
|
||||
total_linkset_count, animated_volume_count, active_string.c_str()));
|
||||
addDebugText(llformat("CAV obj %d anim %d active %s impost %d",
|
||||
total_linkset_count, animated_volume_count, active_string.c_str(), (S32) isImpostor()));
|
||||
addDebugText(llformat("types %s lods %s", type_string.c_str(), lod_string.c_str()));
|
||||
addDebugText(llformat("tris %d verts %d", total_tris, total_verts));
|
||||
addDebugText(llformat("pxarea %s", LLStringOps::getReadableNumber(getPixelArea()).c_str()));
|
||||
std::string region_name = "no region";
|
||||
if (mRootVolp->getRegion())
|
||||
{
|
||||
|
|
@ -335,7 +335,7 @@ void LLControlAvatar::updateAnimations()
|
|||
{
|
||||
if (!mRootVolp)
|
||||
{
|
||||
LL_WARNS_ONCE("AXON") << "No root vol" << LL_ENDL;
|
||||
LL_WARNS_ONCE("AnimatedObjects") << "No root vol" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
|
|||
}
|
||||
LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
|
||||
|
||||
if (avatarp->isDead() || (avatarp->mIsDummy && !avatarp->isControlAvatar()) || avatarp->mDrawable.isNull())
|
||||
if (avatarp->isDead() || avatarp->isUIAvatar() || avatarp->mDrawable.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1455,14 +1455,8 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLViewerDynamicT
|
|||
mCameraPitch = 0.f;
|
||||
mCameraZoom = 1.f;
|
||||
|
||||
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion());
|
||||
mDummyAvatar->createDrawable(&gPipeline);
|
||||
mDummyAvatar->mIsDummy = TRUE;
|
||||
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR);
|
||||
mDummyAvatar->mSpecialRenderMode = 1;
|
||||
mDummyAvatar->setPositionAgent(LLVector3::zero);
|
||||
mDummyAvatar->slamPosition();
|
||||
mDummyAvatar->updateJointLODs();
|
||||
mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
|
||||
mDummyAvatar->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET);
|
||||
mDummyAvatar->hideSkirt();
|
||||
|
||||
|
|
|
|||
|
|
@ -618,15 +618,8 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDyna
|
|||
mCameraPitch = 0.f;
|
||||
mCameraZoom = 1.f;
|
||||
|
||||
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion());
|
||||
mDummyAvatar->createDrawable(&gPipeline);
|
||||
mDummyAvatar->mIsDummy = TRUE;
|
||||
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR);
|
||||
mDummyAvatar->mSpecialRenderMode = 2;
|
||||
mDummyAvatar->setPositionAgent(LLVector3::zero);
|
||||
mDummyAvatar->slamPosition();
|
||||
mDummyAvatar->updateJointLODs();
|
||||
mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
|
||||
// gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance());
|
||||
|
||||
mTextureName = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3624,16 +3624,11 @@ void LLModelPreview::update()
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLModelPreview::createPreviewAvatar( void )
|
||||
{
|
||||
mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion() );
|
||||
mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR );
|
||||
if ( mPreviewAvatar )
|
||||
{
|
||||
mPreviewAvatar->createDrawable( &gPipeline );
|
||||
mPreviewAvatar->mIsDummy = TRUE;
|
||||
mPreviewAvatar->mSpecialRenderMode = 1;
|
||||
mPreviewAvatar->setPositionAgent( LLVector3::zero );
|
||||
mPreviewAvatar->slamPosition();
|
||||
mPreviewAvatar->updateJointLODs();
|
||||
mPreviewAvatar->updateGeometry( mPreviewAvatar->mDrawable );
|
||||
mPreviewAvatar->startMotion( ANIM_AGENT_STAND );
|
||||
mPreviewAvatar->hideSkirt();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -503,11 +503,16 @@ void LLPanelObject::getState( )
|
|||
// different rules for enablement. At least the difference between
|
||||
// move and rotate looks like just a parens error, have updated accordingly.
|
||||
// <FS:Ansariel> FS always had these without the check for !objectp->isAttachment(), so keep this for now
|
||||
//BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify();
|
||||
//BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() &&
|
||||
((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) &&
|
||||
//((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() &&
|
||||
((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify();
|
||||
BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() &&
|
||||
((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) &&
|
||||
//((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
|
||||
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
|
||||
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* @file lluiavatar.cpp
|
||||
* @brief Implementation for special dummy avatar used in some UI views
|
||||
*
|
||||
* $LicenseInfo:firstyear=2017&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2017, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "lluiavatar.h"
|
||||
#include "llagent.h" // Get state values from here
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "pipeline.h"
|
||||
#include "llanimationstates.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llmeshrepository.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
LLUIAvatar::LLUIAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) :
|
||||
LLVOAvatar(id, pcode, regionp)
|
||||
{
|
||||
mIsDummy = TRUE;
|
||||
mIsUIAvatar = true;
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLUIAvatar::~LLUIAvatar()
|
||||
{
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLUIAvatar::initInstance()
|
||||
{
|
||||
LLVOAvatar::initInstance();
|
||||
|
||||
createDrawable( &gPipeline );
|
||||
setPositionAgent(LLVector3::zero);
|
||||
slamPosition();
|
||||
updateJointLODs();
|
||||
updateGeometry(mDrawable);
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* @file lluiavatar.h
|
||||
* @brief Special dummy avatar used in some UI views
|
||||
*
|
||||
* $LicenseInfo:firstyear=2017&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2017, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_UIAVATAR_H
|
||||
#define LL_UIAVATAR_H
|
||||
|
||||
#include "llvoavatar.h"
|
||||
#include "llvovolume.h"
|
||||
|
||||
class LLUIAvatar:
|
||||
public LLVOAvatar
|
||||
{
|
||||
LOG_CLASS(LLUIAvatar);
|
||||
|
||||
public:
|
||||
LLUIAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
|
||||
virtual void initInstance(); // Called after construction to initialize the class.
|
||||
virtual ~LLUIAvatar();
|
||||
};
|
||||
|
||||
#endif //LL_CONTROLAVATAR_H
|
||||
|
|
@ -6659,32 +6659,32 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data)
|
|||
LLViewerObject *objp = gObjectList.findObject(uuid);
|
||||
if (!objp)
|
||||
{
|
||||
LL_WARNS("Messaging") << "AXON Received animation state for unknown object" << uuid << LL_ENDL;
|
||||
LL_WARNS("Messaging") << "Received animation state for unknown object" << uuid << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LLVOVolume *volp = dynamic_cast<LLVOVolume*>(objp);
|
||||
if (!volp)
|
||||
{
|
||||
LL_WARNS("Messaging") << "AXON Received animation state for non-volume object" << uuid << LL_ENDL;
|
||||
LL_WARNS("Messaging") << "Received animation state for non-volume object" << uuid << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!volp->isAnimatedObject())
|
||||
{
|
||||
LL_WARNS("Messaging") << "AXON Received animation state for non-animated object" << uuid << LL_ENDL;
|
||||
LL_WARNS("Messaging") << "Received animation state for non-animated object" << uuid << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LLControlAvatar *avatarp = volp->getControlAvatar();
|
||||
if (!avatarp)
|
||||
{
|
||||
LL_WARNS("Messaging") << "AXON no control avatar, ignoring" << LL_ENDL;
|
||||
LL_WARNS("Messaging") << "Received animation request for object with no control avatar, ignoring" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList);
|
||||
LL_DEBUGS("AXON") << "processing object animation requests, num_blocks " << num_blocks << LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << "processing object animation requests, num_blocks " << num_blocks << LL_ENDL;
|
||||
|
||||
#if 1
|
||||
// Here we go into skinned mode once, the first time we get an
|
||||
|
|
@ -6729,8 +6729,8 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data)
|
|||
mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i);
|
||||
mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i);
|
||||
volp->mObjectSignaledAnimations[animation_id] = anim_sequence_id;
|
||||
LL_DEBUGS("AXON") << "got object animation request for object "
|
||||
<< uuid << " animation id " << animation_id << LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << "got object animation request for object "
|
||||
<< uuid << " animation id " << animation_id << LL_ENDL;
|
||||
}
|
||||
|
||||
avatarp->updateAnimations();
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
#include "llselectmgr.h"
|
||||
#include "llrendersphere.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
#include "lluiavatar.h"
|
||||
#include "llviewercamera.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llviewerinventory.h"
|
||||
|
|
@ -187,10 +188,16 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
|
|||
}
|
||||
else if (flags & CO_FLAG_CONTROL_AVATAR)
|
||||
{
|
||||
LLControlAvatar *avatar = new LLControlAvatar(id, pcode, regionp);
|
||||
avatar->initInstance();
|
||||
res = avatar;
|
||||
LLControlAvatar *control_avatar = new LLControlAvatar(id, pcode, regionp);
|
||||
control_avatar->initInstance();
|
||||
res = control_avatar;
|
||||
}
|
||||
else if (flags & CO_FLAG_UI_AVATAR)
|
||||
{
|
||||
LLUIAvatar *ui_avatar = new LLUIAvatar(id, pcode, regionp);
|
||||
ui_avatar->initInstance();
|
||||
res = ui_avatar;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp);
|
||||
|
|
|
|||
|
|
@ -723,6 +723,10 @@ public:
|
|||
|
||||
virtual bool isAnimatedObject() const;
|
||||
|
||||
// Flags for createObject
|
||||
static const S32 CO_FLAG_CONTROL_AVATAR = 1 << 0;
|
||||
static const S32 CO_FLAG_UI_AVATAR = 1 << 1;
|
||||
|
||||
protected:
|
||||
LLPointer<LLControlAvatar> mControlAvatar;
|
||||
|
||||
|
|
@ -736,9 +740,6 @@ protected:
|
|||
// updateInventory.
|
||||
void doUpdateInventory(LLPointer<LLViewerInventoryItem>& item, U8 key, bool is_new);
|
||||
|
||||
// Flags for createObject
|
||||
static const S32 CO_FLAG_CONTROL_AVATAR = 1 << 1;
|
||||
|
||||
static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp, S32 flags = 0);
|
||||
|
||||
BOOL setData(const U8 *datap, const U32 data_size);
|
||||
|
|
|
|||
|
|
@ -698,6 +698,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||
mCachedMuteListUpdateTime(0),
|
||||
mCachedInMuteList(false),
|
||||
mIsControlAvatar(false),
|
||||
mIsUIAvatar(false),
|
||||
mEnableDefaultMotions(true)
|
||||
{
|
||||
LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL;
|
||||
|
|
@ -2070,8 +2071,7 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLVOAvatar::releaseMeshData()
|
||||
{
|
||||
if (sInstances.size() < AVATAR_RELEASE_THRESHOLD ||
|
||||
(mIsDummy && !isControlAvatar()))
|
||||
if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || isUIAvatar())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -3983,6 +3983,10 @@ void LLVOAvatar::updateDebugText()
|
|||
LLVector3 pelvis_pos = mPelvisp->getPosition();
|
||||
debug_line += llformat(" rp %.3f pp %.3f", root_pos[2], pelvis_pos[2]);
|
||||
|
||||
S32 is_visible = (S32) isVisible();
|
||||
S32 is_m_visible = (S32) mVisible;
|
||||
debug_line += llformat(" v %d/%d", is_visible, is_m_visible);
|
||||
|
||||
addDebugText(debug_line);
|
||||
}
|
||||
|
||||
|
|
@ -4212,7 +4216,7 @@ void LLVOAvatar::computeUpdatePeriod()
|
|||
if (mDrawable.notNull()
|
||||
&& isVisible()
|
||||
&& (!isSelf() || visually_muted)
|
||||
&& !mIsDummy
|
||||
&& !isUIAvatar()
|
||||
// <FS:Ansariel> Fix LL impostor hacking; Adjust update period for muted avatars if using no impostors
|
||||
//&& sUseImpostors
|
||||
&& (sUseImpostors || isInMuteList())
|
||||
|
|
@ -4435,15 +4439,14 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time)
|
|||
// ------------------------------------------------------------------------
|
||||
void LLVOAvatar::updateTimeStep()
|
||||
{
|
||||
bool is_pure_dummy = mIsDummy && !isControlAvatar();
|
||||
// <FS:Zi> Optionally disable the usage of timesteps, testing if this affects performance or
|
||||
// creates animation issues - FIRE-3657
|
||||
//if (!isSelf() && !is_pure_dummy) // ie, non-self avatars, and animated objects will be affected.
|
||||
//if (!isSelf() && !isUIAvatar()) // ie, non-self avatars, and animated objects will be affected.
|
||||
static LLCachedControl<bool> use_timesteps(gSavedSettings, "UseAnimationTimeSteps");
|
||||
if (!isSelf() && !is_pure_dummy && use_timesteps)
|
||||
if (!isSelf() && !isUIAvatar() && use_timesteps)
|
||||
// </FS:Zi>
|
||||
{
|
||||
// AXON note that sInstances counts animated objects and
|
||||
// Note that sInstances counts animated objects and
|
||||
// standard avatars in the same bucket. Is this desirable?
|
||||
F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f);
|
||||
F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f);
|
||||
|
|
@ -4607,10 +4610,10 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w
|
|||
// LLControlAvatar and mIsDummy is true. Avatar is a purely
|
||||
// viewer-side entity with no representation on the simulator.
|
||||
//
|
||||
// 4) Avatar is a "dummy" avatar used in some areas of the UI, such as
|
||||
// when previewing uploaded animations. Class is LLVOAvatar, and
|
||||
// mIsDummy is true. Avatar is purely viewer-side with no
|
||||
// representation on the simulator.
|
||||
// 4) Avatar is a UI avatar used in some areas of the UI, such as when
|
||||
// previewing uploaded animations. Class is LLUIAvatar, and mIsDummy
|
||||
// is true. Avatar is purely viewer-side with no representation on the
|
||||
// simulator.
|
||||
//
|
||||
//------------------------------------------------------------------------
|
||||
BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
|
||||
|
|
@ -4665,7 +4668,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
// change animation time quanta based on avatar render load
|
||||
// AXON how should control avs be handled here?
|
||||
//--------------------------------------------------------------------
|
||||
// SL-763 the time step quantization does not currently work.
|
||||
//updateTimeStep();
|
||||
|
|
@ -5191,12 +5193,11 @@ U32 LLVOAvatar::renderSkinned()
|
|||
}
|
||||
|
||||
BOOL first_pass = TRUE;
|
||||
bool is_pure_dummy = mIsDummy && !isControlAvatar();
|
||||
if (!LLDrawPoolAvatar::sSkipOpaque)
|
||||
{
|
||||
if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender)
|
||||
{
|
||||
if (isTextureVisible(TEX_HEAD_BAKED) || is_pure_dummy)
|
||||
if (isTextureVisible(TEX_HEAD_BAKED) || isUIAvatar())
|
||||
{
|
||||
LLViewerJoint* head_mesh = getViewerJoint(MESH_ID_HEAD);
|
||||
if (head_mesh)
|
||||
|
|
@ -5206,7 +5207,7 @@ U32 LLVOAvatar::renderSkinned()
|
|||
first_pass = FALSE;
|
||||
}
|
||||
}
|
||||
if (isTextureVisible(TEX_UPPER_BAKED) || is_pure_dummy)
|
||||
if (isTextureVisible(TEX_UPPER_BAKED) || isUIAvatar())
|
||||
{
|
||||
LLViewerJoint* upper_mesh = getViewerJoint(MESH_ID_UPPER_BODY);
|
||||
if (upper_mesh)
|
||||
|
|
@ -5216,7 +5217,7 @@ U32 LLVOAvatar::renderSkinned()
|
|||
first_pass = FALSE;
|
||||
}
|
||||
|
||||
if (isTextureVisible(TEX_LOWER_BAKED) || is_pure_dummy)
|
||||
if (isTextureVisible(TEX_LOWER_BAKED) || isUIAvatar())
|
||||
{
|
||||
LLViewerJoint* lower_mesh = getViewerJoint(MESH_ID_LOWER_BODY);
|
||||
if (lower_mesh)
|
||||
|
|
@ -5245,7 +5246,7 @@ U32 LLVOAvatar::renderSkinned()
|
|||
U32 LLVOAvatar::renderTransparent(BOOL first_pass)
|
||||
{
|
||||
U32 num_indices = 0;
|
||||
if( isWearingWearableType( LLWearableType::WT_SKIRT ) && (mIsDummy || isTextureVisible(TEX_SKIRT_BAKED)) )
|
||||
if( isWearingWearableType( LLWearableType::WT_SKIRT ) && (isUIAvatar() || isTextureVisible(TEX_SKIRT_BAKED)) )
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.25f);
|
||||
LLViewerJoint* skirt_mesh = getViewerJoint(MESH_ID_SKIRT);
|
||||
|
|
@ -5321,9 +5322,7 @@ U32 LLVOAvatar::renderRigid()
|
|||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
}
|
||||
|
||||
bool is_pure_dummy = mIsDummy && !isControlAvatar();
|
||||
|
||||
if (isTextureVisible(TEX_EYES_BAKED) || is_pure_dummy)
|
||||
if (isTextureVisible(TEX_EYES_BAKED) || isUIAvatar())
|
||||
{
|
||||
LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT);
|
||||
LLViewerJoint* eyeball_right = getViewerJoint(MESH_ID_EYEBALL_RIGHT);
|
||||
|
|
@ -6856,8 +6855,7 @@ F32 LLVOAvatar::getTimeDilation()
|
|||
//-----------------------------------------------------------------------------
|
||||
F32 LLVOAvatar::getPixelArea() const
|
||||
{
|
||||
// AXON UPDATE FOR CONTROL AVATARS
|
||||
if (mIsDummy)
|
||||
if (isUIAvatar())
|
||||
{
|
||||
return 100000.f;
|
||||
}
|
||||
|
|
@ -7938,9 +7936,14 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
|
|||
updateMeshTextures();
|
||||
}
|
||||
|
||||
// FIXME: We have an mVisible member, set in updateVisibility(), but this
|
||||
// function doesn't return it! isVisible() and mVisible are used
|
||||
// different places for different purposes. mVisible seems to be more
|
||||
// related to whether the actual avatar mesh is shown, and isVisible()
|
||||
// to whether anything about the avatar is displayed in the scene.
|
||||
// Maybe better naming could make this clearer?
|
||||
BOOL LLVOAvatar::isVisible() const
|
||||
{
|
||||
// AXON should we flag control avs as invisible?
|
||||
return mDrawable.notNull()
|
||||
&& (!mOrphaned || isSelf())
|
||||
&& (mDrawable->isVisible() || mIsDummy);
|
||||
|
|
|
|||
|
|
@ -242,6 +242,7 @@ public:
|
|||
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
|
||||
|
||||
virtual bool isControlAvatar() const { return mIsControlAvatar; } // True if this avatar is a control av (no associated user)
|
||||
virtual bool isUIAvatar() const { return mIsUIAvatar; } // True if this avatar is a supplemental av used in some UI views (no associated user)
|
||||
|
||||
private: //aligned members
|
||||
LL_ALIGN_16(LLVector4a mImpostorExtents[2]);
|
||||
|
|
@ -473,6 +474,7 @@ public:
|
|||
//--------------------------------------------------------------------
|
||||
public:
|
||||
bool mIsControlAvatar;
|
||||
bool mIsUIAvatar;
|
||||
bool mEnableDefaultMotions;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1508,15 +1508,16 @@ BOOL LLVOVolume::updateLOD()
|
|||
|
||||
if (lod_changed)
|
||||
{
|
||||
#if 1
|
||||
// AXON debugging
|
||||
if (isAnimatedObject() && isRiggedMesh())
|
||||
if (debugLoggingEnabled("AnimatedObjectsLinkset"))
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) this);
|
||||
F32 est_tris = getEstTrianglesMax();
|
||||
LL_DEBUGS("AXONLinkset") << vobj_name << " updateLOD to " << getLOD() << ", tris " << est_tris << LL_ENDL;
|
||||
if (isAnimatedObject() && isRiggedMesh())
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) this);
|
||||
F32 est_tris = getEstTrianglesMax();
|
||||
LL_DEBUGS("AnimatedObjectsLinkset") << vobj_name << " updateLOD to " << getLOD() << ", tris " << est_tris << LL_ENDL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
|
||||
mLODChanged = TRUE;
|
||||
}
|
||||
|
|
@ -3583,10 +3584,10 @@ void LLVOVolume::setExtendedMeshFlags(U32 flags)
|
|||
param_block->setFlags(flags);
|
||||
}
|
||||
parameterChanged(LLNetworkData::PARAMS_EXTENDED_MESH, true);
|
||||
LL_DEBUGS("AXON") << (uintptr_t) this
|
||||
<< " new flags " << flags << " curr_flags " << curr_flags
|
||||
<< ", calling onSetExtendedMeshFlags()"
|
||||
<< LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << (uintptr_t) this
|
||||
<< " new flags " << flags << " curr_flags " << curr_flags
|
||||
<< ", calling onSetExtendedMeshFlags()"
|
||||
<< LL_ENDL;
|
||||
onSetExtendedMeshFlags(flags);
|
||||
}
|
||||
}
|
||||
|
|
@ -3606,18 +3607,6 @@ bool LLVOVolume::isAnimatedObject() const
|
|||
LLVOVolume *root_vol = (LLVOVolume*)getRootEdit();
|
||||
bool root_is_animated_flag = root_vol->getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG;
|
||||
return root_is_animated_flag;
|
||||
#if 0
|
||||
if (root_is_animated_flag)
|
||||
{
|
||||
bool root_can_be_animated = root_vol->canBeAnimatedObject();
|
||||
bool this_can_be_animated = (root_vol == this) ? root_can_be_animated : canBeAnimatedObject();
|
||||
if (this_can_be_animated && root_can_be_animated)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Called any time parenting changes for a volume. Update flags and
|
||||
|
|
@ -3627,13 +3616,12 @@ void LLVOVolume::updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent,
|
|||
{
|
||||
LLVOVolume *old_volp = dynamic_cast<LLVOVolume*>(old_parent);
|
||||
|
||||
// AXON - depending on whether animated objects can be attached,
|
||||
// we may want to include or remove the isAvatar() check.
|
||||
// BUG??
|
||||
if (new_parent && !new_parent->isAvatar())
|
||||
{
|
||||
if (mControlAvatar.notNull())
|
||||
{
|
||||
// Here an animated object is being made the child of some
|
||||
// other prim. Should remove the control av from the child.
|
||||
LLControlAvatar *av = mControlAvatar;
|
||||
mControlAvatar = NULL;
|
||||
av->markForDeath();
|
||||
|
|
@ -4152,17 +4140,14 @@ void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_u
|
|||
{
|
||||
U32 extended_mesh_flags = getExtendedMeshFlags();
|
||||
bool enabled = (extended_mesh_flags & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG);
|
||||
// AXON This is kind of a guess. Better if we could compare
|
||||
// the before and after flags directly. What about cases where
|
||||
// there's no control avatar for optimization reasons?
|
||||
bool was_enabled = (getControlAvatar() != NULL);
|
||||
if (enabled != was_enabled)
|
||||
{
|
||||
LL_INFOS("AXON") << (uintptr_t) this
|
||||
<< " calling onSetExtendedMeshFlags, enabled " << (U32) enabled
|
||||
<< " was_enabled " << (U32) was_enabled
|
||||
<< " local_origin " << (U32) local_origin
|
||||
<< LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << (uintptr_t) this
|
||||
<< " calling onSetExtendedMeshFlags, enabled " << (U32) enabled
|
||||
<< " was_enabled " << (U32) was_enabled
|
||||
<< " local_origin " << (U32) local_origin
|
||||
<< LL_ENDL;
|
||||
onSetExtendedMeshFlags(extended_mesh_flags);
|
||||
}
|
||||
}
|
||||
|
|
@ -4313,15 +4298,16 @@ const LLMatrix4& LLVOVolume::getWorldMatrix(LLXformMatrix* xform) const
|
|||
|
||||
void LLVOVolume::markForUpdate(BOOL priority)
|
||||
{
|
||||
#if 1
|
||||
// AXON debugging
|
||||
if (isAnimatedObject() && isRiggedMesh())
|
||||
if (debugLoggingEnabled("AnimatedObjectsLinkset"))
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) this);
|
||||
F32 est_tris = getEstTrianglesMax();
|
||||
LL_DEBUGS("AXONLinkset") << vobj_name << " markForUpdate, tris " << est_tris << LL_ENDL;
|
||||
if (isAnimatedObject() && isRiggedMesh())
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) this);
|
||||
F32 est_tris = getEstTrianglesMax();
|
||||
LL_DEBUGS("AnimatedObjectsLinkset") << vobj_name << " markForUpdate, tris " << est_tris << LL_ENDL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
LLViewerObject::markForUpdate(priority);
|
||||
mVolumeChanged = TRUE;
|
||||
}
|
||||
|
|
@ -5314,17 +5300,15 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
bool is_mesh = vobj->isMesh();
|
||||
F32 est_tris = vobj->getEstTrianglesMax();
|
||||
|
||||
#if 1
|
||||
LL_DEBUGS("AXONLinkset") << vobj_name << " rebuilding, isAttachment: " << (U32) vobj->isAttachment()
|
||||
<< " is_mesh " << is_mesh
|
||||
<< " est_tris " << est_tris
|
||||
<< " is_animated " << vobj->isAnimatedObject()
|
||||
<< " can_animate " << vobj->canBeAnimatedObject()
|
||||
<< " cav " << vobj->getControlAvatar()
|
||||
<< " playing " << (U32) (vobj->getControlAvatar() ? vobj->getControlAvatar()->mPlaying : false)
|
||||
<< " frame " << LLFrameTimer::getFrameCount()
|
||||
<< LL_ENDL;
|
||||
#endif
|
||||
LL_DEBUGS("AnimatedObjectsLinkset") << vobj_name << " rebuilding, isAttachment: " << (U32) vobj->isAttachment()
|
||||
<< " is_mesh " << is_mesh
|
||||
<< " est_tris " << est_tris
|
||||
<< " is_animated " << vobj->isAnimatedObject()
|
||||
<< " can_animate " << vobj->canBeAnimatedObject()
|
||||
<< " cav " << vobj->getControlAvatar()
|
||||
<< " playing " << (U32) (vobj->getControlAvatar() ? vobj->getControlAvatar()->mPlaying : false)
|
||||
<< " frame " << LLFrameTimer::getFrameCount()
|
||||
<< LL_ENDL;
|
||||
|
||||
llassert_always(vobj);
|
||||
|
||||
|
|
@ -5366,11 +5350,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
F32 tri_count = vobj->getRootEdit()->recursiveGetEstTrianglesMax();
|
||||
if (tri_count <= 0.f)
|
||||
{
|
||||
LL_DEBUGS("AXON") << vobj_name << " not calling linkControlAvatar(), because no tris" << LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << vobj_name << " not calling linkControlAvatar(), because no tris" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AXON") << vobj_name << " calling linkControlAvatar()" << LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << vobj_name << " calling linkControlAvatar()" << LL_ENDL;
|
||||
vobj->linkControlAvatar();
|
||||
}
|
||||
}
|
||||
|
|
@ -5386,7 +5370,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
// the checkbox has changed since the last rebuild.
|
||||
if (vobj->getControlAvatar())
|
||||
{
|
||||
LL_DEBUGS("AXON") << vobj_name << " calling unlinkControlAvatar()" << LL_ENDL;
|
||||
LL_DEBUGS("AnimatedObjects") << vobj_name << " calling unlinkControlAvatar()" << LL_ENDL;
|
||||
vobj->unlinkControlAvatar();
|
||||
}
|
||||
}
|
||||
|
|
@ -5896,15 +5880,17 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
|
|||
if (drawablep && !drawablep->isDead() && drawablep->isState(LLDrawable::REBUILD_ALL) && !drawablep->isState(LLDrawable::RIGGED) )
|
||||
{
|
||||
LLVOVolume* vobj = drawablep->getVOVolume();
|
||||
#if 1
|
||||
// AXON debugging
|
||||
if (vobj->isAnimatedObject() && vobj->isRiggedMesh())
|
||||
|
||||
if (debugLoggingEnabled("AnimatedObjectsLinkset"))
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) vobj);
|
||||
F32 est_tris = vobj->getEstTrianglesMax();
|
||||
LL_DEBUGS("AXONLinkset") << vobj_name << " rebuildMesh, tris " << est_tris << LL_ENDL;
|
||||
}
|
||||
#endif
|
||||
if (vobj->isAnimatedObject() && vobj->isRiggedMesh())
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) vobj);
|
||||
F32 est_tris = vobj->getEstTrianglesMax();
|
||||
LL_DEBUGS("AnimatedObjectsLinkset") << vobj_name << " rebuildMesh, tris " << est_tris << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
vobj->preRebuild();
|
||||
|
||||
if (drawablep->isState(LLDrawable::ANIMATED_CHILD))
|
||||
|
|
|
|||
|
|
@ -3455,17 +3455,17 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f
|
|||
{
|
||||
if (drawablep && !drawablep->isDead() && assertInitialized())
|
||||
{
|
||||
#if 1
|
||||
// AXON debugging
|
||||
LLVOVolume *vol_obj = drawablep->getVOVolume();
|
||||
if (vol_obj && vol_obj->isAnimatedObject() && vol_obj->isRiggedMesh())
|
||||
if (debugLoggingEnabled("AnimatedObjectsLinkset"))
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) vol_obj);
|
||||
F32 est_tris = vol_obj->getEstTrianglesMax();
|
||||
LL_DEBUGS("AXONLinkset") << vobj_name << " markRebuild, tris " << est_tris
|
||||
<< " priority " << (S32) priority << " flag " << std::hex << flag << LL_ENDL;
|
||||
LLVOVolume *vol_obj = drawablep->getVOVolume();
|
||||
if (vol_obj && vol_obj->isAnimatedObject() && vol_obj->isRiggedMesh())
|
||||
{
|
||||
std::string vobj_name = llformat("Vol%u", (U32) vol_obj);
|
||||
F32 est_tris = vol_obj->getEstTrianglesMax();
|
||||
LL_DEBUGS("AnimatedObjectsLinkset") << vobj_name << " markRebuild, tris " << est_tris
|
||||
<< " priority " << (S32) priority << " flag " << std::hex << flag << LL_ENDL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!drawablep->isState(LLDrawable::BUILT))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue