Multiple dynamics worlds: interaction/transition

User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

Erwin Coumans wrote:There would be one other approach to support huge coordinates, instead of double support, but this requires some extra work/management:
A multiple-worlds approach, where each world has its own local coordinate system, and a clever approach how to move/merge overlapping simulation islands can solve some issue too. Basically the calculations are done in some arbitrary chosen local space. It would be best to do all collision and physics calculations in Bullet in relative coordinates instead of world coordinates. Such 'relative coordinate approach' has been recently added for Bullet's narrowphase GJK calculations and this improved precision. But other calculations like constraint/contact solving is still done in worldspace. So unless we improve all algorithms, it's probably safer/easier to just use brute-force double precision.

Thanks,
Erwin
That sounds interesting. My engine system works with such a Endless-World principle where you define a World ( or more if you need something in parallel ) and Add Scenes to it which provide a local coordinate system. Currently I restrict Bullet to only use only the first scene ( hence failing at the others ). My intern ( non physics, just AI ) collision detection/response works with multiple scenes. What changes are there currently for supporting such a large setup? Where would "extra" work be required?
--
Pl?ss Roland
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

gunner10 wrote:Sent a mail to your admin account with a zip of proposed changes

Since the switch for precision is a define, its going to be interesting how you want to manage the projects (at least for MSVC) - seems like there needs to be 2 sets of projects so that the float and double versions can be built separately. I know I'll want to have both versions of the libraries available.
Thanks, I will check it out.

The various MSVC projectfiles are autogenerated through jam/msvcgen.So we could add a new build target in the msvc skeleton files in bullet/mk/msvcgen. Alternatively, cmake can be used, not sure how to add additional build targets in that one, someone can look into that (I have the Cmake book, but little spare time).

PS: I want to add SIMD version soon too, so that would be another build target.

Erwin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Dragonlord wrote:That sounds interesting. My engine system works with such a Endless-World principle where you define a World ( or more if you need something in parallel ) and Add Scenes to it which provide a local coordinate system. Currently I restrict Bullet to only use only the first scene ( hence failing at the others ). My intern ( non physics, just AI ) collision detection/response works with multiple scenes. What changes are there currently for supporting such a large setup? Where would "extra" work be required?
--
Pl?ss Roland
Bullet can simulate multiple dynamics worlds at the same time. But when objects move from one world to the other, the simulation islands that are connected by objects that are in both worlds needs to be merged. This merging process is the "extra" work.

PS: Simulation islands are merged by constraints (ball-socket, hinge, generic D6 etc) and AABB overlap. Each island is simulated/solved independently.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

Erwin Coumans wrote:
Dragonlord wrote:That sounds interesting. My engine system works with such a Endless-World principle where you define a World ( or more if you need something in parallel ) and Add Scenes to it which provide a local coordinate system. Currently I restrict Bullet to only use only the first scene ( hence failing at the others ). My intern ( non physics, just AI ) collision detection/response works with multiple scenes. What changes are there currently for supporting such a large setup? Where would "extra" work be required?
--
Pl?ss Roland
Bullet can simulate multiple dynamics worlds at the same time. But when objects move from one world to the other, the simulation islands that are connected by objects that are in both worlds needs to be merged. This merging process is the "extra" work.

PS: Simulation islands are merged by constraints (ball-socket, hinge, generic D6 etc) and AABB overlap. Each island is simulated/solved independently.
So if I get this right the only thing required to do is providing a new "Overlap" constraint that is placed whenever two islands in two different worlds overlap each other?
--
Pl?ss Roland
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Dragonlord wrote: So if I get this right the only thing required to do is providing a new "Overlap" constraint that is placed whenever two islands in two different worlds overlap each other?
--
Pl?ss Roland
It is not trivial, but I have seen such system working very nicely. It will take too much time to go into all the details at the moment: rigidbodies/collisionobjects can only be in one broadphase at a time, so a 'proxy' object can be used. Then, the trick is to manage transitions from rigidbody to one or more proxies across several dynamics worlds (and their broadphases), taking simulation island connectivity into account.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

So a proxy would be a kind of "ghost" in that case? So one RigidBody exists in more than one broadphase using his ghosts? Sounds all very interesting. Maybe I should poke my nose a bit into this broadphase class and snoop around a bit. The grouping into scenes is already present so I could map a scene to a DynamicsWorld and see how the connections can be made.
---
Pl?ss Roland