-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e26cba
commit b98e59a
Showing
3 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
119 changes: 119 additions & 0 deletions
119
src/main/java/com/besson/tutorialmod/entity/animation/TigerAnimation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
package com.besson.tutorialmod.entity.animation; | ||
|
||
import net.minecraft.client.render.entity.animation.Animation; | ||
import net.minecraft.client.render.entity.animation.AnimationHelper; | ||
import net.minecraft.client.render.entity.animation.Keyframe; | ||
import net.minecraft.client.render.entity.animation.Transformation; | ||
|
||
public class TigerAnimation { | ||
|
||
public static final Animation IDLE = Animation.Builder.create(2f).looping() | ||
.addBoneAnimation("head", | ||
new Transformation(Transformation.Targets.TRANSLATE, | ||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("body", | ||
new Transformation(Transformation.Targets.TRANSLATE, | ||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("tail", | ||
new Transformation(Transformation.Targets.TRANSLATE, | ||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("tail", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(0f, -20f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.5f, AnimationHelper.createRotationalVector(0f, 20f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))).build(); | ||
public static final Animation WALK = Animation.Builder.create(2f).looping() | ||
.addBoneAnimation("left_front_leg", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.5f, AnimationHelper.createRotationalVector(15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("right_front_leg", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.5f, AnimationHelper.createRotationalVector(-15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("left_back_leg", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.5f, AnimationHelper.createRotationalVector(-15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("right_back_leg", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.5f, AnimationHelper.createRotationalVector(15f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))) | ||
.addBoneAnimation("tail", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(0f, -20f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.5f, AnimationHelper.createRotationalVector(0f, 20f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))).build(); | ||
public static final Animation ATTACK = Animation.Builder.create(2f).looping() | ||
.addBoneAnimation("head", | ||
new Transformation(Transformation.Targets.ROTATE, | ||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1f, AnimationHelper.createRotationalVector(20f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(1.0416767f, AnimationHelper.createRotationalVector(-16.67f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR), | ||
new Keyframe(2f, AnimationHelper.createRotationalVector(-0.83f, 0f, 0f), | ||
Transformation.Interpolations.LINEAR))).build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters