[vtk-developers] GetNumberOfContacts()?
qhsoft0012
qhsoft0012 at 163.com
Mon Apr 17 04:36:35 EDT 2006
hi;
Who can tell me why numContact is always 0.Acturally two actors have been collided;
vtkMatrix4x4 *matrix0=vtkMatrix4x4::New();
vtkMatrix4x4 *matrix1=vtkMatrix4x4::New();
vtkCollisionDetectionFilter *CollisDetec=vtkCollisionDetectionFilter::New();
collide->SetInput(0,(vtkPolyData *)this->Actortemp->GetMapper()->GetInput());
collide->SetMatrix(0,matrix0);
collide->SetInput(1,(vtkPolyData *)this->Actor1->GetMapper()->GetInput());
collide->SetMatrix(1,matrix1);
collide->SetBoxTolerance(0.0);
collide->SetCellTolerance(0.0);
collide->SetNumberOfCellsPerBucket(2);
collide->GetCollisionModeMaxValue();
collide->GeneratePolydataOutputOn();
//-------------------------------------------------
int numContact;
for(i=0;i<90;i++)
{
this->renWin->Render();
this->Actor1->RotateWXYZ(1,0,0,-1);
numContacts=CollisDetec->GetNumberOfContacts();
if(numContacts>0)
MessageBox("sdf0",NULL,MB_OK);
}
for(i=0;i<90;i++)
{
this->renWin->Render();
this->Actortemp->RotateWXYZ(1,0,1,0);
Source=this->Actortemp->GetMapper()->GetInput()->GetSource();
numContact=CollisDetec->GetNumberOfContacts();
if(numContact>0)
MessageBox("sdf0",NULL,MB_OK);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20060417/d54c7f28/attachment.htm>
More information about the vtk-developers
mailing list