Пример #1
0
BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
{
	llassert(mInfo == NULL);
	if (info->mID < 0)
		return FALSE;
	mInfo = info;
	mID = info->mID;
	setWeight(getDefaultWeight(), FALSE );

	LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
	for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
	{
		LLPolySkeletalBoneInfo *bone_info = &(*iter);
		LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
		if (!joint)
		{
			llwarns << "Joint " << bone_info->mBoneName << " not found." << llendl;
			continue;
		}

		if (mJointScales.find(joint) != mJointScales.end())
		{
			llwarns << "Scale deformation already supplied for joint " << joint->getName() << "." << llendl;
		}

		// store it
		mJointScales[joint] = bone_info->mScaleDeformation;

		// apply to children that need to inherit it
		for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
			 iter != joint->mChildren.end(); ++iter)
		{
			LLViewerJoint* child_joint = (LLViewerJoint*)(*iter);
			if (child_joint->inheritScale())
			{
				LLVector3 childDeformation = LLVector3(child_joint->getScale());
				childDeformation.scaleVec(bone_info->mScaleDeformation);
				mJointScales[child_joint] = childDeformation;
			}
		}

		if (bone_info->mHasPositionDeformation)
		{
			if (mJointOffsets.find(joint) != mJointOffsets.end())
			{
				llwarns << "Offset deformation already supplied for joint " << joint->getName() << "." << llendl;
			}
			mJointOffsets[joint] = bone_info->mPositionDeformation;
		}
	}
	return TRUE;
}
Пример #2
0
void showJointPosOverrides( const LLJoint& joint, const std::string& note, const std::string& av_info )
{
        std::ostringstream os;
        os << joint.m_posBeforeOverrides;
        joint.m_attachmentOverrides.showJointPosOverrides(os);
        LL_DEBUGS("Avatar") << av_info << " joint " << joint.getName() << " " << note << " " << os.str() << LL_ENDL;
}
Пример #3
0
	void lljoint_object::test<4>()
	{
		LLJoint parent;
		std::string str1 = "LLJoint", str2;
		parent.setName(str1);
		str2 = parent.getName();
		ensure("setName() failed ", (str1 == str2));
	}