当前位置: 首页>>代码示例>>Java>>正文


Java NodeAnimation类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:24,代码来源:Model.java

示例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);
	}
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:27,代码来源:SharedModel.java

示例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);
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:29,代码来源:ModelInstance.java

示例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;
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:8,代码来源:BaseAnimationController.java


注:本文中的com.badlogic.gdx.graphics.g3d.model.NodeAnimation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。