Table of Contents

Namespace MLEM.Maths

Classes

Direction2Helper

A set of helper and extension methods for dealing with Direction2

Easings

This class contains a set of easing functions, adapted from https://easings.net. These can be used for ui elements or any other kind of animations. By default, each function takes an input that ranges between 0 and 1, and produces an output that roughly ranges between 0 and 1. To change this behavior, you can use ScaleInput(Easing, float, float) and ScaleOutput(Easing, float, float).

NumberExtensions

A set of extensions for dealing with float, Microsoft.Xna.Framework.Vector2, Microsoft.Xna.Framework.Vector3, Microsoft.Xna.Framework.Vector4, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Matrix, Microsoft.Xna.Framework.Rectangle and RectangleF

RandomExtensions

A set of extensions for dealing with Random

SingleRandom

The SingleRandom class allows generating single, one-off pseudorandom numbers based on a seed or a SeedSource. The types of numbers that can be generated are int and float, both of which can be generated with specific minimum and maximum values if desired. Methods in this class are tested to be sufficiently "random", that is, to be sufficiently distributed throughout their range, as well as sufficiently different for neighboring seeds.

Structs

Padding

Represents a generic padding. A padding is an object of data that stores an offset from each side of a rectangle or square.

RectangleF

Represents a float-based version of Microsoft.Xna.Framework.Rectangle

SeedSource

A seed source contains an int value which can be used as a seed for a Random or SingleRandom. Seed sources feature a convenient way to add multiple seeds using Add(int), which will be sufficiently scrambled to be deterministically pseudorandom and combined into a single int. This struct behaves similarly to System.HashCode in many ways, with an important distinction being that SeedSource's scrambling procedure is not considered an implementation detail, and will stay consistent between process executions.

Enums

Direction2

An enum that represents two-dimensional directions. Both straight and diagonal directions are supported. There are several extension methods and arrays available in Direction2Helper.

Delegates

Easings.Easing

A delegate method used by Easings.