[ODE] Bug in convex.cpp IsPointInPolygon()

Rodrigo Hernandez kwizatz at aeongames.com
Fri Jul 21 14:47:47 MST 2006


You're right, I'll make the change, Thanks!

Andres James wrote:

>The loop in IsPointInPolygon doesn't index into the polygon array
>correctly when i=pointcount-2 or i=pointcount-1. Here's my fix,
>alternatively you could modify the two "%pointcount" expressions.
>
>Index: convex.cpp
>===================================================================
>--- convex.cpp	(revision 1026)
>+++ convex.cpp	(working copy)
>@@ -283,7 +283,8 @@
>   dReal d3;
>   dReal d4;
>   dReal vc;
>-  for(size_t i=1;i<=pointcount;++i)
>+  polygon++; // skip past pointcount
>+  for(size_t i=0;i<pointcount;++i)
>     {
>       dMULTIPLY0_331 (a,convex->final_posr->R,&convex->points[(polygon[i]*3)]);
>       a[0]=convex->final_posr->pos[0]+a[0];
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>  
>



More information about the ODE mailing list