Crystal Space
Welcome, Guest. Please login or register.
October 31, 2014, 07:45:39 pm

Login with username, password and session length
Search:     Advanced search
9011 Posts in 2044 Topics by 8902 Members
Latest Member: Nelmczyk
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Crystal Space Development / General Crystal Space Discussion / Any ray/line intersection function? on: May 17, 2005, 08:43:26 am
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:

Code:

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! Smiley
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.568 seconds with 18 queries.