<?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/532" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-09-19T08:26:23+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Sheikh Dawood]]></name></author>
		<updated>2006-09-19T08:26:23+00:00</updated>

		<published>2006-09-19T08:26:23+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1780#p1780</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1780#p1780"/>
		<title type="html"><![CDATA[CcdPhysicsEnvironment Callback Triggers]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1780#p1780"><![CDATA[
Thanks!<br><br>It works but I also have to include addSensor() to call requestCollisionCallback()<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=868">Sheikh Dawood</a> — Tue Sep 19, 2006 8:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-09-19T07:29:53+00:00</updated>

		<published>2006-09-19T07:29:53+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1779#p1779</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1779#p1779"/>
		<title type="html"><![CDATA[CcdPhysicsEnvironment Callback Triggers]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1779#p1779"><![CDATA[
You can register your callback function using this interface:<div class="codebox"><p>Code: </p><pre><code>void CcdPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)</code></pre></div>Then for each object that you requested a collision callback, this callback function will be called.<div class="codebox"><p>Code: </p><pre><code>void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl)</code></pre></div><br>For example:<div class="codebox"><p>Code: </p><pre><code> static bool newCollisionResponse(void *client_data, void *object1, void *object2, const PHY_CollData *coll_data){//process the collision    PHY_IPhysicsController* obj1 = static_cast&lt;PHY_IPhysicsController*&gt;(object1);    PHY_IPhysicsController* obj2 = static_cast&lt;PHY_IPhysicsController*&gt;(object2);//you can also cast to a CcdPhysicsController if necessary//...//coll_data is 0 at the moment, this is reserved for future usereturn false;}</code></pre></div><div class="codebox"><p>Code: </p><pre><code>MyClass* client_data =0;//optionally this 'client_data' can be some class. Then, in the callback you can jump from a static function into that class, to keep things object oriented.//register this callback physEnv-&gt;addTouchCallback(PHY_OBJECT_RESPONSE, newCollisionResponse, client_data);</code></pre></div>It's probably best to add a Demo that shows the usage, and add this to the documentation/user manual.<br>Thanks,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Tue Sep 19, 2006 7:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sheikh Dawood]]></name></author>
		<updated>2006-09-19T07:05:02+00:00</updated>

		<published>2006-09-19T07:05:02+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1778#p1778</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1778#p1778"/>
		<title type="html"><![CDATA[CcdPhysicsEnvironment Callback Triggers]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1778#p1778"><![CDATA[
Hi,<br><br>I'm a junior programmer and trying to use the callback trigger feature in the CcdPhysicsDemo app. After adding a physics object into the m_triggerControllers by using the requestCollisionCallback function, how do I catch a callback collision event in the CcdPhysicsDemo class?<br><br>I'm trying to capture this collision event to create my own collision response of one of the objects.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=868">Sheikh Dawood</a> — Tue Sep 19, 2006 7:05 am</p><hr />
]]></content>
	</entry>
	</feed>
