This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
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
Content Creation
Content Optimization
Materials
Art Samples
Tutorials

API Migration

Major Changes

Materials-Related Changes#

Engine Plugins API Changes#

The get_version() method previously returned the Engine's version (UNIGINE_VERSION) and compilation flags for which the plugin was built. It was renamed to getCompilationFlags() because now it returns only the compilation flags.

UNIGINE 2.14.1 UNIGINE 2.15
Source code (C++)
plugin->get_version();
Source code (C++)
plugin->getCompilationFlags();

New Functions

Expanded BootConfig API#

The new set of methods allows users to set the custom icon for the final application. Specify the path to the icon as an argument of the setWindowIconPath() method.

New Functions

C++ and C# API for initialization was changed#

getBuildConfig() used to return the build configuration along with the precision type of the Engine. This method has been removed. Use the getBuildConfiguration() and getPrecision() methods to replace it.

UNIGINE 2.14.1 UNIGINE 2.15
Source code (C++)
Unigine::EnginePtr engine(UNIGINE_VERSION, argc, argv);
const char *build_config = engine->getBuildConfig();
Source code (C++)
Unigine::EnginePtr engine(argc, argv);

Unigine::Engine::BUILD_CONFIG build_config = Unigine::Engine::getBuildConfiguration();
Unigine::Engine::PRECISION precision = Unigine::Engine::getPrecision();

The version number has been removed from the arguments list of Engine::Init() methods. Delete the first argument to initialize the Engine properly. The new InitParameters structure has been introduced to provide the way to set the following application parameters:

  • window_title — the title of the window.
  • window_icon_path — the path to the window icon.
  • app_path — path to a directory where binary executable file is stored.
  • home_path — path to the user's home directory.
  • project — project name.
    Notice
    If the project name parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in the user profile rather than in a directory with binaries.
  • password — password for the filesystem archives.
  • app — an instance of the CustomApp class.
UNIGINE 2.14.1 UNIGINE 2.15
Source code (C++)
Unigine::EnginePtr engine(UNIGINE_VERSION, "Custom Window Title", argc, argv);
Source code (C++)
Unigine::Engine::InitParameters init_parameters;

init_parameters.window_title = "Custom Window Title";

Unigine::EnginePtr engine(init_parameters, argc, argv);

Set of arguments changed#

The following set of methods were removed or changed:

UNIGINE 2.14.1 UNIGINE 2.15
getBuildConfig() Removed. Use getBuildConfiguration() and getPrecision() instead.
isDouble() Removed. Use getPrecision() instead.
GetBuildConfiguration() Renamed as BuildConfiguration().
getVersion() Method's return type changed.
isInitialized() Return value changed.
isKnownArg() Return value changed.
isEvaluation() Return value changed.
addPlugin() Return value changed.
addPlugin() Return value changed.
removePlugin() Return value changed.
addSystemLogic() Return value changed.
removeSystemLogic() Return value changed.
addWorldLogic() Return value changed.
removeWorldLogic() Return value changed.
removeEditorLogic() Return value changed.
addEditorLogic() Return value changed.
isSystemInterpreter() Return value changed.
isSystemVariable() Return value changed.
isSystemFunction() Return value changed.
isWorldLoaded() Return value changed.
isWorldInterpreter() Return value changed.
isWorldVariable() Return value changed.
isWorldFunction() Return value changed.
isEditorLoaded() Return value changed.
isEditorInterpreter() Return value changed.
isEditorVariable() Return value changed.
isEditorFunction() Return value changed.
isMainThread() Return value changed.

New Functions

Usage Example:

Source code (C++)
const char* features = Unigine::Engine::getFeatures();
Unigine::Log::message(features);

MathLib Changes#

The Engine’s mathematical library (MathLib) has been divided into two separate implementations for C++ and C# APIs to make it more efficient and faster. This along with bug fixes leads to some discrepancies in the libraries’ features.

C++ MathLib Improvements#

We added more SSE optimizations and restructured the library to be the set of header-only classes defining the same functionality as before. This way you can flexibly enable or disable the SSE support for MathLib and inline it into your final application.

Now the C++ MathLib is decomposed into separate headers:

  • UnigineMathLib
  • UnigineMathLibBounds
  • UnigineMathLibCommon
  • UnigineMathLibConcave
  • UnigineMathLibIVec3
and so on.
Warning
Do not use the fourth component in the Vec3 structures (DVec3, HVec3, IVec3) as it may be implicitly changed by the structure’s operations.

You can find the header file that implements the required class/structure in the documentation article for the corresponding class.

Classes Moved#

BoundBox, BoundSphere, and BoundFrustrum structures now reside inside the UnigineMathLibBounds class. The way to access their parameters was changed:

UNIGINE 2.14.1 UNIGINE 2.15
Source code (C++)
Unigine::BoundBox bb = Unigine::BoundBox();
	
const Unigine::Math::vec3 min = bb.getMin();
const Unigine::Math::vec3 max = bb.getMax();
Source code (C++)
Unigine::Math::BoundBox bb = Unigine::Math::BoundBox();

Unigine::Math::vec3 min = bb.minimum;
Unigine::Math::vec3 max = bb.maximum;

Single instruction, multiple data (SIMD) operations and the Geometry class are now available as a part of the new MathLib (see include/UnigineMathLibSimd.h and Unigine::Geometry classes). The SIMD operations are optimized to work with big arrays of data.

New Classes Added#

  • Bits - auxiliary structures for storing data in the bit format regardless of the type of data (memory copy)
  • BitStream - auxiliary structure for bitwise buffer read/write operations (the buffer size is fixed)
  • Concave - concave shapes generator
  • ConcaveConvexCompare - compares volumes of two convex shapes
  • Convex - convex shapes generator
  • Noise - white noise generator (supports tiling)
  • Numerical - template class for vectors and matrices of any dimension (contains methods for equation solving)
  • Polygon - class for managing an indexed polygon
  • Random - random numbers generator
  • SHBasis - spherical harmonics

Memory Alignment#

Since the C++ version of MathLib uses SSE optimizations it is required to check that your memory is aligned on a 16-byte boundary. UNIGINE’s containers and allocator guarantees the correct memory alignment. Double-check for the right memory alignment when you use third-party implementations or write your own.

The UNIGINE_align macro has been replaced with alignas C++ keyword.

C# MathLib Improvements#

The C# version of MathLib was remade and now it supports more of the C# language specific features. Unlike the C++ version the C# MathLib doesn’t support the SSE optimizations because of the lack of memory alignment support in C#.

A bunch of new methods were added: Equals, EqualsNearly and so on. Vector methods like LessOrEqual compare all corresponding vector components and return the true result only when every single condition check was successful.

Special methods are implemented to get random variables without the need to create redundant objects. For instance, to get a random integer call MathLib.RandInt().

The new C# MathLib supports swizzling performance optimizations for vectors (vec2, vec3, vec4).

We have also added the support for implicit casting for vectors, integer and byte variables.

New Conversion Methods#

Old methods for variable conversion were marked deprecated. Use the more clear functions instead. For example, to convert a double variable to float:

UNIGINE 2.14.1 UNIGINE 2.15
Source code (C++)
float a = dtof(b);
Source code (C++)
float a = Unigine::Math::toFloat(b);

You no longer need to think about the type of the variable you convert from. Use the new overloaded functions to achieve the same results as before:

UNIGINE 2.14.1 UNIGINE 2.15
itof() toFloat()
ftoi() toInt()
ftoc() toChar()
itod() toDouble()
dtoi() toInt()
dtof() toFloat()
itos() toScalar()
stoi() toInt() or toInt(), depending on the precision
ltof() toFloat()
ftol() static_cast<long long> or any other default conversion method for base types
ltod() toDouble() or any other default conversion method for base types
dtol() static_cast<long long> or any other default conversion method for base types

Global Constants Changed#

Global constants have replaced the deprecated macros:

UNIGINE 2.14.1 UNIGINE 2.15
UNIGINE_INFINITY Consts::INF
UNIGINE_EPSILON Consts::EPS
UNIGINE_DEG2RAD Consts::DEG2RAD


And so on (see Consts namespace in UnigineMathLibCommon.h).

New constants have also been added:

  • GOLDEN_RATIO – golden ratio constant
  • EPS_D – double precision epsilon
  • DEG2RAD_D – double precision degree to radian conversion
  • RAD2DEG_D – double precision radian to degree conversion
  • IPI2_D – inverted Pi times two (double)
  • PI_D – double Pi
  • PI05_D – half double Pi

Class Time and Timer Refactoring#

The Time class now has all the methods required to get the current time in different formats. It also has special methods to convert time representations (see MicrosecondsToSeconds() etc).

UNIGINE 2.14.1 UNIGINE 2.15
Source code (C++)
Timer::getTime();
Source code (C++)
Time::get();
Source code (C++)
Timer::getFloatTime();
Source code (C++)
Time::getSeconds();


The Timer structure is responsible for timer functionality. You can start it and measure the time elapsed between checks (see end(), endSeconds(), endMilliseconds() methods).

New Tonemapper Settings#

Preprocessor NDEBUG Flag for Release Apps#

To increase the performance in Release applications on Windows the NDEBUG flag has to be turned on, since the Engine’s library has the same flag enabled and they must match. Open your application’s solution in your Visual Studio IDE and add the NDEBUG flag to the list of preprocessor’s definitions (Project Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions).

If the NDEBUG flags in the Engine and in your application do not match you will get the fatal error message at the start of the application.

Spatial Tree Changes#

The Spatial Tree was optimized to increase performance:

  • Branches of the spatial tree are now discarded based on the minimum and maximum visibility distance parameter.
  • More effective shadow culling based on the visibility distance.
  • Shadows and world Intersections are now calculated in parallel.

AppVarjo Class#

New Constants

New Functions

Compress Class#

Dir Class#

New Functions

FileSystem Class#

Image Class#

LandscapeFetch Class#

LandscapeLayerMap Class#

LandscapeMapFileCompression Class#

LandscapeMapFileSettings Class#

Material Class#

UNIGINE 2.14.1 UNIGINE 2.15
All TEXTURE_* variables. Renamed as TEXTURE_SOURCE_*, with TEXTURE_IMAGE replaced by TEXTURE_SOURCE_ASSET
OPTION_RECEIVE_SHADOW Removed.
OPTION_RECEIVE_WORLD_SHADOW Removed.
OPTION_BLEND Removed. Use OPTION_BLEND_SRC and OPTION_BLEND_DEST instead.
fetchParameter(cstr name, int fast_id) Removed.
fetchState(cstr name, int fast_id) Removed.
fetchTexture(cstr name, int fast_id) Removed.
getTextureGroup() Removed. Use getUIItemParent() instead.
isTextureHidden() Removed. Use isUIItemHidden() instead.
getTextureTitle() Removed. Use getUIItemTitle() instead.
getTextureTooltip() Removed. Use getUIItemTooltip() instead.
getTextureType() Renamed as getTextureSource() instead.
getTextureWidgetIndex() Removed. Use getUIItemWidget() instead.
getOptionGroup() Removed. Use getUIItemParent() instead.
isOptionsHidden() Removed. Use isUIItemHidden() instead.
isOptionHidden() Removed. Use isUIItemHidden() instead.
getOptionTitle() Removed. Use getUIItemTitle() instead.
getOptionTooltip() Removed. Use getUIItemTooltip() instead.
getOptionWidgetIndex() Removed. Use getUIItemWidget() instead.
getStateGroup() Removed. Use getUIItemParent() instead.
getStateSwitchGroup() Removed. Use getUIItemGroupToggleStateID() instead.
isStateHidden() Removed. Use isUIItemHidden() instead.
getStateTitle() Removed. Use getUIItemTitle() instead.
getStateTooltip() Removed. Use getUIItemTooltip() instead.
getStateWidgetIndex() Removed. Use getUIItemWidget() instead.
getParameterGroup() Removed. Use getUIItemParent() instead.
isParameterHidden() Removed. Use isUIItemHidden() instead.
getParameterTitle() Removed. Use getUIItemTitle() instead.
getParameterTooltip() Removed. Use getUIItemTooltip() instead.
getParameterWidget() Removed. Use getUIItemWidget() instead.
getParameterWidgetIndex() Removed. Use getUIItemWidget() instead.
getParameterMaxExpand() Removed. Use isUIItemSliderMaxExpand() instead.
getParameterMinExpand() Removed. Use isUIItemSliderMinExpand() instead.
getParameterMaxValue() Removed. Use getUIItemSliderMaxValue() instead.
getParameterMinValue() Removed. Use getUIItemSliderMinValue() instead.
getOverlap() Renamed as isOverlap().
getDepthTest() Renamed as isDepthTest().
getCastShadow() Renamed as isCastShadow().
getCastWorldShadow() Renamed as isCastWorldShadow().
getTwoSided() Renamed as isTwoSided().
setBlendFunc() Removed. Use setBlendSrcFunc() and setBlendDestFunc() instead.
getOverlap_int() Renamed as getUIItemSliderMinValue().

New Functions

NodeLayer Class#

UNIGINE 2.14.1 UNIGINE 2.15
NodeName property Renamed to NodePath property.
setNodeName() Renamed to setNodePath().
getNodeName() Renamed to getNodePath().

NodeReference Class#

UNIGINE 2.14.1 UNIGINE 2.15
NodeName property Renamed to NodePath property.
setNodeName() Renamed to setNodePath().
getNodeName() Renamed to getNodePath().

ObjectCloudLayer Class#

ObjectWaterGlobal Class#

UNIGINE 2.14.1 UNIGINE 2.15
setOctaveCurrentOffset(int index, const Math::vec3 & offset) Removed.
getOctaveCurrentOffset(int index) Removed.
getWaterFieldHeightInteraction() Removed. Use isWaterFieldHeightInteraction() instead.
WaterFieldHeightInteraction property Removed.

New Functions

Render Class#

RenderState Class#

UNIGINE 2.14.1 UNIGINE 2.15
clearStates() Set of arguments changed.

Shader Class#

UNIGINE 2.14.1 UNIGINE 2.15
findParameter(int fast_id) Removed.
findParameter(cstr name, int fast_id) Removed.
setParameterFloat(cstr name, int fast_id, float value)) Removed.
setParameterFloat2(cstr name, int fast_id, vec2 value) Removed.
setParameterFloat3(cstr name, int fast_id, vec3 value) Removed.
setParameterFloat4(cstr name, int fast_id, vec4 value) Removed.
setParameterFloat3x3(cstr name, int fast_id, mat3 value) Removed.
setParameterFloat4x4(cstr name, int fast_id, mat4 value) Removed.
setParameterInt(cstr name, int fast_id, int value) Removed.
setParameterInt2(cstr name, int fast_id, ivec2 value) Removed.
setParameterInt3(cstr name, int fast_id, ivec3 value) Removed.
setParameterInt4(cstr name, int fast_id, ivec4 value) Removed.
setParameterDouble2(cstr name, int fast_id, dvec2 value) Removed.
setParameterDouble3(cstr name, int fast_id, dvec3 value) Removed.
setParameterDouble4(cstr name, int fast_id, dvec4 value) Removed.
setParameterDouble4x4(cstr name, int fast_id, dmat4 value) Removed.
setParameterScalar(cstr name, int fast_id, scalar value) Removed.
setParameterScalar2(cstr name, int fast_id, Vec2 value) Removed.
setParameterScalar3(cstr name, int fast_id, Vec3 value) Removed.
setParameterScalar4(cstr name, int fast_id, Vec4 value) Removed.
setParameterArrayFloat(cstr name, int fast_id, const float *value, int num_elements) Removed.
setParameterArrayFloat(cstr name, int fast_id, Vector<float> value) Removed.
setParameterArrayFloat2(cstr name, int fast_id, const vec2 *value, int num_elements) Removed.
setParameterArrayFloat2(cstr name, int fast_id, Vector<vec2> value) Removed.
setParameterArrayFloat4(cstr name, int fast_id, const vec4 *value, int num_elements) Removed.
setParameterArrayFloat4(cstr name, int fast_id, Vector<vec4> value) Removed.
setParameterArrayFloat4x4(cstr name, int fast_id, const mat4 *value, int num_elements) Removed.
setParameterArrayFloat4x4(cstr name, int fast_id, Vector<mat4> value) Removed.
setParameterArrayInt(cstr name, int fast_id, const int *value, int num_elements) Removed.
setParameterArrayInt(cstr name, int fast_id, Vector<int> value) Removed.
setParameterArrayInt2(cstr name, int fast_id, const ivec2 *value, int num_elements) Removed.
setParameterArrayInt2(cstr name, int fast_id, Vector<ivec2> value) Removed.
setParameterArrayInt4(cstr name, int fast_id, const ivec4 *value, int num_elements) Removed.
setParameterArrayInt4(cstr name, int fast_id, Vector<ivec4> value) Removed.
setParameterArrayDouble(cstr name, int fast_id, const double *value, int num_elements) Removed.
setParameterArrayDouble(cstr name, int fast_id, Vector<double> value) Removed.
setParameterArrayDouble2(cstr name, int fast_id, const dvec2 *value, int num_elements) Removed.
setParameterArrayDouble2(cstr name, int fast_id, Vector<dvec2> value) Removed.
setParameterArrayDouble4(cstr name, int fast_id, const dvec4 *value, int num_elements) Removed.
setParameterArrayDouble4(cstr name, int fast_id, Vector<dvec4> value) Removed.

UGUID Class#

New Functions

VoxelProbe Class#

UNIGINE 2.14.1 UNIGINE 2.15
setUseSunColor() Renamed as setUseSkyColor().
isUseSunColor() Renamed as isUseSkyColor().

WidgetCanvas Class#

WidgetComboBox Class#

New Functions

WidgetTreeBox Class#

New Functions

World Class#

Added a new getVisibleIntersection() methods to the World class both taking into account the distance from the camera, LODs, and other "visual" aspects, the similar getIntersection() methods now ignore the "visual" component enabling you to catch objects hidden by visibility distance (for example if an object LOD is hidden by visibility distance, but the object is within the frustum the intersection shall be detected). For more information please refer to the API Migration guide.

New Functions

IG Changes#

IG::Manager Class#

UNIGINE 2.14.1 UNIGINE 2.15
COORDINATE_SYSTEM enumeration. Removed. Use IG::Converter::COORDINATE_SYSTEM enumeration instead.
setCoordinateSystem(int) Removed. Use IG::Converter::setCoordinateSystem() instead.
getCoordinateSystem() Removed. Use IG::Converter::getCoordinateSystem() instead.

IG::IGConfig Class#

New Functions

IG::Converter Class#

IG::Meteo Class#

UNIGINE 2.14.1 UNIGINE 2.15
refresh() Removed.
getRegions(Vector < IG::Region * >) Removed.
removeRegion() Return value has changed.
setWindSpeed(vec3) Removed.
setVisibilityDistance(float) Removed.
setMaxPrecipitationAltitude(double) Removed.
getMaxPrecipitationAltitude() Removed.
getLowerCloudAltitude() Removed.
setCloudsOptimization(bool) Removed.
setCloudsOptimizationDistance(double) Removed.
setVisibilityTransitionTime(float) Removed.
setPrecipitationsTransitionTime(float) Removed.
setCloudTransitionTime(float) Removed.
addCallbackMeteoChanged() Renamed as addOnMeteoChangedCallback() instead.
removeCallbackMeteoChanged() Renamed as removeOnMeteoChangedCallback() instead.

New Functions

IG::Region Class#

UNIGINE 2.14.1 UNIGINE 2.15
refresh() Removed.
TYPE enumeration. Removed. Use ShapeType enumeration instead.
setWindSpeed(vec3) Removed. Use WeatherLayer::setWind() instead.
setWindSpeedEnable(bool) Removed.
setVisibilityDistance(float) Removed. Use WeatherLayer::setVisibility() instead.
setVisibilityDistanceEnable(bool) Removed.
setThickness(float) Removed. Use WeatherLayer::setThickness() instead.
getThickness() Removed. Use WeatherLayer::getThickness() instead.
setAltitude(double) Removed. Use WeatherLayer::setElevation() instead.
setAltitude(double, double) Removed. Use WeatherLayer::getElevation() instead.
setSize(vec2) Removed.
setSize(vec3) Removed.
setPosition(Vec2) Removed. Use setWorldPosition() and setGeoPosition() instead.
setPosition(Vec3) Removed.
setType(Region.TYPE) Removed.
getBoundType() Removed. Use getShapeType() instead.
resizeToCloudThickness() Removed.
setPrecipitationIntensity(float) Removed.
setPrecipitationIntensityEnable(bool) Removed.
setPrecipitationSize(float) Removed. Use WeatherLayerPrecipitation::setParticlesSize() instead.
setPrecipitationSizeEnable(bool) Removed.
setPrecipitationType(uint64_t) Removed. Use WeatherLayerPrecipitation::setPrecipitationType() instead.
setCloudTypeByEnum(uint64_t) Removed.
setCloudDensity(float) Removed.
getCloudThickness() Removed.
setLightning(int) Removed.

New Functions

IG::CIGI::Connector Class#

IG::CIGI::CigiWeatherControl Class#

Last update: 2021-10-25
Build: ()