05-08-2010, 03:02 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
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--
|
|
05-08-2010, 03:15 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 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.
|
|
05-08-2010, 03:32 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
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--
|
|
05-08-2010, 03:50 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
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--
|
|
05-08-2010, 04:00 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 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.
|
|
05-08-2010, 04:09 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
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--
|
|
05-08-2010, 04:52 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
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.
--alex--
|
|
05-09-2010, 05:39 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 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.
|
|
05-09-2010, 02:26 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
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--
|
|
|