The launch to compile: its projectile, speed, onHit and start.
OptionalarcA flat direct shot, the default, or a lobbed high arc.
OptionalfpsSamples per second of the baked flight clip; defaults to 30.
OptionalgravityConstant acceleration in m/s²; defaults to standard gravity along world −Y (AutoMovieGravity.DOWN).
Where the projectile launches from, in world metres.
The struck target's world point, where a static aim lands.
OptionaltargetThe target's world position at shot-local second t, when it moves during the shot. Supplied, the aim leads the mover to the intercept; omitted, the launch is a static intercept on target.
The lead solver calls it synchronously, potentially repeatedly at different
times. It must describe one stable trajectory during the solve; callback
exceptions propagate and the callback is not retained after compilation.
The struck scene node, the emitted react's actor, or null when the aim is a point or group with no single actor to recoil. A null value supports flight and contact without onHit; requesting onHit without a non-blank target node throws.
Compose the
launchverb's engine primitives into one result: the projectile's flight and the struck target's reaction, timed to the engine-computed hit rather than a number the model had to guess.It solveBallisticLaunch solves the aim that connects
origintotargetataction.speed, projectileTrajectory bakes the flight into the projectile node's clip, and, when the launch carries anonHitand strikes a node, schedules that node'sreactat the contact. PasstargetAtto lead a moving target: the aim then solves through solveMovingLaunch against where the mover will be when the projectile arrives, andtargetonly names the fallback sightline.Times differ by output. The clip is flight-local, keyed over
[0, hitTime]with idtrajectory:<projectile>, and the caller shifts it byaction.startonto the shot clock. Thereactstart, the event times, andtargetAt's argument are shot-local seconds, so the hit lands ataction.start + hitTime. The events are acontactalways, ahitwhen a node is struck, and afallwhen the react unbalances it; theiractionIndexis null for the caller to stamp.Returns null when the target is out of range at that speed. Throws
RangeErrorwhenonHithas no non-blanktargetNode, because no actor can perform that requested reaction.