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

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

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

		<entry>
		<author><name><![CDATA[he3117]]></name></author>
		<updated>2014-09-21T08:57:26+00:00</updated>

		<published>2014-09-21T08:57:26+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=34035#p34035</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=34035#p34035"/>
		<title type="html"><![CDATA[Big changes to bullet source(@ bullet developers)]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=34035#p34035"><![CDATA[
Hi<br>I'm new to bullet physic but I'm working on video games in past few years and I have experience by other physic engines like havok and physx.<br>For my new project (a racing game)I want to use bullet physic.I tried to port my other project that used physx to use bullet but I found some missing futures in bullet and I want to ask them here before trying to implement them my self.<br><strong class="text-strong">future I like to see in bullet:<br><br>1-contact modification<br>2-better way for filtering<br>3-a more general way for callbacks and customizations<br></strong><br>this can be a long post so the bottom line is <strong class="text-strong">I think these futures are useful for every one and I think its an easy task for experience bullet developers.Is there any plan or interest to implement these options or I should try them my self and use them as heavily modified version of bullet instead of general open source?</strong><br><br><br>1-It seems there is no way to alter the inverse Mass of a pair of objects in collision response.<br>For example I don't want the little debris in the road effect on my vehicle in any way but I need collision response for them. I need contact modification callback like <a href="http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Callbacks.html#contact-modification" class="postlink">physx</a> engine.<br>I checked the source and it is possible by using <strong class="text-strong">btSolverBody</strong>.in this class we have a member named <strong class="text-strong">m_invMass</strong> but in more functions like <strong class="text-strong">btSequentialImpulseConstraintSolver.cpp</strong> they used original object invMass instead of btSolverBody invMass so we need changes here.also in function <strong class="text-strong">initSolverBody</strong> it should takes 2 other parameters like <strong class="text-strong">float invMass</strong> and <strong class="text-strong">float InteriaScale</strong> and use them for initializing btSolverBody so we can pass customized value instead of original<br><br>2-for collision filtering I found there is only 2 mask to use in most parts,<strong class="text-strong">m_collisionFilterGroup</strong> and <strong class="text-strong">m_collisionFilterMask</strong>.<br>I think its very limited for game programming and we need more space for filtering for example in <a href="http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Callbacks.html#collision-filtering" class="postlink">physx</a> we have 4 DWORD for filtering instead of 2 short.<br>I want to suggest an alternative for it.we can warp <strong class="text-strong">m_collisionFilterGroup</strong> and <strong class="text-strong">m_collisionFilterMask</strong> in a structure and use that structure.I actually wrote a prototype here:<div class="codebox"><p>Code: </p><pre><code>struct btGenericFilter{    #define NUM_ELEMENTS 2  //number of filter elementstypedef short filterByte;//type of filter element.you can change this if you need more bits//array of filter valuefilterByte m_filter[NUM_ELEMENTS];//default constructorbtGenericFilter(){for(int i=0;i&lt;NUM_ELEMENTS;i++){m_filter[i]=1;}};//constructor for backward compatibilitybtGenericFilter(int collisionGroup,int collisionMask){m_filter[0]=collisionGroup;m_filter[1]=collisionMask;};//default behavior for filtering.use this function instead of writing it manually so any         //one can change it in future instead of modifying all the source codes//this function works like:btCollisionWorld.h line:233//bool collides = (proxy0-&gt;m_collisionFilterGroup &amp; m_collisionFilterMask) != 0;//collides = collides &amp;&amp; (m_collisionFilterGroup &amp; proxy0-&gt;m_collisionFilterMask);//return collides;bool DoDefaultFiltering(const btGenericFilter &amp;otherFilter){bool b=( m_filter[0] &amp; otherFilter.m_filter[1]);b=b &amp;&amp; (m_filter[1] &amp; otherFilter.m_filter[0]);return b;};};</code></pre></div>but the problem is these masks spreads all over the place and we need a bullet developer to change them.I can do this but it takes more time since I'm not familiar with bullet source code.<br><br><br>3-<strong class="text-strong">callbacks and customizations</strong>:again like <a href="http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Callbacks.html" class="postlink">physx</a> its a good idea to change the callbacks to return more value instead of a single bool.We can also use them to improve performance.<br><br><br>thanks for reading this long post <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11019">he3117</a> — Sun Sep 21, 2014 8:57 am</p><hr />
]]></content>
	</entry>
	</feed>
