05-30-2014, 01:32 AM

(05-29-2014, 10:52 PM)STR_Warrior Wrote:FakeTruth Wrote:You should do a ray-sphere (or box) intersection for this.

Are you sure? I think this is much faster then using rays in a sphere.

Either way ray-sphere intersection is really fast too (ever heard of raytracers?), you should not worry about the performance with that

If you don't feel like doing that, you could try using a dot product between the direction and look vector, a dot product's result will always be "how much the two vectors are similar" so if they are going in exactly the same direction you get 1, and if they are perpendicular you get 0.