RifleRound wrote:Hi there
I am writing my Bachelor-Thesis about pathfinding with Raycasting (Raycasting to check the object intersected by a ray)
and .... well it would be great if you could give me some answers^^
1. Are Raycasts in Bulletphysics processed by GPU or CPU?
2. Is it possible to make them processed by GPU (if CPU) / or CPU (if GPU)?
3. Could you give me a link of the proof of the answer I can put in my Bachelorthesis ... like... you know... something "official". Like an article from one of the dev's or something. Or a class in the Engine's Documentation which is telling that the Raycasts are processed by CPU (or GPU)
4. Do you know another Engine which processess Raycasts with GPU ? (or CPU)?
i would be very very very thankful
cheers!
An entire thesis on ray casting seems a bit much but I'll fill you in on my methods. When a user clicks on the screen there are two points a near and a far point. The near point is closest to the screen and the far point is farthest away. The screen coordinates have to be converted to the world coordinates and this can be done by the use of an inverse matrix. (The inverse of the "mvp" or whatever. I use row operations to calculate the inverse matrix) After getting the near and far point hero's formula can be used to calculate the distance any giving point is from the line of sight. This is very accurate

and comprehensive compared to alternative methods
see the attached image or look at this one

Point A is the near point and B is the far point. Line AB is the line of sight. To calculate how far point C is from the line of sight:
1. find the area of triangle ABC using HERO's formula after calculating the distances of the triangle's sides (<3 hero's formula)
2. use the area of the triangle to calculate the height where AB is the base (area = base * height / 2)
That height is the distance from the line of sight point C is.
An elementary check can be performed to test if the point is behind the camera, simply if angle A is obtuse then the point is behind the camera.
Finding the distance between two 3d points is not so bad.
I hope you enjoyed learning about my methods

You do not have the required permissions to view the files attached to this post.