<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/9831" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-03-17T11:01:28+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/9831</id>

		<entry>
		<author><name><![CDATA[TheSHEEEP]]></name></author>
		<updated>2014-03-17T11:01:28+00:00</updated>

		<published>2014-03-17T11:01:28+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33170#p33170</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33170#p33170"/>
		<title type="html"><![CDATA[How to have gContactProcessedCallback called only once?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33170#p33170"><![CDATA[
Hey,<br><br>Here's what I want to do:<br>Imagine a bunch of crates dropping down on a floor. Whenever a crate collides with another crate or the floor, I want to fire an event (like triggering a sound).<br><br>Currently, I registered my own function for gContactProcessedCallback to get a notification when something collides so I can react to this. This works rather well, but the function is called on each collision between two objects. So if the crate slides along the floor, I get numerous notifications along the way. But I only want to get notified when they collide for the first time or with a new object.<br><br>So, it currently works like this:<br>1. Crate A collides with crate B. Event is fired.<br>2. Crate A collides with crate B again. Event is fired.<br>3. Crate A collides with floor. Event is fired.<br>4. Crate A collides with floor. Event is fired.<br>5. Crate A collides with floor. Event is fired.<br>6. Crate A collides with floor. Event is fired.<br>7. Crate A collides with crate B again. Event is fired.<br>8. Crate A collides with crate B again. Event is fired.<br><br>I want it to work like this:<br>1. Crate A collides with crate B. Event is fired.<br>2. Crate A collides with crate B again.<br>3. Crate A collides with floor. Event is fired.<br>4. Crate A collides with floor. <br>5. Crate A collides with floor. <br>6. Crate A collides with floor. <br>7. Crate A collides with crate B again. Event is fired.<br>8. Crate A collides with crate B again.<br><br>Of course I could keep track of this myself, wouldn't be too hard (just remember the last collision "partner" and fire the event when that changes).<br>But as this automatically works like expected in PhysX, for example, I thought there may be a way to achieve this by applying some settings or flags to the rigid bodies or the world.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10760">TheSHEEEP</a> — Mon Mar 17, 2014 11:01 am</p><hr />
]]></content>
	</entry>
	</feed>
