Example #1
0
        /// <summary>
        /// Accelerates the snowflake based on it's active windfield.
        /// </summary>
        public void Accelerate()
        {
            activeWindField.SetVector(position, ref ACCELERATION);

            movement.x = (ACCELERATION.x + movement.x * inertia) / (inertia + 1);
            movement.y = (ACCELERATION.y + movement.y * inertia) / (inertia + 1);

            // Force the vector to fall no less than the given rate
            if (movement.y < MINIMUM_FALLING_SPEED)
            {
                movement.y = MINIMUM_FALLING_SPEED;
            }
        }