Forums
bullet dynamics - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4)
+--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9)
+--- Thread: bullet dynamics (/showthread.php?tid=1262)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


- NaN - 05-08-2010

got it, thanks


- alex25 - 05-08-2010

NaN Wrote:
Quote:how can i turn off the car collision shape colliding with the track geometry
There is no switch to enable/disable it. I am not sure what your intention is. So you either have to wait till the bugs are fixed or fall back to rev 2659(it uses the old code).
i'm not looking for a switch but i want to know where the code is (file:line). i want to turn off the collision with any textures if i am on a bezier track. for most tracks the bezier surface doesn't line up with the texture. and it could actually be below the track geometry. i am not sure what happens in this case. do we still collide with the track textures? (if so strange things might happen)

--alex--


- NaN - 05-08-2010

Quote:i want to turn off the collision with any textures if i am on a bezier track
You would have to write the code to filter the collisions in bullet.

A hack(workaround) would be to adjust the collision shape in cardynamics.cpp line 635-663.


- alex25 - 05-08-2010

NaN Wrote:
Quote:i want to turn off the collision with any textures if i am on a bezier track
You would have to write the code to filter the collisions in bullet.
i really think this needs to be done anyway. there are very few places where the bezier surface matches the track geometry. so let me get this straight. we position the car on the bezier surface but then the collision is calculate with both the bezier surface and collide-able track textures. if that's the case and the the bezier surface is below the track surface you'll get some strange interactions that will probably explain why the car is behaving so strangely with the new collision code and sometimes jumps around for no reason at all.

--alex--


- NaN - 05-08-2010

The car would fall through the disabled collision geometry if the wheels lose contact with the bezier patch for whatever reasons.


- alex25 - 05-08-2010

the simplest way to test this is to make the track surfaces non-collide-able and only use the bezier surface but then the new collision code doesn't even look for the bezier surface. how do i change that? (i.e. get the old behaviour back where if the car were on a bezier surface it didn't matter if the track was marked collide-able or not). thanks.

--alex--


- alex25 - 05-08-2010

NaN Wrote:The car would fall through the disabled collision geometry if the wheels lose contact with the bezier patch for whatever reasons.
why would the bezier surface be any different from a collide-able texture? right now we have a mismatch between the bezier surface and the track geometry and (i think) this makes the car behave strangely. we either get rid of the bezier patches and consider the track geometry, or use the bezier surface and ignore the track geometry. we can't use both, can we? (especially since they don't match exactly)

--alex--


- NaN - 05-08-2010

Quote:why would the bezier surface be any different from a collide-able texture
The bezier surface is used for wheel rays only. There is no code for bezier surface and car shape collision tests.

Quote:we either get rid of the bezier patches
This is an option as I'd like to move to rigid body wheels(waiting for stan's code). The good thing about the patches is that they are smooth compared to track geometry.


- alex25 - 05-08-2010

NaN Wrote:The good thing about the patches is that they are smooth compared to track geometry.

i well aware of that, that's why we had it in the first place. but as the collision code moves in different directions we seem to be running more and more into problems with this approach.

so, right now we don't even look for a bezier surface if we the track texture is non-collide-able. where in the code can i change that? then i can make the track surface non-collide-able and see what happens. i expect the car will behave much better.

--alex--


- NaN - 05-08-2010

In collision_world.cpp line 203-248. Move the track bezierpatch collision code block out of the if geometryHit statement.


- alex25 - 05-08-2010

i disabled the collision with the geometry code and kept only the bezier patch collision. the car goes along just fine for a while but when it gets to the region where the car jumps wildly you see the car suddenly sink. so something is wrong with the bezier surface, in that area it suddenly drops for some reason. if i look at it in the track editor it seems normal. maybe we need an option to visualize the bezier surface in vdrift for debugging purposes.

[Image: dijon-sinkhole.jpg]

--alex--


- alex25 - 05-08-2010

the car sinks the same if i take it off the road so it could be that in that particular region there is no bezier surface. strange.

--alex--


- alex25 - 05-08-2010

i've re-traced the track and the holes in the bezier surface went away. not sure what went wrong the first time. i've committed the new roads.trk to svn.

--alex--


- NaN - 05-09-2010

Quote:option to visualize the bezier surface in vdrift for debugging purposes
The racing line follows the bezier surface. It should be possible to reuse its code to visualize the surface.

Wait a moment. The car sinks although the racing line coincides with the track geometry in your screenshot. Strange indeed.


- alex25 - 05-09-2010

i'm not sure what's going on here. a lot of the tracks seem to have holes in the bezier surface. the surface itself shows up just fine in the track editor but it's nevertheless wrong. interlagos is a good example of this, it had one bad segment which i redid by itself so that could be a good case study. anyway, i've been retracing tracks but i'm getting bored. i'll try to fix them all eventually. for reference this is the patch i applied to vdrift to test the bezier surface itself:

Code:
Index: src/collision_world.cpp
===================================================================
--- src/collision_world.cpp     (revision 2707)
+++ src/collision_world.cpp     (working copy)
@@ -200,7 +200,7 @@
        // track geometry collision
        world.rayTest(from, to, rayCallback);
        bool geometryHit = rayCallback.hasHit();
-       if (geometryHit)
+/*     if (geometryHit)
        {
                p = ToMathVector<float>(rayCallback.m_hitPointWorld);
                n = ToMathVector<float>(rayCallback.m_hitNormalWorld);
@@ -222,7 +222,7 @@
                                s = trackSurface[shapeId];
                        }
                }
-
+*/
                // track bezierpatch collision
                if (track != NULL)
                {
@@ -241,7 +241,7 @@
                                b = colpatch;
                                c = NULL;
                        }
-               }
+//             }

                contact.Set(p, n, d, s, b, c);
                return true;

--alex--