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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2010-04-22T09:25:36+00:00</updated>

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

		<entry>
		<author><name><![CDATA[biaggi]]></name></author>
		<updated>2010-04-22T09:25:36+00:00</updated>

		<published>2010-04-22T09:25:36+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18318#p18318</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18318#p18318"/>
		<title type="html"><![CDATA[Re: Getting collision array from bullet]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18318#p18318"><![CDATA[
Sorry, this is a situation for RTFM <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I missunderstood the wiki page <a href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Callbacks_and_Triggers" class="postlink">http://bulletphysics.org/mediawiki-1.5. ... d_Triggers</a><blockquote class="uncited"><div>LOGV("collisions detected");<br>        int numManifolds = pDynamicsWorld-&gt;getDispatcher()-&gt;getNumManifolds();<br>logdi(numManifolds);<br>        for (int i=0;i&lt;numManifolds;i++)<br>        {<br>                btPersistentManifold* contactManifold =  pDynamicsWorld-&gt;getDispatcher()-&gt;getManifoldByIndexInternal(i);<br>                btCollisionObject* obA = static_cast&lt;btCollisionObject*&gt;(contactManifold-&gt;getBody0());<br>                btCollisionObject* obB = static_cast&lt;btCollisionObject*&gt;(contactManifold-&gt;getBody1());<br><br>                int numContacts = contactManifold-&gt;getNumContacts();<br>                for (int j=0;j&lt;numContacts;j++)<br>                {<br>                        btManifoldPoint&amp; pt = contactManifold-&gt;getContactPoint(j);<br>                        if (pt.getDistance()&lt;0.f)<br>                        {<br>                                jclass bullet_clazz = env-&gt;GetObjectClass(thiz);<br>                                jmethodID bullet_resultSimulation_mid = env-&gt;GetMethodID(bullet_clazz, "collisionDetected", "(II)V");<br>                                env-&gt;CallVoidMethod(thiz, bullet_resultSimulation_mid, (int)btRigidBody::upcast(obA), (int)btRigidBody::upcast(obB));<br>                        }<br>                }<br><br>        }</div></blockquote><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=6575">biaggi</a> — Thu Apr 22, 2010 9:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[biaggi]]></name></author>
		<updated>2010-04-21T18:45:17+00:00</updated>

		<published>2010-04-21T18:45:17+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18310#p18310</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18310#p18310"/>
		<title type="html"><![CDATA[Getting collision array from bullet]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18310#p18310"><![CDATA[
Hi, im new in bullet, I'm trying to use it on android using jni calls, the proyect is public, so you can check it out at <a href="http://code.google.com/p/android-2d-engine/" class="postlink">http://code.google.com/p/android-2d-engine/</a><br><br>The question seems to be simple, but it causes me a lot of headheaches, I'm trying to just detect who rigidbody is colliding with another one, and return an array with all collisions to android to be managed there, a simple callback, but i cant manage to get that info from the engine.<br><br>The last approach was this code from the bullets wiki:<br><blockquote class="uncited"><div>LOGV("collisions detected");<br>        int numManifolds = pDynamicsWorld-&gt;getDispatcher()-&gt;getNumManifolds();<br>logdi(numManifolds);<br>        for (int i=0;i&lt;numManifolds;i++)<br>        {<br>                btPersistentManifold* contactManifold =  pDynamicsWorld-&gt;getDispatcher()-&gt;getManifoldByIndexInternal(i);<br>                btCollisionObject* obA = static_cast&lt;btCollisionObject*&gt;(contactManifold-&gt;getBody0());<br>                btCollisionObject* obB = static_cast&lt;btCollisionObject*&gt;(contactManifold-&gt;getBody1());<br>        logdi((int)btRigidBody::upcast(obA));<br>        logdi((int)btRigidBody::upcast(obB));<br><br>                jclass bullet_clazz = env-&gt;GetObjectClass(thiz);<br>                jmethodID bullet_resultSimulation_mid = env-&gt;GetMethodID(bullet_clazz, "collisionDetected", "(II)V");<br>                env-&gt;CallVoidMethod(thiz, bullet_resultSimulation_mid, (int)btRigidBody::upcast(obA), (int)btRigidBody::upcast(obB));<br>        }</div></blockquote>But I keep getting "false collisions", obviously this is not what i prettend to do, I'be been reading a lot about bullet physics, but now i'm pretty stalled with this algorithm.<br><br>I just want an array like collisions[] = (objA =&gt; rigidBody, objB =&gt; rigidBody).<br><br>Any help or pointer to document please?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=6575">biaggi</a> — Wed Apr 21, 2010 6:45 pm</p><hr />
]]></content>
	</entry>
	</feed>
