"Collision detection tutorial" - читать интересную книгу автора (Christopoulos Dimitrios)Collision DetectionFor the collision detection we are going to use algorithms which are mostly used in ray tracing. Lets first define a ray. A ray using vector representation is represented using a vector which denotes the start and a vector (usually normalized) which is the direction in which the ray goes. Essentially a ray starts from the start point and travels in the direction of the direction vector. So our ray equation is. t is a float which takes values from [0, infinity). With 0 we get the start point and substituting other values we get the corresponding points along the ray. PointOnRay, Raystart, Raydirection, are 3D Vectors with values (x,y,z). Now we can use this ray representation and calculate the intersections with plane or cylinders. |
||
|
© 2026 Библиотека RealLib.org
(support [a t] reallib.org) |