locked-coupling-points.js

total 0
used 0
limit 0
/* --- title: Locked Coupling Points files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/pointlist.js ../point_src/point-content.js ../point_src/point.js ../point_src/events.js ../point_src/automouse.js ../point_src/distances.js ../point_src/dragging.js ../point_src/functions/clamp.js ../point_src/stage.js ../point_src/coupling.js --- # Locked Coupling Locked coupling ensures changes _only_ occur in one direction. Changes on the _second_ node of a coupling will not affect the assigned coupled keys. */ class MainStage extends Stage { canvas='playspace' mounted(){ let a = this.a = new Point({x:200,y:200, radius: 50}) let b = this.b = new Point({x:300,y:300, radius: 50}) let c = this.c = new Point({x:200,y:200, radius: 20}) this.dragging.add(a, b, c) let d = this.coupling = new LockedCoupling() /* B.y value is locked at a distance + relative to the C.y + a and b are locked + using _c_ as an offset value + focusing on the `y`. */ d.couple(a, b, c, ['y'])// {x: 10, y: 10}) d.step() } draw(ctx){ this.clear(ctx) this.a.rotation += 1 this.coupling.step() this.a.pen.indicator(ctx, {color:'#ddd'}) this.b.pen.indicator(ctx, {color:'green'}) this.c.pen.indicator(ctx) } } ;stage = MainStage.go();
Run
Meta Data
title Locked Coupling Points
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/pointlist.js', '../point_src/point-content.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/distances.js', '../point_src/dragging.js', '../point_src/functions/clamp.js', '../point_src/stage.js', '../point_src/coupling.js')
unused_keys ()
unknown_keys ()
filepath_exists True
path locked-coupling-points.js
filepath locked-coupling-points.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.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/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/functions/clamp.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/coupling.js')
markdown {'html': '<h1>Locked Coupling</h1>\n<p>Locked coupling ensures changes <em>only</em> occur in one direction. Changes on the\n<em>second</em> node of a coupling will not affect the assigned coupled keys.</p>', 'content': '---\ntitle: Locked Coupling Points\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/pointlist.js\n ../point_src/point-content.js\n ../point_src/point.js\n ../point_src/events.js\n ../point_src/automouse.js\n ../point_src/distances.js\n ../point_src/dragging.js\n ../point_src/functions/clamp.js\n ../point_src/stage.js\n ../point_src/coupling.js\n---\n\n# Locked Coupling\n\nLocked coupling ensures changes _only_ occur in one direction. Changes on the\n_second_ node of a coupling will not affect the assigned coupled keys.'}