Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Physx 3 and Contact-Modify-Callbacks with "swept boundaries-shapes" (CCD)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Max Power   Members   -  Reputation: 121

Like
0Likes
Like

Posted 06 September 2012 - 08:34 AM

Hi, I am using this simple filterShader to generate onContactModifyCallbacks with certain shapes. It works well with "normal" collisions, but when "swept integration" is involved, no onContactModify-call gets made. The collision detection itself is fine. Any idea what I should do?


PxFilterFlags FilterShader(
		PxFilterObjectAttributes attributes0, PxFilterData filterData0,
		PxFilterObjectAttributes attributes1, PxFilterData filterData1,
		PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize)
{
  if (filterData0.word1 && filterData1.word1)// both are "small", projectile-like objects and dont collide
  {
	return PxFilterFlag::eSUPPRESS;
  }
  else if (filterData0.word0 || filterData1.word0)// one or both of them are "triggerable" and modifyContact should be called
  {
	pairFlags = PxPairFlag::eCONTACT_DEFAULT | PxPairFlag::eNOTIFY_TOUCH_FOUND | PxPairFlag::eMODIFY_CONTACTS
	 | PxPairFlag::eNOTIFY_CONTACT_POINTS | PxPairFlag::eSWEPT_INTEGRATION_LINEAR;
  }
  else
  {
	pairFlags = PxPairFlag::eCONTACT_DEFAULT;
  }
  return PxFilterFlag::eDEFAULT;
}

From testing I know, that swept-integration contacts do get processed here like any other contacts and the pairFlags get set in the same way. Still no contact-modify-call...

Edited by Max Power, 06 September 2012 - 09:22 AM.


Sponsor:

#2 Max Power   Members   -  Reputation: 121

Like
0Likes
Like

Posted 06 September 2012 - 01:50 PM

So I have done what, for my purposes, I should have done in the first place and used the simulation-event-callback::onContact instead, because i don't really want to modify the physical properties of the collision anyway. Now the CCD/sweep-collisions trigger as they should, but there's another problem: unlike conventional collisions, the point-data for CCD-contacts comes without impulse-vectors (or 0,0,0-vectors that is), even though the contact-positions are given. Does anyone here know anything about it and maybe how to get that data?

Edited by Max Power, 06 September 2012 - 02:48 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS