浏览代码

startAutoRotate | possible improvement (#883)

* pannellum.js | possible improvement

startAutoRotate = function(speed, pitch, hfov)

Use case:

1. by using "getPitch()" and "getHfov()" as parameter you can just rotate your panorama with the current view.
2. if origHfov is set to a small value (eg. to start with a highlight inside a big panorama) you still can use startAutoRotate with a wider view

* Update pannellum.js
pull/918/head
praefectius 4 年前
committed by GitHub
父节点
当前提交
825861a633
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      src/js/pannellum.js

+ 4
- 2
src/js/pannellum.js 查看文件

@@ -2806,13 +2806,15 @@ this.setHorizonPitch = function(pitch) {
* @instance
* @param {number} [speed] - Auto rotation speed / direction. If not specified, previous value is used.
* @param {number} [pitch] - The pitch to rotate at. If not specified, inital pitch is used.
* @param {number} [hfov] - The hfov to rotate at. If not specified, inital hfov is used.
* @returns {Viewer} `this`
*/
this.startAutoRotate = function(speed, pitch) {
this.startAutoRotate = function(speed, pitch, hfov) {
speed = speed || autoRotateSpeed || 1;
pitch = pitch === undefined ? origPitch : pitch;
hfov = hfov === undefined ? origHfov : hfov;
config.autoRotate = speed;
_this.lookAt(pitch, undefined, origHfov, 3000);
_this.lookAt(pitch, undefined, hfov, 3000);
animateInit();
return this;
};


正在加载...
取消
保存