/*
void ParticleMesherObject::GetWorldBoundBox(TimeValue t, INode * inode, ViewExp* vp, Box3& box )   
   {
   box.Init();
   Matrix3 mat = inode->GetObjectTM(t);
   Point3 a(-10.0f,-10.0f,-10.0f);
   Point3 b(10.0f,10.0f,10.0f);
   a = a * mat;
   b = b * mat;
   box+= a;
   box+= b;

   }
void ParticleMesherObject::GetLocalBoundBox(TimeValue t, INode* inode, ViewExp* vp, Box3& box ) 
   {
   box.Init();
   Point3 a(-10.0f,-10.0f,-10.0f);
   Point3 b(10.0f,10.0f,10.0f);
   box+= a;
   box+= b;

   }
   */
void ParticleMesherObject::GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel )  
   {
   BOOL useBounds;
   pblock2->GetValue(particlemesher_usecustombounds, 0, useBounds, FOREVER);
   if (useBounds)
      {
      box.Init();

      Point3 a(-10.0f,-10.0f,-10.0f);
      Point3 b(10.0f,10.0f,10.0f);
      pblock2->GetValue(particlemesher_customboundsa, 0, a, FOREVER);
      pblock2->GetValue(particlemesher_customboundsb, 0, b, FOREVER);
      if (tm)
         {
         a = a * *tm;
         b = b * *tm;
         }
      box+= a;
      box+= b;
      if (box.IsEmpty())
         SimpleObject2::GetDeformBBox(t,box,tm,useSel);
      }
   else
      {
      SimpleObject2::GetDeformBBox(t,box,tm,useSel);
      }

   }
void ParticleMesherObject::UpdateUI()
{
   Point3 min,max;
   pblock2->GetValue(particlemesher_customboundsa,0,min,FOREVER);
   pblock2->GetValue(particlemesher_customboundsb,0,max,FOREVER);


   Box3 box;
   box.Init();
   box += min;
   box += max;

   
   TSTR text;
   BOOL useBounds;
   pblock2->GetValue(particlemesher_usecustombounds, 0, useBounds, FOREVER);

   if (useBounds)
      {
      if (box.IsEmpty())
         text.printf(_T("%s"),GetString(IDS_EMPTY));
      else 
         {
         text.printf(_T("(%0.0f,%0.0f,%0.0f)"),min.x,min.y,min.z);
         SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT),
            text);
         text.printf(_T("(%0.0f,%0.0f,%0.0f)"),max.x,max.y,max.z);
         SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT2),
            text);
         }

//make sure we only enable the button in the modify panel
// bug 257747 1/30/01 watje
      if (ip)
         {
         ICustButton *iBut = GetICustButton(GetDlgItem(hParams,IDC_PICKBB));
         if (ip->GetCommandPanelTaskMode()==TASK_MODE_MODIFY)
            {
            if (iBut) iBut->Enable(TRUE);
            }
         ReleaseICustButton(iBut);
         }

      }
   else
      {
      text.printf(_T(" "));
      SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT),
         text);
      text.printf(_T(" "));
      SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT2),
         text);
      ICustButton *iBut = GetICustButton(GetDlgItem(hParams,IDC_PICKBB));
      if (iBut) iBut->Enable(FALSE);
      ReleaseICustButton(iBut);

      }
   
}
Example #3
0
void SimpleParticle::GetLocalBoundBox(TimeValue t, INode *inode,ViewExp* /*vpt*/,  Box3& box ) 
	{
	Matrix3 mat = inode->GetObjTMBeforeWSM(t);
	Box3 pbox;
	Update(t,inode);
	box  = mesh.getBoundingBox();
	pbox = parts.BoundBox();
	if (!pbox.IsEmpty()) box += pbox * Inverse(mat);
	}
Example #4
0
void SimpleParticle::GetWorldBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box )
	{
	Box3 pbox;
	Matrix3 mat = inode->GetObjTMBeforeWSM(t);	
	UpdateMesh(t);
	box  = mesh.getBoundingBox();
	box  = box * mat;
	pbox = parts.BoundBox();	
	if (!pbox.IsEmpty()) box += pbox;	
	}
Example #5
0
void TriObject::GetWorldBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box )
	{

	if ( ! vpt || ! vpt->IsAlive() )
	{
		box.Init();
		return;
	}

	Box3	meshBox;

	Matrix3 mat = inode->GetObjectTM(t);
	
	GetLocalBoundBox(t,inode,vpt,meshBox);
	if(meshBox.IsEmpty())
		box = meshBox;
	else {
		box.Init();
		for(int i = 0; i < 8; i++)
			box += mat * meshBox[i];
		}
	}