Hello there,
I was looking around for an engine to use for a game, and CS looks pretty cool- I think I may end up using it, even though it's learning curve is steeper than some others.
....But I had a question... I have made some code already in another engine. I got as far as using an algorythm to "probe" the terrain to store info for pathfinding. This code uses an API function in that other engine which basically scans for a collision with a "line" through 3d space. This returns the collision point of the first collision it encounters, and then I use that info to store for my pathfinding/AI....
...Problem is, I have not seen something like this yet- maybe I am missing something? Does such a function exist?
This is a quick snippet of the function from that engines API docs to show what I mean:
int iBodyScan(BODY*,D3DXVECTOR3*,D3DXVECTOR3*,float,D3DXVECTOR3*,D3DXVECTOR3*)
Return subpart hit by the scan, or -1 if nothing is hit by the scan.
BODY* = body object to scan
D3DXVECTOR3* = scan origin
D3DXVECTOR3* = scan direction. The length of this vector will be the length of the
scanning capsule.
float = scan radius (capsule radius)
D3DXVECTOR3* = contact point (absolute coordinates). Return data.
NOTE: the scan is performed checking the specified capsule against the specified body, for
intersections. Only the intersection closer to origin is considered, in case the
capsule intersects the body at two or more points.
NOTE: a scan traversing a large number of polygons or dynamic body's spheres is
computationally expensive. Furthermore, a scan traversing more than 100 polygons
will miss some intersections.
IMPORTANT: intersections within 'scan radius' from the 'scan origin' are not detected!
Make sure your scan starts 'radius' meters before the possible intersection area.
...any help here would be greatly appreciated.
Thanks!
