本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.model.NodeAnimation类的典型用法代码示例。如果您正苦于以下问题:Java NodeAnimation类的具体用法?Java NodeAnimation怎么用?Java NodeAnimation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NodeAnimation类属于com.badlogic.gdx.graphics.g3d.model包,在下文中一共展示了NodeAnimation类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadAnimations
import com.badlogic.gdx.graphics.g3d.model.NodeAnimation; //导入依赖的package包/类
private void loadAnimations (Iterable<ModelAnimation> modelAnimations) {
for (final ModelAnimation anim : modelAnimations) {
Animation animation = new Animation();
animation.id = anim.id;
for (ModelNodeAnimation nanim : anim.nodeAnimations) {
final Node node = getNode(nanim.nodeId);
if (node == null) continue;
NodeAnimation nodeAnim = new NodeAnimation();
nodeAnim.node = node;
for (ModelNodeKeyframe kf : nanim.keyframes) {
if (kf.keytime > animation.duration) animation.duration = kf.keytime;
NodeKeyframe keyframe = new NodeKeyframe();
keyframe.keytime = kf.keytime;
keyframe.rotation.set(kf.rotation == null ? node.rotation : kf.rotation);
keyframe.scale.set(kf.scale == null ? node.scale : kf.scale);
keyframe.translation.set(kf.translation == null ? node.translation : kf.translation);
nodeAnim.keyframes.add(keyframe);
}
if (nodeAnim.keyframes.size > 0) animation.nodeAnimations.add(nodeAnim);
}
if (animation.nodeAnimations.size > 0) animations.add(animation);
}
}
示例2: copyAnimations
import com.badlogic.gdx.graphics.g3d.model.NodeAnimation; //导入依赖的package包/类
private void copyAnimations (final Iterable<Animation> source) {
for (final Animation anim : source) {
Animation animation = new Animation();
animation.id = anim.id;
animation.duration = anim.duration;
for (final NodeAnimation nanim : anim.nodeAnimations) {
final Node node = getNode(nanim.node.id);
if (node == null)
continue;
NodeAnimation nodeAnim = new NodeAnimation();
nodeAnim.node = node;
for (final NodeKeyframe kf : nanim.keyframes) {
NodeKeyframe keyframe = new NodeKeyframe();
keyframe.keytime = kf.keytime;
keyframe.rotation.set(kf.rotation);
keyframe.scale.set(kf.scale);
keyframe.translation.set(kf.translation);
nodeAnim.keyframes.add(keyframe);
}
if (nodeAnim.keyframes.size > 0)
animation.nodeAnimations.add(nodeAnim);
}
if (animation.nodeAnimations.size > 0)
animations.add(animation);
}
}
示例3: copyAnimations
import com.badlogic.gdx.graphics.g3d.model.NodeAnimation; //导入依赖的package包/类
private void copyAnimations (final Iterable<Animation> source, boolean shareKeyframes) {
for (final Animation anim : source) {
Animation animation = new Animation();
animation.id = anim.id;
animation.duration = anim.duration;
for (final NodeAnimation nanim : anim.nodeAnimations) {
final Node node = getNode(nanim.node.id);
if (node == null) continue;
NodeAnimation nodeAnim = new NodeAnimation();
nodeAnim.node = node;
if (shareKeyframes)
nodeAnim.keyframes = nanim.keyframes;
else {
for (final NodeKeyframe kf : nanim.keyframes) {
NodeKeyframe keyframe = new NodeKeyframe();
keyframe.keytime = kf.keytime;
keyframe.rotation.set(kf.rotation);
keyframe.scale.set(kf.scale);
keyframe.translation.set(kf.translation);
nodeAnim.keyframes.add(keyframe);
}
}
if (nodeAnim.keyframes.size > 0) animation.nodeAnimations.add(nodeAnim);
}
if (animation.nodeAnimations.size > 0) animations.add(animation);
}
}
示例4: removeAnimation
import com.badlogic.gdx.graphics.g3d.model.NodeAnimation; //导入依赖的package包/类
/** Remove the specified animation, by marking the affected nodes as not animated. When switching animation, this should be call
* prior to applyAnimation(s). */
protected void removeAnimation (final Animation animation) {
for (final NodeAnimation nodeAnim : animation.nodeAnimations) {
nodeAnim.node.isAnimated = false;
}
}