MCPcopy Create free account
hub / github.com/dailydotdev/apps / clampTarget

Function clampTarget

packages/webapp/components/world/engine/world.js:8484–8489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8482 return o.addScaledVector(dir,(planeY-o.y)/dir.y);
8483}
8484function clampTarget(){
8485 if(!W)return;
8486 const b=OPEN?OPEN.bounds:W.worldBounds, m=110;
8487 target.x=clamp(target.x,b.x0-m,b.x1+m);
8488 target.z=clamp(target.z,b.z0-m,b.z1+m);
8489}
8490/* ------------------------------------------------------------------ pinch
8491 Two fingers are the wheel. There is no other zoom on a phone: the gesture the
8492 browser would have handled is the one `touch-action:none` has to take away

Callers 3

pinchStepFunction · 0.85
createWorldEngineFunction · 0.85
flyToFunction · 0.85

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected