private void handleFinishedPose() { if (incrementCurrentPose()) // increments pose and returns true if finished sequence { setNextSequence(theEntity.getAnimation()); } updateCurrentPoseArrays(); setNextPoseModel(); }
public void performJabelarAnimations(float parPartialTicks) { // JurassiCraft.instance.getLogger().debug("FPS = " + Minecraft.getDebugFPS() + " and // current sequence = " + currentSequence + " and current pose = " + this.currentPose + " and // current tick = " + this.currentTickInTween + " out of " + numTicksInTween + " and entity // ticks existed = " + theEntity.ticksExisted + " and partial ticks = " + partialTicks); performBloodSpurt(); // Allow interruption of the animation if it is a new animation and not currently dying if (theEntity.getAnimation() != currentSequence && currentSequence != Animations.DYING.get()) { setNextSequence(theEntity.getAnimation()); } performNextTweenTick(); partialTicks = parPartialTicks; // need to update this after the call because entity ticks are updated one // call after partial ticks }
// boolean returned indicates if sequence was finished public boolean incrementCurrentPose() { boolean finishedSequence = false; // increment current sequence step currentPose++; // check if finished sequence if (currentPose >= numPosesInSequence) { Animations animation = Animations.getAnimation(theEntity.getAnimation()); if (animation != null && animation.shouldHold()) // hold last dying pose indefinitely { currentPose--; } else { currentPose = 0; finishedSequence = true; } } // JurassiCraft.instance.getLogger().debug("Next pose is pose = " + currentPose); return finishedSequence; }
private void init(DinosaurModel parModel) { initSequence(theEntity.getAnimation()); // JurassiCraft.instance.getLogger().info("Initializing to animation sequence = " + // currentSequence); initPoseModel(); initTweenTicks(); // copy passed in model into a model renderer array // NOTE: this is the array you will actually animate theModelRendererArray = convertPassedInModelToModelRendererArray(parModel); // initialize the current pose arrays to match the model renderer array currentRotationArray = new float[numParts][3]; currentPositionArray = new float[numParts][3]; currentOffsetArray = new float[numParts][3]; updateCurrentPoseArrays(); // initialize the increment arrays to match difference between current and next pose rotationIncrementArray = new float[numParts][3]; positionIncrementArray = new float[numParts][3]; offsetIncrementArray = new float[numParts][3]; updateIncrementArrays(); }