mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-29 00:23:31 -04:00
Allow non-humanoid models to use humanoid animations
This commit is contained in:
parent
115f1e305c
commit
373dfc7da3
@ -71,7 +71,7 @@ namespace ClassicalSharp.Entities {
|
|||||||
tiltY = (float)Math.Sin(walkTime) * swing * (0.15f * Utils.Deg2Rad);
|
tiltY = (float)Math.Sin(walkTime) * swing * (0.15f * Utils.Deg2Rad);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity.Model is HumanoidModel)
|
if (entity.Model.CalcHumanAnims)
|
||||||
CalcHumanAnim(idleXRot, idleZRot);
|
CalcHumanAnim(idleXRot, idleZRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,9 @@ namespace ClassicalSharp.Model {
|
|||||||
public class HumanoidModel : IModel {
|
public class HumanoidModel : IModel {
|
||||||
|
|
||||||
public ModelSet Set, SetSlim, Set64;
|
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 BoxDesc head, torso, lLeg, rLeg, lArm, rArm;
|
||||||
protected float offset = 0.5f;
|
protected float offset = 0.5f;
|
||||||
|
@ -30,6 +30,9 @@ namespace ClassicalSharp.Model {
|
|||||||
/// <summary> Whether this entity requires downloading of a skin texture. </summary>
|
/// <summary> Whether this entity requires downloading of a skin texture. </summary>
|
||||||
public bool UsesSkin = true;
|
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>
|
/// <summary> Gravity applied to this entity. </summary>
|
||||||
public virtual float Gravity { get { return 0.08f; } }
|
public virtual float Gravity { get { return 0.08f; } }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user