THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/05/2010 at 15:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11.5
Platform: Windows ;
Language(s) : C++ ;
---------
Hey everyone.
I am trying to determine if a point has collided with a polygon. I am toying around with
GeRayCollider to test for this.
This is the code I am using.
AutoAlloc<GeRayCollider> rCollider;
if (!rCollider) return TRUE;
Vector dir = position;
Real ray_length = Len(objPoly->GetRad()*2.01);
if (bc->GetBool(COLLISION_ENABLE) == TRUE)
{
rCollider->Init(objPoly, FALSE);
Bool doesCollide = rCollider->Intersect(position,dir, ray_length, TRUE);
if (doesCollide)
{
velocity = -velocity;
}
}
position = the position of the point
I am not getting the results I expect. I am wondering if I am using this function incorrectly?
Any help you can offer would be greatly appreciated.
~Shawn