C# Class FlatRedBall.Math.MathFunctions

Exibir arquivo Open project: vchelaru/FlatRedBall

Public Properties

Property Type Description
ZPlane Plane

Public Methods

Method Description
AbsoluteToScreen ( float x, float y, float z, int &screenX, int &screenY, Camera camera, System form ) : void
AngleToAngle ( double angle1, double angle2 ) : double
AngleToAngle ( float angle1, float angle2 ) : float

Determines the shortest absolute difference between two angles.

This method will never return a value with absolute value greater than PI. It will return either a positive or negative value, keeping all values between positive and negative PI.

AngleToVector ( float radians ) : System.Vector3
AreDoublesEqual ( double num1, double num2, double epsilon ) : bool
AreFloatsEqual ( float num1, float num2, float epsilon ) : bool
GetAspectRatioForSameSizeAtResolution ( float resolution ) : float
GetPointOnUnitSphere ( Random random, float &xPos, float &yPos, float &zPos ) : void

Returns a random point on the surface of a unit sphere.

Hypotenuse ( double X, double Y ) : double
Hypotenuse ( float X, float Y ) : float
HypotenuseSquared ( float X, float Y ) : float
IsOrthonormal ( System.Matrix &matrix ) : bool
IsPowerOfTwo ( int numberToCheck ) : bool
LerpRotationMatrix ( System.Matrix currentRotationMatrix, System.Matrix destinationRotationMatrix, float amount ) : System.Matrix
Loop ( double value, double loopPeriod ) : double
Loop ( double value, double loopPeriod, bool &didLoop ) : double
Loop ( float value, float loopPeriod ) : float
Loop ( float value, float loopPeriod, bool &didLoop ) : float
MoveTowardAngle ( float currentAngle, float destinationAngle, float amount ) : float
NextPowerOfTwo ( int startingValue ) : int
NormalizeAngle ( float angle ) : float

Wraps an angle from 0 to TwoPi

RegulateAngle ( double angleToRegulate ) : double
RegulateAngle ( float angleToRegulate ) : float
RegulateAngle ( float &angleToRegulate ) : void

Keeps an angle between 0 and 2*PI.

RotatePointAroundPoint ( float xBase, float yBase, float &xToRotate, float &yToRotate, float radiansToChangeBy ) : void

Rotates a point around another point by a given number of radians.

RoundDouble ( double valueToRound, double multipleOf ) : double
RoundFloat ( float valueToRound, float multipleOf ) : float
RoundFloat ( float valueToRound, float multipleOf, float seed ) : float
RoundToInt ( double doubleToRound ) : int
RoundToInt ( float floatToRound ) : int
RoundToLong ( double doubleToRound ) : long
ScreenToAbsolute ( int screenX, int screenY, float &x, float &y, float z, Camera camera, System form, bool fullscreen ) : void
SortAscending ( List integerList ) : void

Method Details

AbsoluteToScreen() public static method

public static AbsoluteToScreen ( float x, float y, float z, int &screenX, int &screenY, Camera camera, System form ) : void
x float
y float
z float
screenX int
screenY int
camera Camera
form System
return void

AngleToAngle() public static method

public static AngleToAngle ( double angle1, double angle2 ) : double
angle1 double
angle2 double
return double

AngleToAngle() public static method

Determines the shortest absolute difference between two angles.
This method will never return a value with absolute value greater than PI. It will return either a positive or negative value, keeping all values between positive and negative PI.
public static AngleToAngle ( float angle1, float angle2 ) : float
angle1 float Starting angle in radians.
angle2 float Ending angle in radians.
return float

AngleToVector() public static method

public static AngleToVector ( float radians ) : System.Vector3
radians float
return System.Vector3

AreDoublesEqual() public static method

public static AreDoublesEqual ( double num1, double num2, double epsilon ) : bool
num1 double
num2 double
epsilon double
return bool

AreFloatsEqual() public static method

public static AreFloatsEqual ( float num1, float num2, float epsilon ) : bool
num1 float
num2 float
epsilon float
return bool

GetAspectRatioForSameSizeAtResolution() public static method

public static GetAspectRatioForSameSizeAtResolution ( float resolution ) : float
resolution float
return float

GetPointOnUnitSphere() public static method

Returns a random point on the surface of a unit sphere.
public static GetPointOnUnitSphere ( Random random, float &xPos, float &yPos, float &zPos ) : void
random System.Random Reference to a Random instance.
xPos float The resulting X value.
yPos float The resulting Y value.
zPos float The resulting Z value.
return void

Hypotenuse() public static method

public static Hypotenuse ( double X, double Y ) : double
X double
Y double
return double

Hypotenuse() public static method

public static Hypotenuse ( float X, float Y ) : float
X float
Y float
return float

HypotenuseSquared() public static method

public static HypotenuseSquared ( float X, float Y ) : float
X float
Y float
return float

IsOrthonormal() public static method

public static IsOrthonormal ( System.Matrix &matrix ) : bool
matrix System.Matrix
return bool

IsPowerOfTwo() public static method

public static IsPowerOfTwo ( int numberToCheck ) : bool
numberToCheck int
return bool

LerpRotationMatrix() public static method

public static LerpRotationMatrix ( System.Matrix currentRotationMatrix, System.Matrix destinationRotationMatrix, float amount ) : System.Matrix
currentRotationMatrix System.Matrix
destinationRotationMatrix System.Matrix
amount float
return System.Matrix

Loop() public static method

public static Loop ( double value, double loopPeriod ) : double
value double
loopPeriod double
return double

Loop() public static method

public static Loop ( double value, double loopPeriod, bool &didLoop ) : double
value double
loopPeriod double
didLoop bool
return double

Loop() public static method

public static Loop ( float value, float loopPeriod ) : float
value float
loopPeriod float
return float

Loop() public static method

public static Loop ( float value, float loopPeriod, bool &didLoop ) : float
value float
loopPeriod float
didLoop bool
return float

MoveTowardAngle() public static method

public static MoveTowardAngle ( float currentAngle, float destinationAngle, float amount ) : float
currentAngle float
destinationAngle float
amount float
return float

NextPowerOfTwo() public static method

public static NextPowerOfTwo ( int startingValue ) : int
startingValue int
return int

NormalizeAngle() public static method

Wraps an angle from 0 to TwoPi
public static NormalizeAngle ( float angle ) : float
angle float The angle to wrap
return float

RegulateAngle() public static method

public static RegulateAngle ( double angleToRegulate ) : double
angleToRegulate double
return double

RegulateAngle() public static method

public static RegulateAngle ( float angleToRegulate ) : float
angleToRegulate float
return float

RegulateAngle() public static method

Keeps an angle between 0 and 2*PI.
public static RegulateAngle ( float &angleToRegulate ) : void
angleToRegulate float The angle to regulate.
return void

RotatePointAroundPoint() public static method

Rotates a point around another point by a given number of radians.
public static RotatePointAroundPoint ( float xBase, float yBase, float &xToRotate, float &yToRotate, float radiansToChangeBy ) : void
xBase float X position to rotate around.
yBase float Y position to rotate around.
xToRotate float X position to rotate (changes).
yToRotate float Y position to rotate (changes).
radiansToChangeBy float Radians to rotate by.
return void

RoundDouble() public static method

public static RoundDouble ( double valueToRound, double multipleOf ) : double
valueToRound double
multipleOf double
return double

RoundFloat() public static method

public static RoundFloat ( float valueToRound, float multipleOf ) : float
valueToRound float
multipleOf float
return float

RoundFloat() public static method

public static RoundFloat ( float valueToRound, float multipleOf, float seed ) : float
valueToRound float
multipleOf float
seed float
return float

RoundToInt() public static method

public static RoundToInt ( double doubleToRound ) : int
doubleToRound double
return int

RoundToInt() public static method

public static RoundToInt ( float floatToRound ) : int
floatToRound float
return int

RoundToLong() public static method

public static RoundToLong ( double doubleToRound ) : long
doubleToRound double
return long

ScreenToAbsolute() public static method

public static ScreenToAbsolute ( int screenX, int screenY, float &x, float &y, float z, Camera camera, System form, bool fullscreen ) : void
screenX int
screenY int
x float
y float
z float
camera Camera
form System
fullscreen bool
return void

SortAscending() public static method

public static SortAscending ( List integerList ) : void
integerList List
return void

Property Details

ZPlane public_oe static_oe property

public static Plane ZPlane
return Plane