realXtend / tundra

realXtend Tundra SDK, a 3D virtual world application platform.
www.realxtend.org
Apache License 2.0
84 stars 70 forks source link

Update to bullet 2.81 and linux build fixes #603

Closed peterclemenko closed 11 years ago

peterclemenko commented 11 years ago

This pull request will update to bullet 2.81 and fix Ubuntu Linux build issues. Important note: This has only been tested with Windows and Linux Mint (Ubuntu); and this will break Mac builds until the Mac build script uses the new version of Bullet. I would fix it myself; but I don't have a Mac to test on.

juj commented 11 years ago

This looks good.

@jonnenauha, @Stinkfist0, @cadaver or others? If you can report this to build ok, I'm ok to merge this in.

cadaver commented 11 years ago

Note that the rolling friction addition to EC_RigidBody will break wire protocol with earlier Tundra versions.

jonnenauha commented 11 years ago

Haven't built or merged this yet. I can possibly give it a go. @cadaver What does this rolling friction give us?

cadaver commented 11 years ago

It is a new feature of Bullet 2.81. Imagine for example a barrel rolling on the floor, in previous Bullets it would have rolled indefinitely (without other damping), but now the friction can be controlled to make it stop eventually. We already have angular damping, which would stop it also, but that's different, as unlike friction it affects the rigid body the whole time.

Stinkfist0 commented 11 years ago

Looks good, though, as @cadaver already mentioned, addition of new attributes will break the wire protocol compatibility, so maybe that commit should be reserved for a Tundra release with a "significant" version bump. Also, if and when the new attribute is added, maybe this another EC attribute change could be applied at the same time: https://github.com/realXtend/naali/blob/tundra2/src/Core/OgreRenderingModule/EC_Sky.h#L71 Oh, and this too https://github.com/Adminotech/tundra/commit/d0a8838c90795887e333385a2a593ad70eecf5ff

cadaver commented 11 years ago

When we do break protocol compatibility, I also suggest adding EnableGravity attribute to EC_RigidBody at that time.

jonnenauha commented 11 years ago

@cadaver How does enableGravity differ from mass = 0?

@Stinkfist0 @cvetan5 Would it make sense to make the attribute drawDebug like it is in other components. Essentially looks like thats what it does?

cadaver commented 11 years ago

To disable gravity but leave nonzero mass would still allow collisions and adding other forces.

antont commented 11 years ago

Thanks for the build fixes! I encountered the same today as was testing things on Linux, didn't actually notice first that they were fixed here too -- was only thinking of this pull request with the bullet update & managing wire protocol / EC attr spec changes in mind.

Without noticing that it had already been done, I pushed already a different fix to the qtprop dep source fetching, that is closer to the old code as it just gets a tarball. Probably also better to use a certain version than getting what happens to be current master in qtsolutions git (although the new tarball getting is from a random old mirror of trolltech ftp, whereas your version gets it from qtsolutions github which is the right place. optimal might be to get a tag or something from github, although the project has been basically dead so might make no difference).

Was now looking into how to get py module building after the TundraCore refactor, was very helpful to get the fix here (just applied it to my copy manually now but is exactly what is here). I could perhaps just push that too (just remove the core/ogre ECs from the cmake link_entity_components list).

The protocol changing EC_RigidBody change is good to do in some coordinated fashion, we have released recently though so perhaps there is not much reason to wait. Dunno if the other changes there should be made in one pull request, perhaps not required, if we can just do all those separately soon enough and not release before that? Might be nice and clear in a bulletupgrade branch -> pull request or so though. Did @stinkfist and @cadaver volunteer to do those other changes in the coming weeks? ;)

Stinkfist0 commented 11 years ago

@jonnenauha @cvetan5 drawDebug sounds good so it would be consistent with e.g. RigidBody and Mesh.

peterclemenko commented 11 years ago

I feel obligated to mention I am working on additional compatibility breaking changes to bullet, but right now I need to fix a few problems with it.

"Ali Kämäräinen" notifications@github.com wrote:

@jonnenauha @cvetan5 drawDebug sounds good so it would be consistent with e.g. RigidBody and Mesh.


Reply to this email directly or view it on GitHub: https://github.com/realXtend/naali/pull/603#issuecomment-12394795

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

peterclemenko commented 11 years ago

For elaboration, I am implementing the cone primitive and what should fix the tunneling issue. Right now however it is black screening on launch. Until I fix that I won't push it. I have to run it in valgrind and see if I can find why it is breaking. I probably put it in an infinite loop somewhere.

cadaver commented 11 years ago

Testing this now, finally. From now on (current tundra2 branch and future releases, old Tundra versions will be incompatible) attributes can be added to components without destroying wire protocol compatibility, as long as they're added last in the component's static attributes defined in the constructor.

Stinkfist0 commented 11 years ago

Great. @cadaver while at it, can you also take a look of this: https://github.com/realXtend/naali/blob/tundra2/src/Core/OgreRenderingModule/EC_Sky.h#L71 Now the comment about keeping the attribute count same can be ignored, and the new enabled attribute could be added while stile keeping the deprectated textureRefs attribute.

cadaver commented 11 years ago

Yes, that can be done now.

cadaver commented 11 years ago

It seems Bullet-2.81 adds configuration postfixes to the lib files, but this was not addressed in ConfigurePackages.cmake?

jonnenauha commented 11 years ago

@cadaver A bit offtopic but I'm interested: Looking at your code it seems that we need to add new attributes to the end of the list in order for this to work. Can you verify this is the case? I mean if they are added anywhere else it seems the logic just break;s the update loops. If we follow this is should be good?

cadaver commented 11 years ago

Yes, new attributes need to be added to the end of exiting attributes in the component's header. It's also good practice to make sure the order matches in the constructor. Checks have been added to SyncManager to benignly abort when there's not enough data, or too much data. You'll still get a warning though when you run different versions.

jonnenauha commented 11 years ago

Ok that is good to know. Dunno if we should document this somewhere "only add new attributes to the end in the header". I usually like to group bools and strings in row, but I guess cant do that no more if I want stuff to work :)

Thanks for that code, it gives us more flexibility on Meshmoon releases knowing that we can add stuff to components without braking stuff!

cadaver commented 11 years ago

It's now documented in IComponent.h in the work branch for this pull request, will be merged soon.

cadaver commented 11 years ago

Merged to tundra2.

jonnenauha commented 11 years ago

@cadaver Was this tested on mac? It seems that tundra wont build anymore with the old bullet version, if mac scripts was not updated and it has the old version this might break mac builds? Or was mac already using a recent enough bullet?

@cvetan5 any comments?

cvetan5 commented 11 years ago

Jonne I tested new bullet when I merged undo branch with the latest rex/tundra2, it built ok.

jonnenauha commented 11 years ago

ok, good. I'm trying to scan these pull requests for potential issues for our next meshmoon release.

cadaver commented 11 years ago

@jonnenauha: Yes, I tested as well. And indeed, it requires updated bullet, as new features from 2.81 are used.