In your code snip you used the camera position for the starting point of the "Ray cast". Hang on... let me verify if intersect works how I think...
Quote: "dbIntersectObject
This command will return the distance to the point of intersection between two coordinates, in reference to the specified object. Use this command to project a line from your current position to a destination to determine whether a collision will occur with an object. Ideal for bullet calculations and fast manual polygon collision.
Syntax
float dbIntersectObject ( int iObject, float fX, float fY, float fZ, float fToX, float fToY, float fToZ ) "
and.... I think you actually want this:
Quote: "dbObjectHit
This command will return a one if the two specified 3D objects hit each other. If the second object number is set to zero, the number of the object hit by the first object will be returned as an integer value.
Syntax
int dbObjectHit ( int iObjectA, int iObjectB )
"
First raycasts from point a to point b. if it intersects with a poly, you get back the distance from point a where it smacked into something.
The latter - just tells you if two objects hit. Does this help at all?