@Override protected void render (ModelBatch batch, Array<ModelInstance> instances) { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) e.value.update(Gdx.graphics.getDeltaTime()); batch.render(instances, environment); }
@Override protected void render (ModelBatch batch, Array<ModelInstance> instances) { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) e.value.update(Gdx.graphics.getDeltaTime()); for (final ModelInstance instance : instances) renderSkeleton(instance); batch.render(instances); }
@Override public void render (Array<ModelInstance> instances) { dirLight.direction.rotate(dirLightRotAxis, Gdx.graphics.getDeltaTime() * 45f); super.render(null); for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) e.value.update(Gdx.graphics.getDeltaTime()); shaderBatch.begin(cam); shaderBatch.render(instances, environment); shaderBatch.end(); }
/** Update any animations currently being played. * @param delta The time elapsed since last update, change this to alter the overall speed (can be negative). */ public void update (float delta) { if (paused) return; if (previous != null && ((transitionCurrentTime += delta) >= transitionTargetTime)) { removeAnimation(previous.animation); justChangedAnimation = true; animationPool.free(previous); previous = null; } if (justChangedAnimation) { target.calculateTransforms(); justChangedAnimation = false; } if (current == null || current.loopCount == 0 || current.animation == null) return; final float remain = current.update(delta); if (remain != 0f && queued != null) { inAction = false; animate(queued, queuedTransitionTime); queued = null; update(remain); return; } if (previous != null) applyAnimations(previous.animation, previous.offset + previous.time, current.animation, current.offset + current.time, transitionCurrentTime / transitionTargetTime); else applyAnimation(current.animation, current.offset + current.time); }
/** Update any animations currently being played. * @param delta The time elapsed since last update, change this to alter the overall speed (can be negative). */ public void update (float delta) { if (paused) return; if (previous != null && ((transitionCurrentTime += delta) >= transitionTargetTime)) { removeAnimation(previous.animation); justChangedAnimation = true; animationPool.free(previous); previous = null; } if (justChangedAnimation) { target.calculateTransforms(); justChangedAnimation = false; } if (current == null || current.loopCount == 0 || current.animation == null) return; final float remain = current.update(delta); if (remain != 0f && queued != null) { inAction = false; animate(queued, queuedTransitionTime); queued = null; update(remain); return; } if (previous != null) applyAnimations(previous.animation, previous.offset + previous.time, current.animation, current.offset + current.time, transitionCurrentTime / transitionTargetTime); else applyAnimation(current.animation, current.offset + current.time); }
@Override public void render () { if (character != null) { animation.update(Gdx.graphics.getDeltaTime()); if (Gdx.input.isKeyPressed(Keys.UP)) { if (!animation.inAction) {
@Override public void update(float delta) { ModelCacheEntry cs = (ModelCacheEntry) currentSource; if (cs != null && cs.controller.current != null && cs.controller.current.loopCount != 0) { cs.controller.update(delta); lastAnimationTime += delta; // GENERATE SHADOW MAP if (renderShadow) genShadowMap(); if (USE_FBO) renderTex(); } }
protected void updateAnimation(HumanCharacter entity) { float deltaTime = Gdx.graphics.getDeltaTime(); // Use entity's animation speed multiplier, if any float multiplier = entity.animationSpeedMultiplier > 0 ? entity.animationSpeedMultiplier : animationMultiplier; if (multiplier > 0) { deltaTime *= entity.getLinearVelocity().len() * multiplier; } entity.animations.update(deltaTime * GameSettings.GAME_SPEED); } }
protected void updateAnimation(DogCharacter dog) { // Switch animation based on linear velocity if needed float speed = dog.getLinearVelocity().len(); switchAnimation(dog, speed); float deltaTime = Gdx.graphics.getDeltaTime(); if (dog.currentTaskAnimation != null && dog.currentTaskAnimation.animationSpeedMultiplier >= 0) { deltaTime *= speed * dog.currentTaskAnimation.animationSpeedMultiplier; } dog.animations.update(deltaTime * GameSettings.GAME_SPEED); }
/** Update any animations currently being played. * @param delta The time elapsed since last update, change this to alter the overall speed (can be negative). */ public void update (float delta) { if (paused) return; if (previous != null && ((transitionCurrentTime += delta) >= transitionTargetTime)) { removeAnimation(previous.animation); justChangedAnimation = true; animationPool.free(previous); previous = null; } if (justChangedAnimation) { target.calculateTransforms(); justChangedAnimation = false; } if (current == null || current.loopCount == 0 || current.animation == null) return; final float remain = current.update(delta); if (remain != 0f && queued != null) { inAction = false; animate(queued, queuedTransitionTime); queued = null; update(remain); return; } if (previous != null) applyAnimations(previous.animation, previous.offset + previous.time, current.animation, current.offset + current.time, transitionCurrentTime / transitionTargetTime); else applyAnimation(current.animation, current.offset + current.time); }