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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-10-01T16:40:37+00:00</updated>

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

		<entry>
		<author><name><![CDATA[jtm]]></name></author>
		<updated>2006-10-01T16:40:37+00:00</updated>

		<published>2006-10-01T16:40:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2006#p2006</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2006#p2006"/>
		<title type="html"><![CDATA[Determining normal of collision]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2006#p2006"><![CDATA[
Thanks this is what I'm looking for. At the moment I'm still using 2.0e but I <br>plan to update to the latest refactored version soon. The collision callback I was referring to is the old one from CcdPhysicsEnvironment. Basically what I'm interested in doing is getting the rough contact position between the ball and the track and calculating the normal based on that so that I can change the ball's gravity vector and have it 'stick' to the track no matter what angle the surface is. <br><br>I'd also like to mention that I'm having a lot of fun playing with Bullet. Concave mesh support is really useful and makes life quite a bit easier. I'll release some screenshots of the game soon once its a bit further along.<br><br>Cheers,<br><br>-JtM<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=948">jtm</a> — Sun Oct 01, 2006 4:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-10-01T16:23:05+00:00</updated>

		<published>2006-10-01T16:23:05+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2005#p2005</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2005#p2005"/>
		<title type="html"><![CDATA[Determining normal of collision]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2005#p2005"><![CDATA[
Are you using the latest Bullet 2.11 version? A large refactoring and cleanup got rid of a lot of things, including CcdPhysicsEnvironment, which is replaced by btDynamicsWorld derived classes.<br><br>Which Collision Callback are you referring to? <br>All contact points are available in the btCollisionWorld, see the CollisionInterfaceDemo to access them, throught the btPersistentManifold:<br><div class="codebox"><p>Code: </p><pre><code>int numManifolds = collisionWorld-&gt;getDispatcher()-&gt;getNumManifolds();for (i=0;i&lt;numManifolds;i++){btPersistentManifold* contactManifold = collisionWorld-&gt;getDispatcher()-&gt;getManifoldByIndexInternal(i);btCollisionObject* obA = static_cast&lt;btCollisionObject*&gt;(contactManifold-&gt;getBody0());btCollisionObject* obB = static_cast&lt;btCollisionObject*&gt;(contactManifold-&gt;getBody1());contactManifold-&gt;refreshContactPoints(obA-&gt;m_worldTransform,obB-&gt;m_worldTransform);int numContacts = contactManifold-&gt;getNumContacts();for (int j=0;j&lt;numContacts;j++){btManifoldPoint&amp; pt = contactManifold-&gt;getContactPoint(j);glBegin(GL_LINES);glColor3f(1, 0, 1);btVector3 ptA = pt.getPositionWorldOnA();btVector3 ptB = pt.getPositionWorldOnB();glVertex3d(ptA.x(),ptA.y(),ptA.z());glVertex3d(ptB.x(),ptB.y(),ptB.z());glEnd();}//you can un-comment out this line, and then all points are removed//contactManifold-&gt;clearManifold();}</code></pre></div>There is also a global callback for each newly added contact point, and for each destroyed contact point. See ConcaveDemo for an example. However, for existing contact points, there is no callback, they are just kept and updated in the btPersistentManifold class for the two involved btCollisionObjects.<br><br>We might add some API/utility functions to get easier access, based on what users want.<br><br>Thanks for the feedback,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Sun Oct 01, 2006 4:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jtm]]></name></author>
		<updated>2006-10-01T09:13:06+00:00</updated>

		<published>2006-10-01T09:13:06+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1998#p1998</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1998#p1998"/>
		<title type="html"><![CDATA[Determining normal of collision]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=1998#p1998"><![CDATA[
Hey,<br><br>I'm using bullet to make a game where a ball shaped vehicle races around a track. I would like to be able to determine the normal of the point where the ball touches the track. I noticed that the collision callback doesn't actually provide collision data. Is there a way for me to get this information elsewhere, i.e. in the CollisionWorld class?<br><br>Cheers,<br><br>-JtM<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=948">jtm</a> — Sun Oct 01, 2006 9:13 am</p><hr />
]]></content>
	</entry>
	</feed>
