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
Учебные материалы

Unigine.Plugins.IG.SkyMap Class

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Sim SDK edition to use it.

This class is used to manage the Sun, the Moon, stars, day/night cycle for the IG.

Notice
IG plugin must be loaded.

The Celestial property is used to set the Sun and the Moon.

SkyMap Class

Properties

float StarfieldIntensity#

The star field intensity value.

float MoonIntensity#

The moon intensity value.

float SunIntensity#

The sun intensity value.

float Timezone#

The time zone currently used for the simulation in the UTC format.

bool ContinuousTime#

The a value indicating if the time of day is continuously updated by the image generator ore remains static.

Node MoonNode#

The a pointer to the node currently used to represent the Moon. Nodes for the Sun and the Moon can be assigned via the UnigineEditor.

bool MoonEnabled#

The a value indicating if the Moon is rendered or not.

Node SunNode#

The a pointer to the node currently used to represent the Sun. Nodes for the Sun and the Moon can be assigned via the UnigineEditor.

bool SunEnabled#

The a value indicating if the Sun is rendered or not.

bool StarfieldEnabled#

The a value indicating if the star field is rendered or not.

Members


void SetDateTime ( long time_posix, bool UTC = false ) #

Sets the time of the simulation.

Arguments

  • long time_posix - Time of the simulation to be set, number of seconds since January 1, 1970
  • bool UTC - true to set this time as the Coordinated Universal Time (UTC +0), false — to set this time as the current local time.

void SetDateTime ( int sec, int min, int hour, int day, int month, int year, bool UTC = false ) #

Sets the current date and time.

Arguments

  • int sec - An integer between 0 and 59 to be set as seconds value.
  • int min - An integer between 0 and 59 to be set as minutes value.
  • int hour - An integer between 0 (midnight) and 23 (11 p.m.) local time to be set as hours value.
  • int day - An integer between 1 and 31 to be set as day value.
  • int month - An integer between 1 and 12 to be set as month value.
  • int year - An integer to be set as year value.
  • bool UTC - true to set this time as the Coordinated Universal Time (UTC +0), false — to set this time as the current local time.

long GetDateTime ( bool UTC = false ) #

Returns the current time of the simulation.

Arguments

  • bool UTC - true to return this time as the Coordinated Universal Time (UTC +0), false — to return this time as the current local time.

Return value

Current time of the simulation, number of seconds since January 1, 1970

void ForceRefresh ( ) #

Refreshes the sky map according to its current settings. This method should be called after setting sky map's parameters to apply them. Sky map change callbacks are called on refresh.

IntPtr AddOnTimeChangedCallback ( OnTimeChangedDelegate func ) #

Adds a callback function to be called when the sky map state changes. This function can be used to define specific actions to be performed when the sky map state changes. The signature of the callback function must be as follows:
Source code (C#)
void(void)

You can set a callback function as follows:

Source code (C#)
AddOnTimeChangedCallback(() => time_changed_callback_function_name());

Example: Setting a time changed callback on changing sky map state.

Source code (C#)
class SomeClass
{
	/*...*/

	/// callback function to be called when a collision with the collision segment is detected
	private void time_changed_callback_function_name()
	{
		// insert your code handling collision event here
	}

	// ...

	// somewhere in code
	void Init()
	{
		// adding "my_callback" to be called on changing sky map state
		ig_manager.GetSkyMap().AddOnTimeChangedCallback(() => time_changed_callback_function_name());
	}

	/*...*/
}

Arguments

  • OnTimeChangedDelegate func - Callback function with the following signature: void OnTimeChangedDelegate(void)

Return value

ID of the last added time changed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool RemoveOnTimeChangedCallback ( IntPtr id ) #

Removes the specified callback from the list of time changed callbacks.

Arguments

  • IntPtr id - Time changed callback ID obtained when adding it.

Return value

True if the time changed callback with the given ID was removed successfully; otherwise false.

void ClearOnTimeChangedCallbacks ( ) #

Clears all added time changed callbacks.
Last update: 19.04.2024
Build: ()