C# Класс Indiefreaks.Xna.Extensions.RandomExtensions

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
GetRandomPolarCoordinates ( Random dice ) : Vector3

Generates a random Vector3 point in a Polar Coordinate System.

Описание методов

GetRandomFloat() публичный статический Метод

public static GetRandomFloat ( Random dice ) : float
dice System.Random
Результат float

GetRandomFloat() публичный статический Метод

public static GetRandomFloat ( Random dice, float min, float max ) : float
dice System.Random
min float
max float
Результат float

GetRandomPointInCube() статический публичный Метод

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
Результат Vector3

GetRandomPointInSphere() статический публичный Метод

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.
Результат Vector3

GetRandomPointOnSphere() статический публичный Метод

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.
Результат Vector3