コード例 #1
0
void LLViewerJointAttachment::setupDrawable(LLViewerObject *object)
{
	if (!object->mDrawable)
		return;
	if (object->mDrawable->isActive())
	{
		object->mDrawable->makeStatic(FALSE);
	}

	object->mDrawable->mXform.setParent(getXform()); // LLViewerJointAttachment::lazyAttach
	object->mDrawable->makeActive();
	LLVector3 current_pos = object->getRenderPosition();
	LLQuaternion current_rot = object->getRenderRotation();
	LLQuaternion attachment_pt_inv_rot = ~(getWorldRotation());

	current_pos -= getWorldPosition();
	current_pos.rotVec(attachment_pt_inv_rot);

	current_rot = current_rot * attachment_pt_inv_rot;

	object->mDrawable->mXform.setPosition(current_pos);
	object->mDrawable->mXform.setRotation(current_rot);
	gPipeline.markMoved(object->mDrawable);
	gPipeline.markTextured(object->mDrawable); // face may need to change draw pool to/from POOL_HUD
	object->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
	
	if(mIsHUDAttachment)
	{
		for (S32 face_num = 0; face_num < object->mDrawable->getNumFaces(); face_num++)
		{
			object->mDrawable->getFace(face_num)->setState(LLFace::HUD_RENDER);
		}
	}

	LLViewerObject::const_child_list_t& child_list = object->getChildren();
	for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
		 iter != child_list.end(); ++iter)
	{
		LLViewerObject* childp = *iter;
		if (childp && childp->mDrawable.notNull())
		{
			childp->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
			gPipeline.markTextured(childp->mDrawable); // face may need to change draw pool to/from POOL_HUD
			gPipeline.markMoved(childp->mDrawable);

			if(mIsHUDAttachment)
			{
				for (S32 face_num = 0; face_num < childp->mDrawable->getNumFaces(); face_num++)
				{
					childp->mDrawable->getFace(face_num)->setState(LLFace::HUD_RENDER);
				}
			}
		}
	}
}
コード例 #2
0
Abc::M44d AbcObjectCache::getXformMatrix(int index)
{
   if(iXformMap.find(index) == iXformMap.end()){
      AbcG::XformSample sample;
      getXform();
      pObjXform->getSchema().get(sample, index);
      Abc::M44d mat = sample.getMatrix();
      iXformMap[index] = mat;
      return mat;
   }
   return iXformMap[index];
}
コード例 #3
0
ファイル: ivselector.cpp プロジェクト: AbuShaqra/openrave
void IvDragger::_GetMatrix(SbMatrix &matrix, SoNode *root, SoNode *node)
{
    SoGetMatrixAction getXform(_viewer.lock()->GetViewer()->getViewportRegion());

    // get a path from the root to the node

    SoSearchAction mySearchAction;
    mySearchAction.setNode(node);
    mySearchAction.setInterest(SoSearchAction::FIRST);
    mySearchAction.apply(root);

    // get the transformation matrix

    getXform.apply(mySearchAction.getPath());
    matrix = getXform.getMatrix();
}