This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Math Random Functions

Header: #include <UnigineMathLib.h>

This class contains randomization functions.

Random Class

Members


Random ( ) #

Default constructor. Initializes the random number generator using the time seed.

Random ( unsigned int seed ) #

Constructor. Initializes the random number generator using the specified seed.

Arguments

  • unsigned int seed - Seed.

void setSeed ( unsigned int seed ) const#

Sets the randomizer seed.

Arguments

  • unsigned int seed - Seed of the randomizer.

unsigned int getSeed ( ) const#

Returns the randomizer seed.

Return value

Seed of the randomizer.

int getInt ( int from, int to ) const#

Returns a random integer value within a specified interval.

Arguments

  • int from - Beginning of the interval.
  • int to - End of the interval.

Return value

Random integer value.

float getFloat ( float from, float to ) const#

Returns a random float value within a specified interval.

Arguments

  • float from - Beginning of the interval.
  • float to - End of the interval.

Return value

Random float value.

double getDouble ( double from, double to ) const#

Returns a random double value within a specified interval.

Arguments

  • double from - Beginning of the interval.
  • double to - End of the interval.

Return value

Random double value.

vec4 getColor ( ) const#

Returns a random color vector. X, Y, Z values of the color vector are random values, W value is equal to 1.0f.

Return value

Random color vector.

vec3 getDir ( ) const#

Returns a random normalized direction vector.

Return value

Random direction vector.
Last update: 19.03.2021
Build: ()