(SOLVED) RayHelper GeomPointPair Problem

Topics: Developer Forum
Apr 20, 2010 at 12:40 AM
Edited Apr 20, 2010 at 12:48 AM

EDIT: I was passing an incorrect vector to the ray cast argument. I fixed the ray cast destination vector generation and it worked fine.

This code resides inside an Enemy class of which there are multiple instances. It resides in the Update loop of that class. 
The code fires a ray from the instances position downwards and, depending on which way the enemy is facing, to the left or right.

All level geometry is added to the physicsSimulator, however, when this code runs the only item in GeomList.Geoms is the Enemies geometry itself.


List<GeomPointPair> GeomList = RayHelper.LineSegmentAllGeomsIntersect(enemyBody.Position,
enemyBody.Position + groundCheckRay,
physicsSimulator,
false);

The enemies within the game are all resting on static geometries, but those geometries are not being returned in the list of intersected geometries,
which logically they should be.

Obviously, there is something wrong with my code, but could someone offer some advice? Why would a raycast not return an geometry that,
logically, it should intersect?

Thanks for reading.