Exemple #1
0
        private void applyGroundMovement()
        {
            if (!IsOnGround())
            {
                return;
            }
            if (Physical.Position.Y < GetGroundPoint().Y)
            {
                Physical.Position = Physical.Position.ChangeY(GetGroundPoint().Y);
            }


            var dir = getInputControlsDirection();

            dir      = Vector3.TransformNormal(dir, Matrix.RotationQuaternion(getRotationQuaternion())) * 3;
            Velocity = dir.TakeXZ().ToXZ(Velocity.Y);
            if (Velocity.Y < 0)
            {
                Velocity = Velocity.ChangeY(0);
            }
        }