t App;
let Debug   = {};
let Ref     = {};

function onRender( dt=0, et=0 ){
    Ref.cycle.tick( dt );
    Ref.motion.update( Ref.cycle );
    Debug.pnt.reset();
    for( let c of Ref.chains ) c.apply( Ref.motion );
}

window.addEventListener( "load", async _=>{
    App = new Starter( { webgl2:true, grid:true } );
    App.setCamera( 0, 20, 3, [0,0.6,0] );
    //App.onRender = onRender;

    App.add( ( Debug.pnt = new ShapePointsMesh() ) );
    App.add( ( Debug.ln  = new DynLineMesh() ) );

    Ref.target = 