User contribution to Core

So the new Core setup will dramatically simplify Box2d.

What user contributions are being accepted?

What are the limits?

I notice all the conditional compilation has been removed.

The reason I ask is Box2D core as it sits not will almost compile in Linux. The only problem is _finite is a windows specific function. The Linux equivalent is finite().

Can this be fixed? (are we allowed?)

What are reasonable solutions. The easiest is to just conditionally compile the b2IsValid to use _finite in windows and finite in linux. However, this starts to push bo2xd back into the same situation we're trying to get out of.

How about a cross platform implementation of b2IsValid.

Code:
bool b2IsValid( float x )
{
   if( x <  std::numeric_limits<float>::infinite() &&
       x > -std::numeric_limits<float>::infinite() )
   {
      return true;
   }

   return false;
}




Another option is to allow conditional compilation in the b2Settings.h

Then just add the lines
Code:
#ifndef _MSC_VER
extern int _finite( float f );
#endif


Then it's up to individual platforms to provide an implementation. Of if you're feeling bold we could allow different platforms to add their definitions of _finite to b2Settings.cpp

-nick
My plan is to only have code in Core that I wrote.

I plan to take suggestions to make Core portable, if not code itself.

If anyone finds code in Core that they think they wrote, please let me know and I will remove/replace it. We can make arrangements for it to go into the contributions folder. I know this will make life harder for contributors, but it will also mean that I can support Box2D better.

I'll try to put in something portable instead of _finite.
Erin Catto wrote:
If anyone finds code in Core that they think they wrote, please let me know and I will remove/replace it. We can make arrangements for it to go into the contributions folder.

b2World::SolveTOI still has a bit of stuff that I put in while trying to get TOI joints working properly; the changes there weren't substantial, but are probably at least worth a look to see if you want to maintain as-is or go back to the previous method (DFS vs. BFS was the main difference). From what I remember, proper TOI joints never fully materialized because warm-starting required some modifications in each of the joint classes, and I wasn't comfortable deciding how to approach that myself since it would be a lot harder to roll back.

Are you also concerned about this stuff from a copyright perspective, or is it all about maintainability?
I think I changed that TOI joint stuff already.

I am concerned about copyright stuff, so let me know if you find any code that is not public domain.
Erin Catto wrote:
I am concerned about copyright stuff, so let me know if you find any code that is not public domain.

Just in case you don't catch everything, and for the sake of being careful it may be worth asking anyone that's contributed thus far to relinquish or transfer to you any copyright claims they might have on anything in the Box2d Core. I'd be happy to do so (though I don't think I put much code in Core, if there's anything I missed you can consider it either public domain or copyrighted to you, at your discretion). There are only six other project members listed at SF (http://sourceforge.net/project/memberli ... _id=205387), which is few enough that it's feasible to ask them all to do the same just for extra reassurance. I don't think much other code has come in from people without SVN access.

More generally, a copyright assignment to a single project owner or entity should usually be a condition of contributing to any open source project, simply because it can be a real nightmare to track down every contributor after the fact if (say) you decide to switch a project between various open source licenses or anything like that. Without that assignment, even a switch between two licenses in the same spirit (BSD <-> zlib, for example) technically requires permission from each person with a copyright stake in the project, which can get difficult, especially years down the line.
Oh, so we're doing a general purge of all core code ever contributed now? Of my significant contributions that I can think of:
Raycasts - you are replacing this as part of the broadphase replacement.
Buoyancy - move to contrib, using vistor like pattern instead of virtual method. Or rewrite.
Controller Framework - no one really likes this, could nix it, or could move to contrib though.
API changes - too small to worry about, I don't mind assigning copyright.
Lockfree (recent commit) - just revert it. If it had got any publicity, I'm sure people would be missing it. But it's completely inseparably from core, and I'm dubious of anyone's ability to reproduce it just from a description of what it does, which is my rule of thumb for whether it is ok to "rewrite" code.

It's all under zlib for you to keep, of course.

Other things I'm going to miss:
Edge shapes
Line joint (it's a gotta-catch-em-all thing)


You will essentially be forking yourself, as some users will prefer to stick with an older version with all these things available.
Yes I don't mind people using older versions of Box2D or creating their own versions with a different feature set.

I thought I wrote the line joint for pTym, or were you thinking of the fixed joint?

Edge shapes will be available via 2 point polygons.

I would like to keep the buoyancy and controller stuff in contrib. It is good stuff. Unfortunately I had to remove the submersion formulas from Core.

Yes, ray-casts will be supported with the new broad-phase. BTW, the latest version in Core uses the new broad-phase. There is no more world AABB and no proxy or pair limits.
@Erin: To let you know, I have started to submit bugs into the SourceForge tracker in relation to your recent changes. Will you be looking at this fairly often or acknowledging the posts there? The reason I ask this is that I have run a public tracker many times and always, the thing that causes it to fail (or experience problems) is when there's no acknowledgement of the reports, people simply don't know if the post has been even read. Obviously I'm not talking about actually fixing bugs.

Anyway, I presume you're going to want to vet that tracker and ensure that people ONLY post "Core" problems/suggestions?

Totally appreciate you have a "real" job as well. 🙂
Good point melvmay, I will start providing some feedback on the tracker.

On this topic, I'm thinking of moving the source to Google code. Any opinions on that?

Eric, do you know how someone can assign copyright to me? Apparently other projects do this.
Thanks Erin.

Original thread: https://box2d.org/forum/viewtopic.php?t=3466