Speed difference between two different ways of collision checking

Started by paulscode, October 15, 2008, 11:45:21 PM

Previous topic - Next topic

paulscode


fireside

Unfortunately, it all goes over my head at the moment.  ??? I was looking though, and you don't have to use a ray from the camera, if I remember right.  One simple way might be to cast a ray straight down from above the terrain and move it around with the mouse.  That way I would know the x,z from the ray position and I could just place some kind of marker for the cell size when it crossed to the next cell using the y position from the average of the vertices and the x,z from the ray start.
click here->Fireside 7 Games<-

paulscode

Quote from: fireside on October 17, 2008, 04:35:51 PM
Unfortunately, it all goes over my head at the moment.  ??? I was looking though, and you don't have to use a ray from the camera, if I remember right.  One simple way might be to cast a ray straight down from above the terrain and move it around with the mouse.  That way I would know the x,z from the ray position and I could just place some kind of marker for the cell size when it crossed to the next cell using the y position from the average of the vertices and the x,z from the ray start.
That could work if you get it intuitive enough to use easily.  Tell you what, I'll start working on figuring out the camera ray method and calcMinDistance to get exact xyz coordinates.  I'll post a small demo program, source code, and detailed explanation when (if) I get it working.  If not, then I'll probably use your idea instead.