C# Class Indiefreaks.Xna.Extensions.RandomExtensions

Exibir arquivo Open project: Indiefreaks/igf Class Usage Examples

Public Methods

Method Description
GetRandomFloat ( Random dice ) : float
GetRandomFloat ( Random dice, float min, float max ) : float
GetRandomPointInCube ( Random dice, int maxDistanceFromCenter ) : Vector3

Generates a random Vector3 positionned inside a cube.

GetRandomPointInSphere ( Random dice, int maxDistanceFromOrigin ) : Vector3

Generates a random Vector3 positionned inside a sphere.

GetRandomPointOnSphere ( Random dice, float radius ) : Vector3

Generates a random Vector3 on the surface of a sphere.

Private Methods

Method Description
GetRandomPolarCoordinates ( Random dice ) : Vector3

Generates a random Vector3 point in a Polar Coordinate System.

Method Details

GetRandomFloat() public static method

public static GetRandomFloat ( Random dice ) : float
dice System.Random
return float

GetRandomFloat() public static method

public static GetRandomFloat ( Random dice, float min, float max ) : float
dice System.Random
min float
max float
return float

GetRandomPointInCube() static public method

Generates a random Vector3 positionned inside a cube.
static public GetRandomPointInCube ( Random dice, int maxDistanceFromCenter ) : Vector3
dice System.Random The Random instance to be used when generating data.
maxDistanceFromCenter int The maximum distance from center the point can be generated
return Vector3

GetRandomPointInSphere() static public method

Generates a random Vector3 positionned inside a sphere.
static public GetRandomPointInSphere ( Random dice, int maxDistanceFromOrigin ) : Vector3
dice System.Random The Random instance to be used when generating data.
maxDistanceFromOrigin int The maximum distance from origin the point can be generated. Usually, the radius of a sphere.
return Vector3

GetRandomPointOnSphere() static public method

Generates a random Vector3 on the surface of a sphere.
static public GetRandomPointOnSphere ( Random dice, float radius ) : Vector3
dice System.Random The Random instance to be used when generating data.
radius float The radius of the Sphere.
return Vector3