MCPcopy Create free account
hub / github.com/VCVRack/Rack / getSlumpPos

Function getSlumpPos

src/app/CableWidget.cpp:269–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268
269static math::Vec getSlumpPos(math::Vec pos1, math::Vec pos2) {
270 float dist = pos1.minus(pos2).norm();
271 math::Vec avg = pos1.plus(pos2).div(2);
272 // Lower average point as distance increases
273 avg.y += (1.0 - settings::cableTension) * (150.0 + 1.0 * dist);
274 return avg;
275}
276
277
278void CableWidget::step() {

Callers 2

stepMethod · 0.85
drawLayerMethod · 0.85

Calls 4

normMethod · 0.80
minusMethod · 0.80
divMethod · 0.80
plusMethod · 0.80

Tested by

no test coverage detected