• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SkeletonDebugger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jme3.scene.debug.SkeletonDebugger的典型用法代码示例。如果您正苦于以下问题:Java SkeletonDebugger类的具体用法?Java SkeletonDebugger怎么用?Java SkeletonDebugger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SkeletonDebugger类属于com.jme3.scene.debug包,在下文中一共展示了SkeletonDebugger类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: showSkeleton

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
public void showSkeleton(Node n) {
    Skeleton sk = null;
    SkeletonControl sc = n.getControl(SkeletonControl.class);
    if (sc != null) {
        sk = sc.getSkeleton();
    }
    AnimControl control = n.getControl(AnimControl.class);
    if (sk == null && control != null) {
        sk = control.getSkeleton();
    }
    if (sk != null) {
        final SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton." + n.getName(), sk);
        final Material mat = new Material(getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Green);
        mat.getAdditionalRenderState().setWireframe(true);
        mat.getAdditionalRenderState().setDepthTest(false);
        skeletonDebug.setMaterial(mat);
        n.attachChild(skeletonDebug);
    }
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:21,代码来源:TestJaimeJ3o.java


示例2: showSkeleton

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
public void showSkeleton(Node n) {
	Skeleton sk = null;
	SkeletonControl sc = n.getControl(SkeletonControl.class);
	if (sc != null) {
		sk = sc.getSkeleton();
	}
	AnimControl control = n.getControl(AnimControl.class);
	if (sk == null && control != null) {
		sk = control.getSkeleton();
	}
	if (sk != null) {
		final SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton." + n.getName(), sk);
		final Material mat = new Material(getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
		mat.setColor("Color", ColorRGBA.Green);
		mat.getAdditionalRenderState().setWireframe(true);
		mat.getAdditionalRenderState().setDepthTest(false);
		skeletonDebug.setMaterial(mat);
		n.attachChild(skeletonDebug);
	}
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:21,代码来源:TestXbufWithMaterialHook.java


示例3: debugSkeleton

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
/**
 * Debug Skeleton
 * @param skeleton
 * @param player 
 */
public static void debugSkeleton(Skeleton skeleton, Node player) {
    SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", skeleton);
    Material mat = new Material(LuoYing.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", ColorRGBA.Green);
    mat.getAdditionalRenderState().setDepthTest(false);
    skeletonDebug.setMaterial(mat);
    player.attachChild(skeletonDebug);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:14,代码来源:DebugUtils.java


示例4: debugSkeleton

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
public void debugSkeleton(Skeleton skeleton, Node node) {
	if (skeleton != null && node != null) {
		skeletonDebug = new SkeletonDebugger("skeleton", skeleton);
		Material mat = unshaded();
		mat.setColor("Color", ColorRGBA.Green);
		mat.getAdditionalRenderState().setDepthTest(false);
		skeletonDebug.setMaterial(mat);
		node.attachChild(skeletonDebug);
	}
}
 
开发者ID:morris,项目名称:vstools-java,代码行数:11,代码来源:App.java


示例5: simpleInitApp

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
@Override
public void simpleInitApp() {
    flyCam.setMoveSpeed(10f);
    cam.setLocation(new Vector3f(6.4013605f, 7.488437f, 12.843031f));
    cam.setRotation(new Quaternion(-0.060740203f, 0.93925786f, -0.2398315f, -0.2378785f));

    DirectionalLight dl = new DirectionalLight();
    dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal());
    dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
    rootNode.addLight(dl);

    Node model = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");

    control = model.getControl(AnimControl.class);

    AnimChannel feet = control.createChannel();
    AnimChannel leftHand = control.createChannel();
    AnimChannel rightHand = control.createChannel();

    // feet will dodge
    feet.addFromRootBone("hip.right");
    feet.addFromRootBone("hip.left");
    feet.setAnim("Dodge");
    feet.setSpeed(2);
    feet.setLoopMode(LoopMode.Cycle);

    // will blend over 15 seconds to stand
    feet.setAnim("Walk", 15);
    feet.setSpeed(0.25f);
    feet.setLoopMode(LoopMode.Cycle);

    // left hand will pull
    leftHand.addFromRootBone("uparm.right");
    leftHand.setAnim("pull");
    leftHand.setSpeed(.5f);

    // will blend over 15 seconds to stand
    leftHand.setAnim("stand", 15);

    // right hand will push
    rightHand.addBone("spinehigh");
    rightHand.addFromRootBone("uparm.left");
    rightHand.setAnim("push");

    SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton());
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.getAdditionalRenderState().setWireframe(true);
    mat.setColor("Color", ColorRGBA.Green);
    mat.getAdditionalRenderState().setDepthTest(false);
    skeletonDebug.setMaterial(mat);

    model.attachChild(skeletonDebug);
    rootNode.attachChild(model);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:55,代码来源:TestOgreComplexAnim.java


示例6: registerAction_ShowSkeleton

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void registerAction_ShowSkeleton(SpatialExplorer se, SimpleApplication app) {
	se.treeItemActions.add(new Action("Show Skeleton", (evt) -> {
		Spatial target = ((TreeItem<Spatial>)evt.getSource()).getValue();
		app.enqueue(() -> {
			target.breadthFirstTraversal(new SceneGraphVisitorAdapter(){
				public void visit(Node n) {
					String name = "skeletonDebugger.";
					int i = -1;
					Spatial child;
					do {
						i++;
						child = n.getChild(name + i);
					} while (child != null && !(child instanceof SkeletonDebugger));
					if (child != null) {
						n.detachChild(child);
					} else {
						Skeleton sk = null;
						SkeletonControl sc = n.getControl(SkeletonControl.class);
						if (sc != null) {
							sk = sc.getSkeleton();
						}
						AnimControl control = n.getControl(AnimControl.class);
						if (sk == null && control != null) {
							sk = control.getSkeleton();
						}
						if (sk != null) {
							final SkeletonDebugger skeletonDebug = new SkeletonDebugger(name + i, sk);
							final Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
							mat.setColor("Color", ColorRGBA.Green);
							mat.getAdditionalRenderState().setDepthTest(false);
							skeletonDebug.setMaterial(mat);
							n.attachChild(skeletonDebug);
						}
					}
				}
			});
			return null;
		});
	}));
}
 
开发者ID:davidB,项目名称:jme3_ext_spatial_explorer,代码行数:42,代码来源:Actions4Animation.java


示例7: testHwSkinning

import com.jme3.scene.debug.SkeletonDebugger; //导入依赖的package包/类
@Test
public void testHwSkinning() {
	SimpleApplication app=TestHelpers.buildApp(headless);
	TestHelpers.hijackUpdateThread(app);

	boolean created=false;
	try{
		Spatial scene=app.getAssetManager().loadModel("unit_tests/xbuf/hw_skinning.xbuf");
		app.getRootNode().attachChild(scene);
		scene.depthFirstTraversal(s -> {
			SkeletonControl sk=s.getControl(SkeletonControl.class);
			if(sk!=null){
				System.out.println("Found skeletoncontrol: "+sk+" on "+s);

				System.out.println("Set "+sk+".hwSkinning=true");
				sk.setHardwareSkinningPreferred(true);

				SkeletonDebugger skeletonDebug=new SkeletonDebugger("skeleton",sk.getSkeleton());
				Material mat=new Material(app.getAssetManager(),"Common/MatDefs/Misc/Unshaded.j3md");
				mat.setColor("Color",ColorRGBA.Green);
				mat.getAdditionalRenderState().setDepthTest(false);
				skeletonDebug.setMaterial(mat);
			    app.getRootNode().attachChild(skeletonDebug);
			    skeletonDebug.setLocalTranslation(s.getWorldTranslation());
			}

			AnimControl ac=s.getControl(AnimControl.class);

			if(ac!=null){

				System.out.println("Found animcontrol: "+ac+" on "+s);

				Collection<String> anims=ac.getAnimationNames();
				for(String a:anims){
					AnimChannel channel = ac.createChannel();
					channel.setAnim(a);
					channel.setLoopMode(LoopMode.Cycle);
					System.out.println("Set "+a+" to "+s);
				}
			}
		});
		created=true;
	}catch(Exception e){
		e.printStackTrace();
	}

	TestHelpers.releaseUpdateThread(app);
	if(!headless)TestHelpers.waitFor(app);
	TestHelpers.closeApp(app);

	assertTrue("Hardware skinning cannot be used.",created);



}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:56,代码来源:UnitTests.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Observers类代码示例发布时间:2022-05-23
下一篇:
Java RenderSpider类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap