MCPcopy Index your code
hub / github.com/microsoft/SandDance / getViewMatrix

Function getViewMatrix

docs/app/js/sanddance-app.js:80383–80401  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

80381 ] : newLngLat;
80382}
80383function getViewMatrix(options) {
80384 const { height , pitch , bearing , altitude , scale , center } = options;
80385 const vm = (0, _mathUtils.createMat4)();
80386 _mat4.translate(vm, vm, [
80387 0,
80388 0,
80389 -altitude
80390 ]);
80391 _mat4.rotateX(vm, vm, -pitch * DEGREES_TO_RADIANS);
80392 _mat4.rotateZ(vm, vm, bearing * DEGREES_TO_RADIANS);
80393 const relativeScale = scale / height;
80394 _mat4.scale(vm, vm, [
80395 relativeScale,
80396 relativeScale,
80397 relativeScale
80398 ]);
80399 if (center) _mat4.translate(vm, vm, _vec3.negate([], center));
80400 return vm;
80401}
80402function getProjectionParameters(options) {
80403 const { width , height , altitude , pitch =0 , nearZMultiplier =1 , farZMultiplier =1 } = options;
80404 let { fovy =altitudeToFovy(DEFAULT_ALTITUDE) } = options;

Callers 1

OrbitViewport1Function · 0.70

Calls 7

translateMethod · 0.45
rotateXMethod · 0.45
rotateZMethod · 0.45
scaleMethod · 0.45
negateMethod · 0.45
lookAtMethod · 0.45
rotateYMethod · 0.45

Tested by

no test coverage detected