在线免费看污_亚洲视频在线免费观看_91精品国产电影_久久国产亚洲_久久四虎影院_亚洲欧美a_国产精品一区二区三

ModelAnimationCollection

活動模型動畫的集合。使用Model#activeAnimations訪問此。
new ModelAnimationCollection()
See:

Members

animationAdded : Event

將動畫添加到集合時觸發(fā)的事件。例如,這可以用來保持用戶界面的同步。
Default Value: new Event()
Example:
model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  console.log('Animation added: ' + animation.name);
});

animationRemoved : Event

從集合中移除動畫時觸發(fā)的事件。例如,這可以用來保持用戶界面的同步。
Default Value: new Event()
Example:
model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  console.log('Animation removed: ' + animation.name);
});

(readonly) length : Number

集合中的動畫數(shù)。

Methods

add(options) → {ModelAnimation}
創(chuàng)建具有指定初始屬性的動畫并將其添加到集合中。

這將引發(fā)ModelAnimationCollection#animationAdded事件,例如,UI可以保持同步。

Parameters:
options (Object)
Name Description
options.name
String
標識動畫的GLTF動畫名稱。如果options.indexundefined,則必須定義。
options.index
Number
標識動畫的GLTF動畫索引。如果options.nameundefined,則必須定義。
options.startTime
JulianDate
開始播放動畫的場景時間。當這是undefined時,動畫將從下一幀開始。
options.delay
Number
default 0.0
startTime開始播放的延遲(秒)。
options.stopTime
JulianDate
停止播放動畫的場景時間。當這是undefined時,動畫將在其整個持續(xù)時間內(nèi)播放。
options.removeOnStop
Boolean
default false
true時,動畫停止播放后將被移除。
options.multiplier
Number
default 1.0
值大于1.0增加動畫相對于場景時鐘速度的播放速度;值小于1.0降低速度。
options.reverse
Boolean
default false
true時,動畫將反向播放。
options.loop
ModelAnimationLoop
default ModelAnimationLoop.NONE
確定動畫是否循環(huán)以及如何循環(huán)。
Examples
// Example 1. Add an animation by name
model.activeAnimations.add({
  name : 'animation name'
});

// Example 2. Add an animation by index
model.activeAnimations.add({
  index : 0
});
// Example 3. Add an animation and provide all properties and events
var startTime = bmgl.JulianDate.now();

var animation = model.activeAnimations.add({
  name : 'another animation name',
  startTime : startTime,
  delay : 0.0,                          // Play at startTime (default)
  stopTime : bmgl.JulianDate.addSeconds(startTime, 4.0, new bmgl.JulianDate()),
  removeOnStop : false,                 // Do not remove when animation stops (default)
  multiplier : 2.0,                        // Play at double speed
  reverse : true,                       // Play in reverse
  loop : bmgl.ModelAnimationLoop.REPEAT      // Loop the animation
});

animation.start.addEventListener(function(model, animation) {
  console.log('Animation started: ' + animation.name);
});
animation.update.addEventListener(function(model, animation, time) {
  console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
});
animation.stop.addEventListener(function(model, animation) {
  console.log('Animation stopped: ' + animation.name);
});
Throws
addAll(options) → {Array.<ModelAnimation>}
為模型中的每個動畫創(chuàng)建具有指定初始屬性的動畫并將其添加到集合中。

這會引發(fā)每個模型的ModelAnimationCollection#animationAdded事件,例如,UI可以保持同步。

Parameters:
options (Object)
Name Description
options.startTime
JulianDate
開始播放動畫的場景時間。當這是undefined時,動畫將從下一幀開始。
options.delay
Number
default 0.0
startTime開始播放的延遲(秒)。
options.stopTime
JulianDate
停止播放動畫的場景時間。當這是undefined時,動畫將在整個持續(xù)時間內(nèi)播放。
options.removeOnStop
Boolean
default false
true時,動畫在停止播放后被刪除。
options.multiplier
Number
default 1.0
值大于1.0增加動畫相對于場景時鐘速度的播放速度;值小于1.0降低速度。
options.reverse
Boolean
default false
true時,動畫將反向播放。
options.loop
ModelAnimationLoop
default ModelAnimationLoop.NONE
確定動畫是否循環(huán)以及如何循環(huán)。
Example
model.activeAnimations.addAll({
  multiplier : 0.5,                        // Play at half-speed
  loop : bmgl.ModelAnimationLoop.REPEAT      // Loop the animations
});
Throws
contains(animation) → {Boolean}
確定此集合是否包含給定的動畫。
Parameters:
animation (ModelAnimation) 要檢查的動畫。
get(index) → {ModelAnimation}
返回集合中指定索引處的動畫。索引是基于零的,并且隨著動畫的添加而增加。刪除動畫后,所有動畫都會向左移動,從而更改其索引。此函數(shù)通常用于迭代集合中的所有動畫。
Parameters:
index (Number) 動畫的從零開始的索引。
Example
// Output the names of all the animations in the collection.
var animations = model.activeAnimations;
var length = animations.length;
for (var i = 0; i < length; ++i) {
  console.log(animations.get(i).name);
}
remove(animation) → {Boolean}
從集合中刪除動畫。

這將引發(fā)ModelAnimationCollection#animationRemoved事件,例如,UI可以保持同步。

通過將ModelAnimation#removeOnStop設(shè)置為true也可以從集合中隱式刪除動畫。移除動畫時,ModelAnimationCollection#animationRemoved事件仍將被觸發(fā)。

Parameters:
animation (ModelAnimation) 要刪除的動畫。
Example
var a = model.activeAnimations.add({
  name : 'animation name'
});
model.activeAnimations.remove(a); // Returns true
removeAll()
從集合中刪除所有動畫。

這會為每個動畫引發(fā)ModelAnimationCollection#animationRemoved事件,例如,用戶界面可以保持同步。

主站蜘蛛池模板: 成人性视频在线三级 | 日本狠狠操 | 日本免费一级视频 | 免费成人黄色 | 日本精品一在线观看视频 | 天天搞天天爽 | 亚洲黄色中文字幕 | 起碰起在线视频公开免费 | 久久丁香视频 | 精品欧美一区二区三区免费观看 | 久热中文字幕在线 | www夜夜操| 69视频在线播放 | 久久99热这里只有精品免费看 | 且试天下电视剧39集免费观看 | 国产黄色激情视频 | 日本三级午夜 | 国产天堂网 | 久久午夜精品2区 | 久久久久国产午夜 | 69视频在线观看xxxxx | 天天爱天天色天天干 | 久久久精品一区二区三区 | 久久精品国产一区 | 男女69视频 | 日本aaa视频 | 青青操在线视频观看 | α片免费看 | 韩国三级理论在线看中文字幕 | 久久99精品国产免费观看 | 人人操天天射 | 青青久操 | 亚洲免费网站在线观看 | 久在草在线 | 色综合天 | 国产成人小视频 | a级毛片免费播放 | 国产成都一二三四区 | 黄 色 成 年人在线 黄 色 大 片 网站 | 韩国三级视频在线观看 | 中文字幕免费在线看线人 |