diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 559c802f51..c11a6f289b 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3937,15 +3937,30 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor -{ - LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {} - U8 mValue; +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( mValue ); + object->setPhysicsShapeType( mType ); + object->setPhysicsGravity(mGravity); + object->setPhysicsFriction(mFriction); + object->setPhysicsDensity(mDensity); + object->setPhysicsRestitution(mRestitution); object->updateFlags(); } return true; @@ -3953,10 +3968,11 @@ struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type) +void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, F32 friction, + F32 density, F32 restitution) { llwarns << "physics shape type ->" << (U32)type << llendl; - LLSelectMgrApplyPhysicsShapeType func(type); + LLSelectMgrApplyPhysicsParam func(type, gravity, friction, density, restitution); getSelection()->applyToObjects(&func); } |