This project is read-only.

Possible problem in SegmentIntersect

Feb 21, 2009 at 2: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 2: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;

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