Exemple #1
0
        public override void RenderModel(double deltaTime, float t)
        {
            SetModel(ItemId.ToString());

            Model.Gravity        = 0.04f;
            Model.Drag           = new Vector3(0.95f, 0.98f, 0.95f);
            Model.GroundFriction = new Vector3(0.6f, 1f, 0.6f);
            Model.GroundBounce   = new Vector3(0f, 0.5f, 0f);

            bool sprite = BlockInfo.Draw[ItemId] == DrawType.Sprite;

            if (!sprite)
            {
                this.ModelScale = new Vector3(1 / 4f, 1 / 4f, 1 / 4f);
            }
            else
            {
                this.ModelScale = new Vector3(1 / 2f, 1 / 2f, 1 / 2f);
            }
            Model.RecalcProperties(this);
            UpdateModelBounds();
            Position = Vector3.Lerp(interp.prev.Pos, interp.next.Pos, t);
            if (!sprite)
            {
                interp.LerpAngles(t);
            }
            else
            {
                this.RotY = game.LocalPlayer.HeadY - 45f;
            }
            anim.GetCurrentAnimState(t);
            Model.Render(this);
        }
Exemple #2
0
 /// <summary> Linearly interpolates position and rotation between the previous and next state. </summary>
 public void SetInterpPosition(float t)
 {
     if (!(Hacks.WOMStyleHacks && Hacks.Noclip))
     {
         Position = Vector3.Lerp(interp.prev.Pos, interp.next.Pos, t);
     }
     interp.LerpAngles(t);
 }