Possible problem in SegmentIntersect

Feb 21, 2009 at 1:16 PM
I'm haveing a problem with SegmentIntersect in CollisionSkin.cs:
At line 395 you use "pos", the output of the function as function argument.
This vector3 however will be zeroed at each iteration (look at Heightmap.cs at line 279) so it will be useless as output
 of CollisionSkin.SegmentIntersect function.
Is this a bug or there is something i can't see?

Feb 21, 2009 at 1:20 PM
Using this code instead of the loop at lines 391-403 fixed my problems (car rolling over and over):

for (int prim = primitivesNewWorld.Count; prim-- != 0; )
            {
                float thisFrac;                
                Vector3 newPosition = pos;

                if (primitivesNewWorld[prim].SegmentIntersect(out thisFrac, out newPosition, out normal, segCopy))
                {
                    pos = newPosition;
                    frac = thisFrac * thisSegLenRelToOrig;
                    segCopy.Delta *= thisFrac;
                    thisSegLenRelToOrig *= frac;
                }
            }

Coordinator
Feb 21, 2009 at 3:41 PM
thanks for the report!
will have a look at it in the next hours.
Coordinator
Feb 22, 2009 at 10:37 PM
- fixed