multi-tethered-point.js

total 0
used 0
limit 0
/* title: Tethered Controller Point categories: binding files: head point pointlist mouse stroke stage dragging ../point_src/random.js ../point_src/distances.js # ../point_src/tethers-xy.js ../point_src/tethers-vec.js ../point_src/stage-clock.js ../point_src/protractor.js --- */ addButton('Add Point',{ onclick(){ stage.addNewPoint() } }) class MainStage extends Stage { canvas='playspace' mounted(){ // this.createPoints() // this.dragging.add(...this.points, ...this.controlPoints) const p = this.point = new Point(200, 200, 100) this.dragging.add(p) const c = this.addNewPoint() // this.addNewPoint() // this.point.rotationSet = function(){ // // let v = p.getTheta(c, -p.radians) % Math.PI2 // let v = calculateAngle180(p, c); // // v = calculateInverseAngle180(p, c); // // v = calculateAngle360(p, c) // console.log(v) // } } addNewPoint() { let pos = random.within(this.point, 1) let cp = this.point.tethers.add(pos) this.dragging.add(cp) return cp } draw(ctx){ this.clear(ctx) let p = this.point if(this.clock.tick % 1 == 0) { p.tethers.step() } p.pen.indicator(ctx, {color: '#336600'}) p.tethers.points.forEach((tp)=>{ p.pen.line(ctx, tp, '#880000', 2) }); p.tethers.points.pen.fill(ctx, '#33DDAA') // p.tethers.points.pen.line(ctx,{color: '#33DDAA'}) // p.tethers.points.pen.(ctx,{color: '#33DDAA'}) } } ;stage = MainStage.go();
Run
Meta Data
title Tethered Controller Point
imports ()
files ('head', 'point', 'pointlist', 'mouse', 'stroke', 'stage', 'dragging', '../point_src/random.js', '../point_src/distances.js', '# ../point_src/tethers-xy.js', '../point_src/tethers-vec.js', '../point_src/stage-clock.js', '../point_src/protractor.js')
unused_keys ()
unknown_keys ('categories',)
categories ['binding']
filepath_exists True
path multi-tethered-point.js
filepath multi-tethered-point.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/random.js', '../point_src/./windings.js', '../point_src/tethers-vec.js', '../point_src/stage-clock.js')
markdown {'html': '', 'content': 'title: Tethered Controller Point\ncategories: binding\nfiles:\n head\n point\n pointlist\n mouse\n stroke\n stage\n dragging\n ../point_src/random.js\n ../point_src/distances.js\n # ../point_src/tethers-xy.js\n ../point_src/tethers-vec.js\n ../point_src/stage-clock.js\n ../point_src/protractor.js\n---'}