ソースを参照

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;
};


読み込み中…
キャンセル
保存