Allow non-humanoid models to use humanoid animations

This commit is contained in:
UnknownShadow200 2017-04-08 20:06:52 +10:00
parent 115f1e305c
commit 373dfc7da3
3 changed files with 7 additions and 2 deletions

View file

@ -71,7 +71,7 @@ namespace ClassicalSharp.Entities {
tiltY = (float)Math.Sin(walkTime) * swing * (0.15f * Utils.Deg2Rad);
}
if (entity.Model is HumanoidModel)
if (entity.Model.CalcHumanAnims)
CalcHumanAnim(idleXRot, idleZRot);
}

View file

@ -10,7 +10,9 @@ namespace ClassicalSharp.Model {
public class HumanoidModel : IModel {
public ModelSet Set, SetSlim, Set64;
public HumanoidModel(Game window) : base(window) { }
public HumanoidModel(Game window) : base(window) {
CalcHumanAnims = true;
}
protected BoxDesc head, torso, lLeg, rLeg, lArm, rArm;
protected float offset = 0.5f;

View file

@ -30,6 +30,9 @@ namespace ClassicalSharp.Model {
/// <summary> Whether this entity requires downloading of a skin texture. </summary>
public bool UsesSkin = true;
/// <summary> Whether humanoid animations should be calculated, instead of normal animations. </summary>
public bool CalcHumanAnims;
/// <summary> Gravity applied to this entity. </summary>
public virtual float Gravity { get { return 0.08f; } }