diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 140 |
1 files changed, 100 insertions, 40 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 305b629cf7..8ffbd5510d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1889,6 +1889,103 @@ BOOL LLSelectMgr::selectionGetGlow(F32 *glow) return identical; } + +void LLSelectMgr::selectionSetPhysicsType(U8 type) +{ + struct f : public LLSelectedObjectFunctor + { + U8 mType; + f(const U8& t) : mType(t) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsShapeType(mType); + object->updateFlags(); + } + return true; + } + } sendfunc(type); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetFriction(F32 friction) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mFriction; + f(const F32& friction) : mFriction(friction) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsFriction(mFriction); + object->updateFlags(); + } + return true; + } + } sendfunc(friction); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetGravity(F32 gravity ) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mGravity; + f(const F32& gravity) : mGravity(gravity) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsGravity(mGravity); + object->updateFlags(); + } + return true; + } + } sendfunc(gravity); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetDensity(F32 density ) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mDensity; + f(const F32& density ) : mDensity(density) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsDensity(mDensity); + object->updateFlags(); + } + return true; + } + } sendfunc(density); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetRestitution(F32 restitution) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mRestitution; + f(const F32& restitution ) : mRestitution(restitution) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsRestitution(mRestitution); + object->updateFlags(); + } + return true; + } + } sendfunc(restitution); + getSelection()->applyToObjects(&sendfunc); +} + + //----------------------------------------------------------------------------- // selectionSetMaterial() //----------------------------------------------------------------------------- @@ -3936,45 +4033,6 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor -{ - LLSelectMgrApplyPhysicsParam(U8 type, F32 gravity, F32 friction, - F32 density, F32 restitution) : - mType(type), - mGravity(gravity), - mFriction(friction), - mDensity(density), - mRestitution(restitution) - {} - U8 mType; - F32 mGravity; - F32 mFriction; - F32 mDensity; - F32 mRestitution; - virtual bool apply(LLViewerObject* object) - { - if ( object->permModify() ) // preemptive permissions check - { - object->setPhysicsShapeType( mType ); - object->setPhysicsGravity(mGravity); - object->setPhysicsFriction(mFriction); - object->setPhysicsDensity(mDensity); - object->setPhysicsRestitution(mRestitution); - object->updateFlags(); - } - return true; - } -}; - - -void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, F32 friction, - F32 density, F32 restitution) -{ - llwarns << "physics shape type ->" << (U32)type << llendl; - LLSelectMgrApplyPhysicsParam func(type, gravity, friction, density, restitution); - getSelection()->applyToObjects(&func); -} - //---------------------------------------------------------------------- // Helpful packing functions for sendObjectMessage() //---------------------------------------------------------------------- @@ -5432,13 +5490,15 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); - + BOOL is_hud_object = objectp->isHUDAttachment(); if (!is_hud_object) { glLoadIdentity(); glMultMatrixd(gGLModelView); + LLVector3 trans = objectp->getRegion()->getOriginAgent(); + glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); } if (drawable->isActive()) |