Time for some fancy Math-uh-matics!

Blitz3D Forums/Blitz3D Programming/Time for some fancy Math-uh-matics!

Adam Novagen(Posted 2011) [#1]
Usually, my history of homeschooling has been nothing but beneficial to me; I learn what I need to as I go along. Algebra, for instance - the PEMDAS order of operations, variables and so on - was something that I learned by programming before I even realized that it was algebra. Occasionally, however, my lack of a "formal" classroom education per subject gets in my way, and this seems to be one of those times. I get the feeling that with a bit more trig and geometry training, I wouldn't even need to ask this question.

SO, here it is, with a fun little MS Paint doodle to illustrate! Say you have a ball, which represents the EntityRadius() sphere of the player. Now, say you have a "line" between two pivot entities. What would the formula[e] be to check if the ball was intersecting that line at any given point?




Rroff(Posted 2011) [#2]
Googling for "point intersecting vector" or "vector intersecting vector" will probably lead you down the right path.


Yasha(Posted 2011) [#3]
This sounds like it ought to work: http://www.blitzbasic.com/codearcs/codearcs.php?code=1870

Just check whether the distance returned is less than the radius of the sphere?