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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2016-07-02T05:41:37+00:00</updated>

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

		<entry>
		<author><name><![CDATA[hyyou]]></name></author>
		<updated>2016-07-02T05:41:37+00:00</updated>

		<published>2016-07-02T05:41:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37829#p37829</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37829#p37829"/>
		<title type="html"><![CDATA[Re: rayTest improvements: face normal and broad phase filter]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37829#p37829"><![CDATA[
I know that this thread is old, but I found it in the first result of google.<br><br>The commit from Quick Camel in 2008 (ben2610 ?) does not exist anymore.<br><br>Therefore, information in this page is currently very misleading.<br><br>For the current solution (2016) , please look at this link instead :-<br><br><a href="http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=11154" class="postlink">http://bulletphysics.org/Bullet/phpBB3/ ... hp?t=11154</a>  (May 2016) show a correct way to do this in<br><a href="http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&amp;t=11061&amp;p=37118&amp;hilit=compound+ray#p37118" class="postlink">http://www.bulletphysics.org/Bullet/php ... ray#p37118</a>  (Mar 2016)<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11659">hyyou</a> — Sat Jul 02, 2016 5:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ben2610]]></name></author>
		<updated>2008-09-10T20:13:12+00:00</updated>

		<published>2008-09-10T20:13:12+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10351#p10351</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10351#p10351"/>
		<title type="html"><![CDATA[Re: rayTest improvements: face normal and broad phase filter]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10351#p10351"><![CDATA[
I've posted a patch for this issue:<br><br><a href="http://code.google.com/p/bullet/issues/detail?id=91" class="postlink">http://code.google.com/p/bullet/issues/detail?id=91</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2697">ben2610</a> — Wed Sep 10, 2008 8:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ben2610]]></name></author>
		<updated>2008-09-05T06:59:21+00:00</updated>

		<published>2008-09-05T06:59:21+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10259#p10259</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10259#p10259"/>
		<title type="html"><![CDATA[Re: rayTest improvements: face normal and broad phase filter]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10259#p10259"><![CDATA[
<blockquote class="uncited"><div>Within the RayResultCallback::addSingleResult callback, the child shape for compound shape is available as rayResult.m_collisionObject-&gt;getCollisionShape(). During the rayTest against a btBvhTriangleMeshShape and btCompoundShape, the collision shape has been temporary replaced by the child shape</div></blockquote>I tested rayTest against compound object in Bullet 2.71 and the child shape is not available through the collision object: the replacement that you mention above does not happen. Is it possible to add it, or to add the shape pointer in rayResult?<br><br>/ben<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2697">ben2610</a> — Fri Sep 05, 2008 6:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ben2610]]></name></author>
		<updated>2008-08-28T12:00:05+00:00</updated>

		<published>2008-08-28T12:00:05+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10120#p10120</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10120#p10120"/>
		<title type="html"><![CDATA[Re: rayTest improvements: face normal and broad phase filter]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10120#p10120"><![CDATA[
<blockquote class="uncited"><div>(1) -&gt; override RayResultCallback::needsCollision<br>(2) -&gt; Within the RayResultCallback::addSingleResult callback, the child shape for compound shape is available as rayResult.m_collisionObject-&gt;getCollisionShape(). During the rayTest against a btBvhTriangleMeshShape and btCompoundShape, the collision shape has been temporary replaced by the child shape.<br>(3)-&gt; Same as (2), RayResultCallback::addSingleResult provides the triangle index and collision shape, so you can retrieve the original face normal and store it in your custom version of RayResultCallback.<br>(4) -&gt;During a single rayTest, you can gather ALL hits and store them in an array. Afterwards sort them to distance.</div></blockquote>(1): figured that one out<br>(2): I didn't quite see that in the code, but I'll look closer<br>(3): ok<br>(4): indeed. I was confused with the line if (hitFraction &lt;= m_resultCallback-&gt;m_closestHitFraction) in reportHit() that seems to leave out the hit points that are not closer than the previous ones but you just need to keep m_closestHitFraction at 1.0 in your custom RayResultCallback to you get all the hits.<br><blockquote class="uncited"><div>Is already someone working on upgrading to Bullet 2.70, or shall I help with that?</div></blockquote>Noone is working on it yet but I was planning to do it myself. Not sure yet when I will have the time to do it. <br><br>/ben<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2697">ben2610</a> — Thu Aug 28, 2008 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2008-08-28T05:46:28+00:00</updated>

		<published>2008-08-28T05:46:28+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10109#p10109</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10109#p10109"/>
		<title type="html"><![CDATA[Re: rayTest improvements: face normal and broad phase filter]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10109#p10109"><![CDATA[
<blockquote class="uncited"><div>I'm one of the maintainer of the Blender game engine, which uses Bullet as you know. I am working on a set of improvements for the rayCast function for which some minor changes are required in Bullet:<br>1) possibility to filter out collision objects through callback before testing the ray. This would avoid testing an object that the game engine wants to ignore in any case (X-Ray function). =&gt; this is now available in 2.70<br>It would be good to upgrade to Bullet 2.70 soon. Shall I do this, or is someone already working on this?<br>2) possibility to return the true face normal on concave mesh shapes. Currently the normal returned by the rayTest function is always oriented towards the ray origin. By returning the true face normal, the application can easily test if it is inside or outside the mesh.<br>3) possibility to retrieve the hit face on concave mesh shapes. Currently, only the triangle index is returned, which is insufficient in case of compound shape; the collision shape pointer is necessary to identify which child shape got the hit.<br>4) There is another useful feature for which I don't have a patch yet: the possibility to return more than one hit, by order of proximity.</div></blockquote>All 4 can already be performed using Bullet 2.70 without any patch necessary, it can be implemented in a derived class from RayResultCallback:<br><br>(1) -&gt; override RayResultCallback::needsCollision<br>(2) -&gt; Within the RayResultCallback::addSingleResult callback, the child shape for compound shape is available as rayResult.m_collisionObject-&gt;getCollisionShape(). During the rayTest against a btBvhTriangleMeshShape and btCompoundShape, the collision shape has been temporary replaced by the child shape.<br>(3)-&gt; Same as (2), RayResultCallback::addSingleResult provides the triangle index and collision shape, so you can retrieve the original face normal and store it in your custom version of RayResultCallback.<br>(4) -&gt;During a single rayTest, you can gather ALL hits and store them in an array. Afterwards sort them to distance.<br><br>Is already someone working on upgrading to Bullet 2.70, or shall I help with that?<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Thu Aug 28, 2008 5:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ben2610]]></name></author>
		<updated>2008-08-26T21:42:48+00:00</updated>

		<published>2008-08-26T21:42:48+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10073#p10073</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10073#p10073"/>
		<title type="html"><![CDATA[rayTest improvements: face normal and broad phase filter]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=10073#p10073"><![CDATA[
Hi there,<br><br>I'm one of the maintainer of the Blender game engine, which uses Bullet as you know. I am working on a set of improvements for the rayCast function for which some minor changes are required in Bullet:<br><br>1) possibility to filter out collision objects through callback before testing the ray. This would avoid testing an object that the game engine wants to ignore in any case (X-Ray function). =&gt; this is now available in 2.70<br><br>2) possibility to return the true face normal on concave mesh shapes. Currently the normal returned by the rayTest function is always oriented towards the ray origin. By returning the true face normal, the application can easily test if it is inside or outside the mesh.<br><br>3) possibility to retrieve the hit face on concave mesh shapes. Currently, only the triangle index is returned, which is insufficient in case of compound shape; the collision shape pointer is necessary to identify which child shape got the hit.<br><br>I've prepared a patch based on the Bullet version used in Blender (2.67?) but it won't be applicable to Bullet 2.70 because there has been several other changes in this area. I can prepare a patch for 2.70 if there is a consensus to integrate those features for the next release.<br><br>The patch can be found <a href="http://home.scarlet.be/~tsi46445/blender/bullet_face_normal.patch" class="postlink">here</a><br><br>There is another useful feature for which I don't have a patch yet: the possibility to return more than one hit, by order of proximity. This would require sorting the hits rather than keeping the closest one only.  Currently this function can be implemented by running multiple rayTest, each starting from the hit point of the previous rayTest. But it would be faster and more reliable to sort the hit points during the first run of rayTest as the algorithm computes them all in any case.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2697">ben2610</a> — Tue Aug 26, 2008 9:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
