jmeSpatial.addControl(new SkeletonControl(fbxNode.skeleton)); SkeletonDebugger sd = new SkeletonDebugger("debug", fbxNode.skeleton); Material mat = new Material(fbxNode.assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.getAdditionalRenderState().setWireframe(true); mat.getAdditionalRenderState().setDepthTest(false); mat.setColor("Color", ColorRGBA.Green); sd.setMaterial(mat);
/** * Creates a debugger with bone lengths data. If the data is supplied then the wires will show each full bone (from head to tail), * the points will display both heads and tails of the bones and dotted lines between bones will be seen. * @param name * the name of the debugger's node * @param skeleton * the skeleton that will be shown * @param boneLengths * a map between the bone's index and the bone's length */ public SkeletonDebugger(String name, Skeleton skeleton, Map<Integer, Float> boneLengths) { super(name); wires = new SkeletonWire(skeleton, boneLengths); points = new SkeletonPoints(skeleton, boneLengths); this.attachChild(new Geometry(name + "_wires", wires)); this.attachChild(new Geometry(name + "_points", points)); if (boneLengths != null) { interBoneWires = new SkeletonInterBoneWire(skeleton, boneLengths); this.attachChild(new Geometry(name + "_interwires", interBoneWires)); } this.setQueueBucket(Bucket.Transparent); }
SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton()); Material mat2 = new Material(getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat2.getAdditionalRenderState().setWireframe(true); mat2.setColor("Color", ColorRGBA.Green); mat2.getAdditionalRenderState().setDepthTest(false); skeletonDebug.setMaterial(mat2); skeletonDebug.setLocalTranslation(model.getLocalTranslation());
public void initDebugSkeleton(AssetManager assetMgr) { // AnimControl humanoidControl = myHumanoidModelNode.getControl(AnimControl.class); if (myJMESkeletonDebugger == null) { myJMESkeletonDebugger = new SkeletonDebugger(SKEL_DEBUG_NAME, myJMESkeleton); String unshadedMatPath = myHFConfig.getDebugSkelMatPath(); Material mat2 = new Material(assetMgr, unshadedMatPath); mat2.getAdditionalRenderState().setWireframe(true); mat2.setColor("Color", ColorRGBA.Green); mat2.getAdditionalRenderState().setDepthTest(false); myJMESkeletonDebugger.setMaterial(mat2); } myJMESkeletonDebugger.setLocalTranslation(myJME3ModelSceneNode.getLocalTranslation()); } public void toggleDebugSkeleton_onSceneThread() {
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.setFloat("PointSize", 7f); mat.getAdditionalRenderState().setDepthTest(false); skeletonDebug.setMaterial(mat);
public SkeletonDebugger(String name, Skeleton skeleton){ super(name); this.skeleton = skeleton; wires = new SkeletonWire(skeleton); points = new SkeletonPoints(skeleton); attachChild(new Geometry(name+"_wires", wires)); attachChild(new Geometry(name+"_points", points)); setQueueBucket(Bucket.Transparent); }
public static void attachSkeleton(AssetManager am, Node player, AnimControl control) { SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton()); Material mat2 = new Material(am, "Common/MatDefs/Misc/Unshaded.j3md"); mat2.setColor("Color", ColorRGBA.Yellow); mat2.getAdditionalRenderState().setDepthTest(false); skeletonDebug.setMaterial(mat2); player.attachChild(skeletonDebug); }
/** * Creates a debugger with bone lengths data. If the data is supplied then the wires will show each full bone (from head to tail), * the points will display both heads and tails of the bones and dotted lines between bones will be seen. * @param name * the name of the debugger's node * @param skeleton * the skeleton that will be shown * @param boneLengths * a map between the bone's index and the bone's length */ public SkeletonDebugger(String name, Skeleton skeleton, Map<Integer, Float> boneLengths) { super(name); wires = new SkeletonWire(skeleton, boneLengths); points = new SkeletonPoints(skeleton, boneLengths); this.attachChild(new Geometry(name + "_wires", wires)); this.attachChild(new Geometry(name + "_points", points)); if (boneLengths != null) { interBoneWires = new SkeletonInterBoneWire(skeleton, boneLengths); this.attachChild(new Geometry(name + "_interwires", interBoneWires)); } this.setQueueBucket(Bucket.Transparent); }
SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton()); Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat2.setColor("Color", ColorRGBA.Green); mat2.getAdditionalRenderState().setDepthTest(false); skeletonDebug.setMaterial(mat2); ((Node)usedObject).attachChild(skeletonDebug);
jmeSpatial.addControl(new SkeletonControl(fbxNode.skeleton)); SkeletonDebugger sd = new SkeletonDebugger("debug", fbxNode.skeleton); Material mat = new Material(fbxNode.assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.getAdditionalRenderState().setWireframe(true); mat.getAdditionalRenderState().setDepthTest(false); mat.setColor("Color", ColorRGBA.Green); sd.setMaterial(mat);