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

Function screenToCommonSpace

docs/app/js/sanddance-app.js:79755–79768  ·  view source on GitHub ↗
(xyz, pixelUnprojectionMatrix)

Source from the content-addressed store, hash-verified

79753 0
79754];
79755function screenToCommonSpace(xyz, pixelUnprojectionMatrix) {
79756 var _xyz = (0, _slicedToArrayDefault.default)(xyz, 3), x = _xyz[0], y = _xyz[1], z = _xyz[2];
79757 var coord = (0, _webMercator.pixelsToWorld)([
79758 x,
79759 y,
79760 z
79761 ], pixelUnprojectionMatrix);
79762 if (Number.isFinite(z)) return coord;
79763 return [
79764 coord[0],
79765 coord[1],
79766 0
79767 ];
79768}
79769function getViewportCenterPosition(_ref) {
79770 var viewport = _ref.viewport, center = _ref.center;
79771 return new (0, _mathGl.Matrix4)(viewport.viewProjectionMatrix).invert().transform(center);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected