Skip to main content

computeInterceptPoint

Constants

Functions

Given position of the source point, and target moving at a constant velocity, compute intercept. Simple example would be target being enemy running, and source being position of our archer, given that the arrow speed is sourceSpeed, where should the archer aim at in order to hit the moving target?

q_roots : Array.<number>

Kind: global constant

computeInterceptPoint(result, source, target, targetVelocity, sourceSpeed) ⇒ boolean

Given position of the source point, and target moving at a constant velocity, compute intercept. Simple example would be target being enemy running, and source being position of our archer, given that the arrow speed is sourceSpeed, where should the archer aim at in order to hit the moving target?

Kind: global function
Returns: boolean - true iff there is at least one real solution

ParamTypeDescription
resultVector3This is where the intercept point will be written if solution is found
sourceVector3Where to launch a projectile from
targetVector3Where the target currently is
targetVelocityVector3Target's current velocity vector
sourceSpeednumberSpeed of the projectile in question