Package com.jme3.animation

Examples of com.jme3.animation.AnimChannel


        while (it.hasNext()) {
            BaseEntity ent = (BaseEntity) it.next();
            if (ent.getAnimComponent() != null) {
                if (ent.getAnimComponent().getCurAnim() != null) {
                    AnimInfo curAnimInfo = map.get(ent.getAnimComponent().getCurAnim());
                    AnimChannel channel = ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY);

                    if (GameState.getGameState() == GameState.RUNNING) {
                        if (channel.getAnimationName() != null ) {
                            if (!channel.getAnimationName().equals(curAnimInfo.name) || ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY).getSpeed() == 0f) {
                                ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY).setLoopMode(curAnimInfo.loop);
                                ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY).setSpeed(curAnimInfo.speed);
                                ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY).setAnim(curAnimInfo.name, curAnimInfo.blendTime);
                            }
                        }
View Full Code Here


        it = entList.iterator();
        while (it.hasNext()) {
            BaseEntity ent = (BaseEntity) it.next();
            if (ent.getAnimComponent() != null) {
                if (ent.getAnimComponent().getCurAnim() != null) {
                    AnimChannel channel = ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY);
                    if (channel.getAnimationName() != null) {
                        ent.getAnimComponent().getAnimControl().getChannel(AnimConf.UPPER_BODY).setSpeed(0f);
                    }
                }
            }
        }
View Full Code Here

    if (anim != null) {
      String newAnim = anim.getName();
      // FIXME jme2 -> jme3
      // Something to blend over at all? (JME2 does not handle setting the
      // same animation gracefully
      AnimChannel channel = internalController.getChannel(0);
      if (channel != null && newAnim != null && newAnim.length()>0) {
        String name = channel.getAnimationName();
        if (name == null
            || !channel.getAnimationName().equals(newAnim)) {
          channel.setAnim(newAnim, anim.getBlendTime());
          channel.setLoopMode(anim.isLooping() ? LoopMode.Loop
              : LoopMode.DontLoop);
          channel.setSpeed(anim.getPlayBackRate());

        }
      }
    }
  }
View Full Code Here

//        baseNode.updateGeometricState();
        vis = baseNode.clone(false);
        vis.setName(name);
       
        AnimControl animControl = vis.getControl(AnimControl.class);
        AnimChannel chan;
        if(animControl != null) {
         
          if (animControl.getNumChannels()<=0){
            animControl.createChannel();
          }
          chan = animControl.getChannel(0);
            chan.setAnim("idle");
            chan.setTime(animControl.getAnimationLength("idle")
            * FastMath.nextRandomFloat());
         
        } else {
          logger.severe("Vis animations are missing for troll");
        }
View Full Code Here

  @Override
  public void setInternalAnimation(com.l2client.animsystem.Animation anim) {
    if(anim != null){
      //FIXME jme2 -> jme3
      //Something to blend over at all? (JME2 does not handle setting the same animation gracefully
      AnimChannel channel = internalController.getChannel(0);
      if(channel != null){
        String name = channel.getAnimationName();
          if(name == null || !channel.getAnimationName().equals(anim.getName())){
            channel.setAnim(anim.getName(), anim.getBlendTime());
            channel.setLoopMode(anim.isLooping()?LoopMode.Loop:LoopMode.DontLoop);
            channel.setSpeed(anim.getPlayBackRate());
          }
      }
    }
  }
View Full Code Here

        if (constraints != null && constraints.size() > 0) {
            Set<Long> alteredOmas = new HashSet<Long>();

            if (animations != null) {
                TempVars vars = TempVars.get();
                AnimChannel animChannel = animControl.createChannel();
                for (Animation animation : animations) {
                    float[] animationTimeBoundaries = this.computeAnimationTimeBoundaries(animation);
                    int maxFrame = (int) animationTimeBoundaries[0];
                    float maxTime = animationTimeBoundaries[1];
View Full Code Here

  public static void startApp(){
    app.startCanvas();
    app.enqueue(new Callable<Void>(){
      public Void call(){
        if (app instanceof SimpleApplication){
          SimpleApplication simpleApp = (SimpleApplication) app;
          simpleApp.getFlyByCamera().setDragToRotate(true);
          String assdir =  new File(workspace).getAbsolutePath();
          app.setAssetsPath(assdir);
        }
        return null;
      }
View Full Code Here

     * Attaches Statistics View to guiNode and displays it on the screen
     * above FPS statistics line.
     *
     */
    public void loadStatsView() {
        statsView = new StatsView("Statistics View", assetManager, renderer.getStatistics());
//         move it up so it appears above fps text
        statsView.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        guiNode.attachChild(statsView);
    }
View Full Code Here

        listener = new Listener();
        ar.setListener(listener);
       
        // init StateManager ----------------------------
        stateManager = new AppStateManager(this);
       
        // simple Init ----------------------------------
        guiNode.setQueueBucket(Bucket.Gui);
        guiNode.setCullHint(CullHint.Never);
        //loadFPSText();
View Full Code Here

    private void setColor(Node node, ColorRGBA color){
  for(int i = 0; i < node.getQuantity(); i++){
      Spatial spatial = node.getChild(i);
      if(spatial instanceof Geometry){
                //Material material = new Material();
                AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
                Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
                material.setColor("m_Color",color);
                //Material geomMaterial = ((Geometry)spatial).getMaterial();
                spatial.setMaterial(material);
                System.out.println("Spatial: "+spatial.getName());
View Full Code Here

TOP

Related Classes of com.jme3.animation.AnimChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.