originRotate-example.js

total 0
used 0
limit 0
/* title: Tethered Controller Point categories: binding files: head point pointlist mouse stage dragging ../point_src/random.js ../point_src/distances.js ../point_src/tethers.js ../point_src/stage-clock.js stroke --- */ addButton('Add Point',{ onclick(){ stage.addNewPoint() } }) class MainStage extends Stage { canvas='playspace' mounted(){ // this.createPoints() // this.dragging.add(...this.points, ...this.controlPoints) this.point = new Point(200, 200, 100) this.lastDiff = this.point.radians this.point.rotationSet = (v) => { let p = this.points[0] let diff = radiansDiff2(this.point.radians, this.lastDiff) p.xy = originRotate(p, this.point, radiansToDegrees(diff)) this.lastDiff = this.point.radians } this.points = new PointList this.dragging.add(this.point) this.addNewPoint() this.addNewPoint() } addNewPoint() { let pos = random.within(this.point, 1) let cp = new Point(pos) this.points.push(cp) this.dragging.add(cp) } draw(ctx){ this.clear(ctx) let p = this.point p.pen.indicator(ctx, {color: '#336600'}) this.points.pen.indicator(ctx, {color: '#336600'}) } } ;stage = MainStage.go();
Run
Meta Data
title Tethered Controller Point
imports ()
files ('head', 'point', 'pointlist', 'mouse', 'stage', 'dragging', '../point_src/random.js', '../point_src/distances.js', '../point_src/tethers.js', '../point_src/stage-clock.js', 'stroke')
unused_keys ()
unknown_keys ('categories',)
categories ['binding']
filepath_exists True
path originRotate-example.js
filepath originRotate-example.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/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.js', '../point_src/stage-clock.js', '../point_src/setunset.js', '../point_src/stroke.js')
markdown {'html': '', 'content': 'title: Tethered Controller Point\ncategories: binding\nfiles:\n head\n point\n pointlist\n mouse\n stage\n dragging\n ../point_src/random.js\n ../point_src/distances.js\n ../point_src/tethers.js\n ../point_src/stage-clock.js\n stroke\n---'}