Examples of AnimChannel


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

Examples of com.jme3.animation.AnimChannel

        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

Examples of com.jme3.animation.AnimChannel

    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

Examples of com.jme3.animation.AnimChannel

//        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

Examples of com.jme3.animation.AnimChannel

  @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

Examples of com.jme3.animation.AnimChannel

        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
TOP
Copyright © 2018 www.massapi.com. 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.