summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjointattachment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerjointattachment.cpp')
-rw-r--r--indra/newview/llviewerjointattachment.cpp52
1 files changed, 21 insertions, 31 deletions
diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp
index 18c99f7453..8b653b6430 100644
--- a/indra/newview/llviewerjointattachment.cpp
+++ b/indra/newview/llviewerjointattachment.cpp
@@ -38,9 +38,11 @@
#include "llviewercontrol.h"
#include "lldrawable.h"
#include "llgl.h"
+#include "llglimmediate.h"
#include "llvoavatar.h"
#include "llvolume.h"
#include "pipeline.h"
+#include "llspatialpartition.h"
#include "llinventorymodel.h"
#include "llviewerobjectlist.h"
#include "llface.h"
@@ -56,7 +58,6 @@ extern LLPipeline gPipeline;
LLViewerJointAttachment::LLViewerJointAttachment() :
mJoint(NULL),
mAttachedObject(NULL),
-mAttachmentDirty(FALSE),
mVisibleInFirst(FALSE),
mGroup(0),
mIsHUDAttachment(FALSE),
@@ -90,36 +91,18 @@ U32 LLViewerJointAttachment::drawShape( F32 pixelArea, BOOL first_pass )
{
LLGLDisable cull_face(GL_CULL_FACE);
- glColor4f(1.f, 1.f, 1.f, 1.f);
- glBegin(GL_QUADS);
+ gGL.color4f(1.f, 1.f, 1.f, 1.f);
+ gGL.begin(GL_QUADS);
{
- glVertex3f(-0.1f, 0.1f, 0.f);
- glVertex3f(-0.1f, -0.1f, 0.f);
- glVertex3f(0.1f, -0.1f, 0.f);
- glVertex3f(0.1f, 0.1f, 0.f);
- }glEnd();
+ gGL.vertex3f(-0.1f, 0.1f, 0.f);
+ gGL.vertex3f(-0.1f, -0.1f, 0.f);
+ gGL.vertex3f(0.1f, -0.1f, 0.f);
+ gGL.vertex3f(0.1f, 0.1f, 0.f);
+ }gGL.end();
}
return 0;
}
-//-----------------------------------------------------------------------------
-// lazyAttach()
-//-----------------------------------------------------------------------------
-void LLViewerJointAttachment::lazyAttach()
-{
- if (!mAttachedObject)
- {
- return;
- }
- LLDrawable *drawablep = mAttachedObject->mDrawable;
-
- if (mAttachmentDirty && drawablep)
- {
- setupDrawable(drawablep);
- mAttachmentDirty = FALSE;
- }
-}
-
void LLViewerJointAttachment::setupDrawable(LLDrawable* drawablep)
{
drawablep->mXform.setParent(&mXform); // LLViewerJointAttachment::lazyAttach
@@ -211,13 +194,14 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
if (drawablep)
{
+ //if object is active, make it static
+ if(drawablep->isActive())
+ {
+ drawablep->makeStatic() ;
+ }
+
setupDrawable(drawablep);
}
- else
- {
- // do lazy update once we have a drawable for this object
- mAttachmentDirty = TRUE;
- }
if (mIsHUDAttachment)
{
@@ -251,6 +235,12 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object)
if (object->mDrawable.notNull())
{
+ //if object is active, make it static
+ if(object->mDrawable->isActive())
+ {
+ object->mDrawable->makeStatic() ;
+ }
+
LLVector3 cur_position = object->getRenderPosition();
LLQuaternion cur_rotation = object->getRenderRotation();