Socket
Socket
Sign inDemoInstall

@antv/g-camera-api

Package Overview
Dependencies
10
Maintainers
64
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.32 to 1.0.33

1

dist/AdvancedCamera.d.ts

@@ -29,2 +29,3 @@ import { Camera } from '@antv/g-lite';

dolly(value: number): this;
cancelLandmarkAnimation(): void;
createLandmark(name: string, params?: Partial<{

@@ -31,0 +32,0 @@ position: vec3 | vec2;

9

dist/index.esm.js

@@ -108,2 +108,7 @@ import { getAngle, CameraType, deg2rad, createVec3, runtime, Camera } from '@antv/g-lite';

};
_proto.cancelLandmarkAnimation = function cancelLandmarkAnimation() {
if (this.landmarkAnimationID !== undefined) {
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
}
};
_proto.createLandmark = function createLandmark(name, params) {

@@ -178,5 +183,3 @@ var _position$, _position$2, _focalPoint$, _focalPoint$2;

// cancel ongoing animation
if (this.landmarkAnimationID !== undefined) {
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
}
this.cancelLandmarkAnimation();
var destPosition = landmark.position;

@@ -183,0 +186,0 @@ var destFocalPoint = landmark.focalPoint;

@@ -112,2 +112,7 @@ 'use strict';

};
_proto.cancelLandmarkAnimation = function cancelLandmarkAnimation() {
if (this.landmarkAnimationID !== undefined) {
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
}
};
_proto.createLandmark = function createLandmark(name, params) {

@@ -182,5 +187,3 @@ var _position$, _position$2, _focalPoint$, _focalPoint$2;

// cancel ongoing animation
if (this.landmarkAnimationID !== undefined) {
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
}
this.cancelLandmarkAnimation();
var destPosition = landmark.position;

@@ -187,0 +190,0 @@ var destFocalPoint = landmark.focalPoint;

@@ -1039,2 +1039,7 @@ (function (global, factory) {

};
_proto.cancelLandmarkAnimation = function cancelLandmarkAnimation() {
if (this.landmarkAnimationID !== undefined) {
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
}
};
_proto.createLandmark = function createLandmark(name, params) {

@@ -1109,5 +1114,3 @@ var _position$, _position$2, _focalPoint$, _focalPoint$2;

// cancel ongoing animation
if (this.landmarkAnimationID !== undefined) {
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
}
this.cancelLandmarkAnimation();
var destPosition = landmark.position;

@@ -1114,0 +1117,0 @@ var destFocalPoint = landmark.focalPoint;

@@ -1,1 +0,1 @@

!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],i):i(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CameraAPI={}),t.window.G)}(this,(function(t,i){"use strict";function n(t,i){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},n(t,i)}var o="undefined"!=typeof Float32Array?Float32Array:Array;function e(t){var i=new o(16);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function r(t,i,n){var o,e,r,a,s,l,h,u,c,d,m,f,p=n[0],v=n[1],g=n[2];return i===t?(t[12]=i[0]*p+i[4]*v+i[8]*g+i[12],t[13]=i[1]*p+i[5]*v+i[9]*g+i[13],t[14]=i[2]*p+i[6]*v+i[10]*g+i[14],t[15]=i[3]*p+i[7]*v+i[11]*g+i[15]):(e=i[1],r=i[2],a=i[3],s=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],m=i[10],f=i[11],t[0]=o=i[0],t[1]=e,t[2]=r,t[3]=a,t[4]=s,t[5]=l,t[6]=h,t[7]=u,t[8]=c,t[9]=d,t[10]=m,t[11]=f,t[12]=o*p+s*v+c*g+i[12],t[13]=e*p+l*v+d*g+i[13],t[14]=r*p+h*v+m*g+i[14],t[15]=a*p+u*v+f*g+i[15]),t}function a(){var t=new o(3);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var i=new o(3);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i}function l(t,i,n){var e=new o(3);return e[0]=t,e[1]=i,e[2]=n,e}function h(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t}function u(t,i,n){return t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function c(t,i,n){return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t}function d(t,i,n){var o=i[0],e=i[1],r=i[2],a=n[0],s=n[1],l=n[2];return t[0]=e*l-r*s,t[1]=r*a-o*l,t[2]=o*s-e*a,t}function m(t,i,n,o){var e=i[0],r=i[1],a=i[2];return t[0]=e+o*(n[0]-e),t[1]=r+o*(n[1]-r),t[2]=a+o*(n[2]-a),t}Math.hypot||(Math.hypot=function(){for(var t=0,i=arguments.length;i--;)t+=arguments[i]*arguments[i];return Math.sqrt(t)});var f,p=function(t,i){return Math.hypot(i[0]-t[0],i[1]-t[1],i[2]-t[2])},v=function(t){return Math.hypot(t[0],t[1],t[2])};f=a();!function(){var t,i=(t=new o(4),o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function g(){var t=new o(4);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function y(t,i,n){var o=Math.sin(n*=.5);return t[0]=o*i[0],t[1]=o*i[1],t[2]=o*i[2],t[3]=Math.cos(n),t}function A(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=n[0],l=n[1],h=n[2],u=n[3];return t[0]=o*u+a*s+e*h-r*l,t[1]=e*u+a*l+r*s-o*h,t[2]=r*u+a*h+o*l-e*s,t[3]=a*u-o*s-e*l-r*h,t}function P(t,i,n,o){var e,r,a,s,l,h=i[0],u=i[1],c=i[2],d=i[3],m=n[0],f=n[1],p=n[2],v=n[3];return 0>(r=h*m+u*f+c*p+d*v)&&(r=-r,m=-m,f=-f,p=-p,v=-v),1-r>1e-6?(a=Math.sin(e=Math.acos(r)),s=Math.sin((1-o)*e)/a,l=Math.sin(o*e)/a):(s=1-o,l=o),t[0]=s*h+l*m,t[1]=s*u+l*f,t[2]=s*c+l*p,t[3]=s*d+l*v,t}var x,z,F,M,R,w,C,T=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n*n+o*o+e*e+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=o*a,t[2]=e*a,t[3]=r*a,t},I=(x=a(),z=l(1,0,0),F=l(0,1,0),M=g(),R=g(),w=new o(9),o!=Float32Array&&(w[1]=0,w[2]=0,w[3]=0,w[5]=0,w[6]=0,w[7]=0),w[0]=1,w[4]=1,w[8]=1,C=w,{}.toString),b=function(t,i){return I.call(t)==="[object "+i+"]"},_=function(t){var l,d;function f(){for(var i,n=arguments.length,o=Array(n),e=0;n>e;e++)o[e]=arguments[e];return(i=t.call.apply(t,[this].concat(o))||this).landmarks=[],i.landmarkAnimationID=void 0,i}(l=f).prototype=Object.create((d=t).prototype),l.prototype.constructor=l,n(l,d);var v=f.prototype;return v.rotate=function(t,n,e){if(this.relElevation=i.getAngle(n),this.relAzimuth=i.getAngle(t),this.relRoll=i.getAngle(e),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===i.CameraType.EXPLORING){var a=y(g(),[1,0,0],i.deg2rad((this.rotateWorld?1:-1)*this.relElevation)),s=y(g(),[0,1,0],i.deg2rad((this.rotateWorld?1:-1)*this.relAzimuth)),l=y(g(),[0,0,1],i.deg2rad(this.relRoll)),h=A(g(),s,a);h=A(g(),h,l);var u=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n+n,s=o+o,l=e+e,h=n*a,u=o*a,c=o*s,d=e*a,m=e*s,f=e*l,p=r*a,v=r*s,g=r*l;return t[0]=1-c-f,t[1]=u+g,t[2]=d-v,t[3]=0,t[4]=u-g,t[5]=1-h-f,t[6]=m+p,t[7]=0,t[8]=d+v,t[9]=m-p,t[10]=1-h-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(function(){var t=new o(16);return o!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}(),h);r(this.matrix,this.matrix,[0,0,-this.distance]),function(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],m=i[10],f=i[11],p=i[12],v=i[13],g=i[14],y=i[15],A=n[0],P=n[1],x=n[2],z=n[3];t[0]=A*o+P*s+x*c+z*p,t[1]=A*e+P*l+x*d+z*v,t[2]=A*r+P*h+x*m+z*g,t[3]=A*a+P*u+x*f+z*y,t[4]=(A=n[4])*o+(P=n[5])*s+(x=n[6])*c+(z=n[7])*p,t[5]=A*e+P*l+x*d+z*v,t[6]=A*r+P*h+x*m+z*g,t[7]=A*a+P*u+x*f+z*y,t[8]=(A=n[8])*o+(P=n[9])*s+(x=n[10])*c+(z=n[11])*p,t[9]=A*e+P*l+x*d+z*v,t[10]=A*r+P*h+x*m+z*g,t[11]=A*a+P*u+x*f+z*y,t[12]=(A=n[12])*o+(P=n[13])*s+(x=n[14])*c+(z=n[15])*p,t[13]=A*e+P*l+x*d+z*v,t[14]=A*r+P*h+x*m+z*g,t[15]=A*a+P*u+x*f+z*y}(this.matrix,this.matrix,u),r(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getPosition():this.type===i.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},v.pan=function(t,n){var o=i.createVec3(t,n,0),e=s(this.position);return u(e,e,c(a(),this.right,o[0])),u(e,e,c(a(),this.up,o[1])),this._setPosition(e),this.triggerUpdate(),this},v.dolly=function(t){var n,o=this.forward,e=s(this.position);return e[0]+=(n=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*o[0],e[1]+=n*o[1],e[2]+=n*o[2],this._setPosition(e),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getDistance():this.type===i.CameraType.TRACKING&&u(this.focalPoint,e,this.distanceVector),this.triggerUpdate(),this},v.createLandmark=function(t,n){var o,r,a,l;void 0===n&&(n={});var h=n.position,u=void 0===h?this.position:h,c=n.focalPoint,d=void 0===c?this.focalPoint:c,m=n.roll,f=n.zoom,p=new i.runtime.CameraContribution;p.setType(this.type,void 0),p.setPosition(u[0],null!==(o=u[1])&&void 0!==o?o:this.position[1],null!==(r=u[2])&&void 0!==r?r:this.position[2]),p.setFocalPoint(d[0],null!==(a=d[1])&&void 0!==a?a:this.focalPoint[1],null!==(l=d[2])&&void 0!==l?l:this.focalPoint[2]),p.setRoll(null!=m?m:this.roll),p.setZoom(null!=f?f:this.zoom);var v={name:t,matrix:e(p.getWorldTransform()),right:s(p.right),up:s(p.up),forward:s(p.forward),position:s(p.getPosition()),focalPoint:s(p.getFocalPoint()),distanceVector:s(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(v),v},v.gotoLandmark=function(t,n){var o=this;void 0===n&&(n={});var e=b(t,"String")?this.landmarks.find((function(i){return i.name===t})):t;if(e){var r=b(n,"Number")?{duration:n}:n,s=r.easing,l=void 0===s?"linear":s,h=r.duration,u=void 0===h?100:h,c=r.easingFunction,d=void 0===c?void 0:c,f=r.onfinish,v=void 0===f?void 0:f;if(0===u)return this.syncFromLandmark(e),void(v&&v());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var g,y=e.position,A=e.focalPoint,P=e.zoom,x=e.roll,z=d||i.runtime.EasingFunction(l),F=function(){o.setFocalPoint(A),o.setPosition(y),o.setRoll(x),o.setZoom(P),o.computeMatrix(),o.triggerUpdate(),v&&v()};this.canvas.requestAnimationFrame((function t(i){void 0===g&&(g=i);var n=i-g;if(u<n)F();else{var e,r,s=z(n/u),l=a(),h=a();m(l,o.focalPoint,A,s),m(h,o.position,y,s),r=o.roll*(1-s)+x*s,e=o.zoom*(1-s)+P*s,o.setFocalPoint(l),o.setPosition(h),o.setRoll(r),o.setZoom(e),p(l,A)+p(h,y)>.01?(o.computeMatrix(),o.triggerUpdate(),u>n&&(o.landmarkAnimationID=o.canvas.requestAnimationFrame(t))):F()}}))}},v.syncFromLandmark=function(t){this.matrix=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t}(this.matrix,t.matrix),this.right=h(this.right,t.right),this.up=h(this.up,t.up),this.forward=h(this.forward,t.forward),this.position=h(this.position,t.position),this.focalPoint=h(this.focalPoint,t.focalPoint),this.distanceVector=h(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},f}(i.Camera);i.runtime.CameraContribution=_,t.AdvancedCamera=_,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],i):i(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CameraAPI={}),t.window.G)}(this,(function(t,i){"use strict";function n(t,i){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},n(t,i)}var o="undefined"!=typeof Float32Array?Float32Array:Array;function e(t){var i=new o(16);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function r(t,i,n){var o,e,r,a,s,l,h,u,c,d,m,f,p=n[0],v=n[1],g=n[2];return i===t?(t[12]=i[0]*p+i[4]*v+i[8]*g+i[12],t[13]=i[1]*p+i[5]*v+i[9]*g+i[13],t[14]=i[2]*p+i[6]*v+i[10]*g+i[14],t[15]=i[3]*p+i[7]*v+i[11]*g+i[15]):(e=i[1],r=i[2],a=i[3],s=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],m=i[10],f=i[11],t[0]=o=i[0],t[1]=e,t[2]=r,t[3]=a,t[4]=s,t[5]=l,t[6]=h,t[7]=u,t[8]=c,t[9]=d,t[10]=m,t[11]=f,t[12]=o*p+s*v+c*g+i[12],t[13]=e*p+l*v+d*g+i[13],t[14]=r*p+h*v+m*g+i[14],t[15]=a*p+u*v+f*g+i[15]),t}function a(){var t=new o(3);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var i=new o(3);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i}function l(t,i,n){var e=new o(3);return e[0]=t,e[1]=i,e[2]=n,e}function h(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t}function u(t,i,n){return t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function c(t,i,n){return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t}function d(t,i,n){var o=i[0],e=i[1],r=i[2],a=n[0],s=n[1],l=n[2];return t[0]=e*l-r*s,t[1]=r*a-o*l,t[2]=o*s-e*a,t}function m(t,i,n,o){var e=i[0],r=i[1],a=i[2];return t[0]=e+o*(n[0]-e),t[1]=r+o*(n[1]-r),t[2]=a+o*(n[2]-a),t}Math.hypot||(Math.hypot=function(){for(var t=0,i=arguments.length;i--;)t+=arguments[i]*arguments[i];return Math.sqrt(t)});var f,p=function(t,i){return Math.hypot(i[0]-t[0],i[1]-t[1],i[2]-t[2])},v=function(t){return Math.hypot(t[0],t[1],t[2])};f=a();!function(){var t,i=(t=new o(4),o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function g(){var t=new o(4);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function y(t,i,n){var o=Math.sin(n*=.5);return t[0]=o*i[0],t[1]=o*i[1],t[2]=o*i[2],t[3]=Math.cos(n),t}function A(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=n[0],l=n[1],h=n[2],u=n[3];return t[0]=o*u+a*s+e*h-r*l,t[1]=e*u+a*l+r*s-o*h,t[2]=r*u+a*h+o*l-e*s,t[3]=a*u-o*s-e*l-r*h,t}function P(t,i,n,o){var e,r,a,s,l,h=i[0],u=i[1],c=i[2],d=i[3],m=n[0],f=n[1],p=n[2],v=n[3];return 0>(r=h*m+u*f+c*p+d*v)&&(r=-r,m=-m,f=-f,p=-p,v=-v),1-r>1e-6?(a=Math.sin(e=Math.acos(r)),s=Math.sin((1-o)*e)/a,l=Math.sin(o*e)/a):(s=1-o,l=o),t[0]=s*h+l*m,t[1]=s*u+l*f,t[2]=s*c+l*p,t[3]=s*d+l*v,t}var x,z,F,M,R,w,C,T=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n*n+o*o+e*e+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=o*a,t[2]=e*a,t[3]=r*a,t},I=(x=a(),z=l(1,0,0),F=l(0,1,0),M=g(),R=g(),w=new o(9),o!=Float32Array&&(w[1]=0,w[2]=0,w[3]=0,w[5]=0,w[6]=0,w[7]=0),w[0]=1,w[4]=1,w[8]=1,C=w,{}.toString),b=function(t,i){return I.call(t)==="[object "+i+"]"},k=function(t){var l,d;function f(){for(var i,n=arguments.length,o=Array(n),e=0;n>e;e++)o[e]=arguments[e];return(i=t.call.apply(t,[this].concat(o))||this).landmarks=[],i.landmarkAnimationID=void 0,i}(l=f).prototype=Object.create((d=t).prototype),l.prototype.constructor=l,n(l,d);var v=f.prototype;return v.rotate=function(t,n,e){if(this.relElevation=i.getAngle(n),this.relAzimuth=i.getAngle(t),this.relRoll=i.getAngle(e),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===i.CameraType.EXPLORING){var a=y(g(),[1,0,0],i.deg2rad((this.rotateWorld?1:-1)*this.relElevation)),s=y(g(),[0,1,0],i.deg2rad((this.rotateWorld?1:-1)*this.relAzimuth)),l=y(g(),[0,0,1],i.deg2rad(this.relRoll)),h=A(g(),s,a);h=A(g(),h,l);var u=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n+n,s=o+o,l=e+e,h=n*a,u=o*a,c=o*s,d=e*a,m=e*s,f=e*l,p=r*a,v=r*s,g=r*l;return t[0]=1-c-f,t[1]=u+g,t[2]=d-v,t[3]=0,t[4]=u-g,t[5]=1-h-f,t[6]=m+p,t[7]=0,t[8]=d+v,t[9]=m-p,t[10]=1-h-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(function(){var t=new o(16);return o!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}(),h);r(this.matrix,this.matrix,[0,0,-this.distance]),function(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],m=i[10],f=i[11],p=i[12],v=i[13],g=i[14],y=i[15],A=n[0],P=n[1],x=n[2],z=n[3];t[0]=A*o+P*s+x*c+z*p,t[1]=A*e+P*l+x*d+z*v,t[2]=A*r+P*h+x*m+z*g,t[3]=A*a+P*u+x*f+z*y,t[4]=(A=n[4])*o+(P=n[5])*s+(x=n[6])*c+(z=n[7])*p,t[5]=A*e+P*l+x*d+z*v,t[6]=A*r+P*h+x*m+z*g,t[7]=A*a+P*u+x*f+z*y,t[8]=(A=n[8])*o+(P=n[9])*s+(x=n[10])*c+(z=n[11])*p,t[9]=A*e+P*l+x*d+z*v,t[10]=A*r+P*h+x*m+z*g,t[11]=A*a+P*u+x*f+z*y,t[12]=(A=n[12])*o+(P=n[13])*s+(x=n[14])*c+(z=n[15])*p,t[13]=A*e+P*l+x*d+z*v,t[14]=A*r+P*h+x*m+z*g,t[15]=A*a+P*u+x*f+z*y}(this.matrix,this.matrix,u),r(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getPosition():this.type===i.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},v.pan=function(t,n){var o=i.createVec3(t,n,0),e=s(this.position);return u(e,e,c(a(),this.right,o[0])),u(e,e,c(a(),this.up,o[1])),this._setPosition(e),this.triggerUpdate(),this},v.dolly=function(t){var n,o=this.forward,e=s(this.position);return e[0]+=(n=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*o[0],e[1]+=n*o[1],e[2]+=n*o[2],this._setPosition(e),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getDistance():this.type===i.CameraType.TRACKING&&u(this.focalPoint,e,this.distanceVector),this.triggerUpdate(),this},v.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},v.createLandmark=function(t,n){var o,r,a,l;void 0===n&&(n={});var h=n.position,u=void 0===h?this.position:h,c=n.focalPoint,d=void 0===c?this.focalPoint:c,m=n.roll,f=n.zoom,p=new i.runtime.CameraContribution;p.setType(this.type,void 0),p.setPosition(u[0],null!==(o=u[1])&&void 0!==o?o:this.position[1],null!==(r=u[2])&&void 0!==r?r:this.position[2]),p.setFocalPoint(d[0],null!==(a=d[1])&&void 0!==a?a:this.focalPoint[1],null!==(l=d[2])&&void 0!==l?l:this.focalPoint[2]),p.setRoll(null!=m?m:this.roll),p.setZoom(null!=f?f:this.zoom);var v={name:t,matrix:e(p.getWorldTransform()),right:s(p.right),up:s(p.up),forward:s(p.forward),position:s(p.getPosition()),focalPoint:s(p.getFocalPoint()),distanceVector:s(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(v),v},v.gotoLandmark=function(t,n){var o=this;void 0===n&&(n={});var e=b(t,"String")?this.landmarks.find((function(i){return i.name===t})):t;if(e){var r=b(n,"Number")?{duration:n}:n,s=r.easing,l=void 0===s?"linear":s,h=r.duration,u=void 0===h?100:h,c=r.easingFunction,d=void 0===c?void 0:c,f=r.onfinish,v=void 0===f?void 0:f;if(0===u)return this.syncFromLandmark(e),void(v&&v());this.cancelLandmarkAnimation();var g,y=e.position,A=e.focalPoint,P=e.zoom,x=e.roll,z=d||i.runtime.EasingFunction(l),F=function(){o.setFocalPoint(A),o.setPosition(y),o.setRoll(x),o.setZoom(P),o.computeMatrix(),o.triggerUpdate(),v&&v()};this.canvas.requestAnimationFrame((function t(i){void 0===g&&(g=i);var n=i-g;if(u<n)F();else{var e,r,s=z(n/u),l=a(),h=a();m(l,o.focalPoint,A,s),m(h,o.position,y,s),r=o.roll*(1-s)+x*s,e=o.zoom*(1-s)+P*s,o.setFocalPoint(l),o.setPosition(h),o.setRoll(r),o.setZoom(e),p(l,A)+p(h,y)>.01?(o.computeMatrix(),o.triggerUpdate(),u>n&&(o.landmarkAnimationID=o.canvas.requestAnimationFrame(t))):F()}}))}},v.syncFromLandmark=function(t){this.matrix=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t}(this.matrix,t.matrix),this.right=h(this.right,t.right),this.up=h(this.up,t.up),this.forward=h(this.forward,t.forward),this.position=h(this.position,t.position),this.focalPoint=h(this.focalPoint,t.focalPoint),this.distanceVector=h(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},f}(i.Camera);i.runtime.CameraContribution=k,t.AdvancedCamera=k,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "@antv/g-camera-api",
"version": "1.0.32",
"version": "1.0.33",
"description": "A simple implementation of Camera API.",

@@ -44,3 +44,3 @@ "keywords": [

},
"gitHead": "f199d2d7cb0fec41416f83da859ad48cdc0ec69e"
"gitHead": "9ffd7b021d2da1be25fa8579e65eb48c839aad30"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc