This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

API Migration

Major Changes#

Callback System Changes#

All callbacks were brought to a common stardard, and now API of some abstract callback looks as follows (For C# replace void* with System.IntPtr):

  • void *addSomeCallback(Callback *func);
    Registers a new handler without checking if it already exists in the list (so, you can subscribe two or more times). Returns callback ID, to be used later to unsubscribe.
  • bool removeSomeCallback(void *id);
    Removes a handler registered earlier and returns true. Will return false if there's no hadler with the specified ID.
  • void clearSomeCallbacks();
    Removes all registered handlers.

New callbacks API is thread-safe, i.e., add, remove and clear can be called from different threads, even simultaneously. Moreover, callback functions are now reentrant, this means that you can call add, remove, or clear right from a callback handler. For example, if we need a callback handler to be executed only for the very first click, we can use the following:

Source code (C++)
// add a CLICKED callback
widget->addCallback(Gui::CLICKED, MakeCallback(&trigger_once));

// ...

void trigger_once(WidgetPtr sender)
{
	Log::message("button clicked\n");
	
	// clear all CLICKED callbacks
	sender->clearCallbacks(Gui::CLICKED);
}

clear and remove called from a handler will be executed immediately, so all other handlers, that were removed by this "transaction" (if any), will not be executed at all. The result of calling add inside a handler shall be applied in the beginning of the next "transaction": i.e. if inside a CLICK event handler we add a new one, it will be executed only for the next CLICK event.

You can check the way it works in the following sample: engine/samples/Api/Widgets/WidgetCallbacks

The complete list of changes for each of affected classes is given below.

AsyncQueue Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void *addCallback(int callback, Unigine::CallbackBase2<const char *, int> *func)
  • void removeCallback(int callback, int num)

Body Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setContactCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
  • void setFrozenCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
  • void setPositionCallback(Unigine::CallbackBase1< Ptr<Body> > *func)

Console Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setOutputCallback(Unigine::CallbackBase2<const char *, int> *func)

Joint Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setBrokenCallback(Unigine::CallbackBase1< Ptr<Joint> > *func)

Node Class Callbacks#

NodeTrigger Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setEnabledCallback(Unigine::CallbackBase1< Ptr<NodeTrigger> > *func)
  • void setPositionCallback(Unigine::CallbackBase1< Ptr<NodeTrigger> > *func)

PhysicalTrigger Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setEnterCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
  • void setLeaveCallback(Unigine::CallbackBase1< Ptr<Body> > *func)

Property Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void *addCallback(int callback, Unigine::CallbackBase *func)
  • void removeCallback(int callback, void *func)
  • void clearCallbacks(int callback)

Properties Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void *addCallback(int callback, Unigine::CallbackBase *func)
  • void removeCallback(int callback, void *func)
  • void clearCallbacks(int callback)

Render Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void *addCallback(int callback, Unigine::CallbackBase *func)
  • void removeCallback(int callback, void *func)

UserInterface Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setCallback0(const char *name, int callback, Unigine::CallbackBase *func)
  • void setCallback1(const char *name, int callback, Unigine::CallbackBase1< Ptr<Widget> > *func)
  • void setCallback2(const char *name, int callback, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > *func)
  • void setCallback3(const char *name, int callback, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > *func)

Viewport Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void *addCallback(int callback, Unigine::CallbackBase *func)
  • void removeCallback(int callback, void *func)

Widget Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setCallback0(int callback, Unigine::CallbackBase *func)
  • void setCallback1(int callback, Unigine::CallbackBase1< Ptr<Widget> > *func)
  • void setCallback2(int callback, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > *func)
  • void setCallback3(int callback, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > *func)

WorldTrigger Class Callbacks#

New functions:

Deprecated functions (to be removed in the next SDK release):

  • void setEnterCallback(Unigine::CallbackBase1< Ptr<Node> > *func)
  • void setLeaveCallback(Unigine::CallbackBase1< Ptr<Node> > *func)

Body Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
removeShape() Set of arguments changed.
removeShape() Set of arguments changed.

New Functions#

Engine Class#

New Functions#

FileSystem Class#

Light Class#

LightEnvironmentProbe Class#

Material Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
TEXTURE_SCATTERING_GROUND_LUT Removed.
clearShadersHash() Removed.

New Functions#

Node Class#

Object Class#

ObjectBillboards Class#

ObjectParticles Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
restoreStateParticles() Removed. Use restoreStateSelf() instead.
saveStateParticles() Removed. Use saveStateSelf() instead.

New Functions#

ObjectTerrain Class#

Profiler Class#

New Functions#

Property Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
restoreState() Set of arguments changed.
getNumParameters() Deprecated. Use getParameterPtr instead.
getParameterName() Deprecated. Use getParameterPtr instead.
getParameterType() Deprecated. Use getParameterPtr instead.
isParameterHidden() Deprecated. Use getParameterPtr instead.
isParameterInherited() Deprecated. Use getParameterPtr instead.
isParameterOverridden() Deprecated. Use getParameterPtr instead.
findParameter() Deprecated. Use getParameterPtr instead.
fetchParameter() Deprecated. Use getParameterPtr instead.
resetParameter() Deprecated. Use getParameterPtr instead.
getParameterTitle() Deprecated. Use getParameterPtr instead.
getParameterTooltip() Deprecated. Use getParameterPtr instead.
getParameterGroup() Deprecated. Use getParameterPtr instead.
getParameterFilter() Deprecated. Use getParameterPtr instead.
setParameter() Deprecated. Use getParameterPtr instead.
getParameter() Deprecated. Use getParameterPtr instead.
setParameterInt() Deprecated. Use getParameterPtr instead.
getParameterInt() Deprecated. Use getParameterPtr instead.
getParameterIntMinValue() Deprecated. Use getParameterPtr instead.
getParameterIntMaxValue() Deprecated. Use getParameterPtr instead.
setParameterFloat() Deprecated. Use getParameterPtr instead.
getParameterFloat() Deprecated. Use getParameterPtr instead.
getParameterFloatMinValue() Deprecated. Use getParameterPtr instead.
getParameterFloatMaxValue() Deprecated. Use getParameterPtr instead.
setParameterDouble() Deprecated. Use getParameterPtr instead.
getParameterDouble() Deprecated. Use getParameterPtr instead.
getParameterDoubleMinValue() Deprecated. Use getParameterPtr instead.
getParameterDoubleMaxValue() Deprecated. Use getParameterPtr instead.
hasParameterSliderMinValue() Deprecated. Use getParameterPtr instead.
hasParameterSliderMaxValue() Deprecated. Use getParameterPtr instead.
getParameterSliderLog10() Deprecated. Use getParameterPtr instead.
getParameterSliderMinExpand() Deprecated. Use getParameterPtr instead.
getParameterSliderMaxExpand() Deprecated. Use getParameterPtr instead.
setParameterToggle() Deprecated. Use getParameterPtr instead.
getParameterToggle() Deprecated. Use getParameterPtr instead.
setParameterSwitch() Deprecated. Use getParameterPtr instead.
getParameterSwitch() Deprecated. Use getParameterPtr instead.
getParameterSwitchNumItems() Deprecated. Use getParameterPtr instead.
getParameterSwitchItem() Deprecated. Use getParameterPtr instead.
setParameterString() Deprecated. Use getParameterPtr instead.
getParameterString() Deprecated. Use getParameterPtr instead.
setParameterColor() Deprecated. Use getParameterPtr instead.
getParameterColor() Deprecated. Use getParameterPtr instead.
setParameterVec3() Deprecated. Use getParameterPtr instead.
getParameterVec3() Deprecated. Use getParameterPtr instead.
setParameterVec4() Deprecated. Use getParameterPtr instead.
getParameterVec4() Deprecated. Use getParameterPtr instead.
setParameterMask() Deprecated. Use getParameterPtr instead.
getParameterMask() Deprecated. Use getParameterPtr instead.
setParameterFile() Deprecated. Use getParameterPtr instead.
getParameterFile() Deprecated. Use getParameterPtr instead.
getParameterFileIsAsset() Deprecated. Use getParameterPtr instead.
getParameterFileIsRuntime() Deprecated. Use getParameterPtr instead.
getParameterFileIsAbsPath() Deprecated. Use getParameterPtr instead.
isParameterFileExist() Deprecated. Use getParameterPtr instead.
setParameterProperty() Deprecated. Use getParameterPtr instead.
getParameterProperty() Deprecated. Use getParameterPtr instead.
setParameterMaterial() Deprecated. Use getParameterPtr instead.
getParameterMaterial() Deprecated. Use getParameterPtr instead.
setParameterGUID() Deprecated. Use getParameterPtr instead.
getParameterGUID() Deprecated. Use getParameterPtr instead.
setParameterNode() Deprecated. Use getParameterPtr instead.
getParameterNode() Deprecated. Use getParameterPtr instead.
setParameterNodeID() Deprecated. Use getParameterPtr instead.
getParameterNodeID() Deprecated. Use getParameterPtr instead.

New Functions#

Render Class#

New Functions#

RenderEnvironmentPreset Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
setScatteringGroundColor() Removed.
getScatteringGroundColor() Removed.
setScatteringGroundLUTName() Removed.
getScatteringGroundLUTName() Removed.

Renderer Class#

Socket Class#

New Functions#

Sound Class#

SoundSource Class#

SplineGraph Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
calcSegmentPoint() Type of arguments changed.
setSegmentEndPoint() Type of arguments changed.
getSegmentEndPoint() Type of arguments changed.
setSegmentStartPoint() Type of arguments changed.
getSegmentStartPoint() Type of arguments changed.
setPoint() Type of arguments changed.
getPoint() Type of arguments changed.
addPoint() Type of arguments changed.

String Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
isalpha() Set of arguments changed.
isdigit() Set of arguments changed.
islower() Set of arguments changed.
isspace() Set of arguments changed.
isupper() Set of arguments changed.
do_memcpy() Removed.

WorldSplineGraph Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
getNumSourceNodes() Removed.
getNumSegmentNodes() Set of arguments changed.
getNumSegments() Removed. Use getNumSplineSegments() instead.
getNumPoints() Removed. Use getNumSplinePoints() instead.
calcSegmentPoint() Removed. Use SplineSegment::calcPoint() instead.
calcSegmentTangent() Removed. Use SplineSegment::calcTangent() instead.
calcSegmentUpVector() Removed. Use SplineSegment::calcUpVector() instead.
getLength() Removed. Use SplineSegment::getLength() instead.
setPoint() Removed.
getPoint() Removed.
addPoint() Removed. Use createSplinePoint() instead.
removePoint() Removed. Use removeSplinePoint() instead.
splitPoint() Removed.
weldPoints() Removed.
insertPointToSegment() Removed.
getPointSegmentsIndices() Removed. Use SplinePoint::getSplineSegments() instead.
addSegment() Removed. Use createSplineSegment() instead.
removeSegment() Removed. Use removeSplineSegment() instead.
setSegmentEndPoint() Removed. Use SplineSegment::setEndPoint() instead.
getSegmentEndPoint() Removed. Use SplineSegment::getEndPoint() instead.
getSegmentEndPointIndex() Removed.
setSegmentEndTangent() Removed. Use SplineSegment::setEndTangent() instead.
getSegmentEndTangent() Removed. Use SplineSegment::getEndTangent() instead.
setSegmentEndUpVector() Removed. Use SplineSegment::setEndUp() instead.
getSegmentEndUpVector() Removed. Use SplineSegment::getEndUp() instead.
getSegmentMode() Removed. Use SplineSegment::getSegmentMode() instead.
getSegmentNodes() Removed.
getSegmentSourceIndex() Removed.
setSegmentStartPoint() Removed. Use SplineSegment::setStartPoint() instead.
getSegmentStartPoint() Removed. Use SplineSegment::getStartPoint() instead.
getSegmentStartPointIndex() Removed.
setSegmentStartTangent() Removed. Use SplineSegment::setStartTangent() instead.
getSegmentStartTangent() Removed. Use SplineSegment::getStartTangent() instead.
setSegmentStartUpVector() Removed. Use SplineSegment::setStartUp() instead.
getSegmentStartUpVector() Removed. Use SplineSegment::getStartUp() instead.
assignSegmentSource() Removed. Use SplineSegment::assignSource() or SplinePoint::assignSource() instead.
clearSegmentSource() Removed. Use SplineSegment::clearSources() or SplinePoint::clearSources() instead.
addSourceNode() Removed.
removeSourceNode() Removed. Use SplineSegment::removeSource() or SplinePoint::removeSource() instead.
setSourceForwardAxis() Removed.
getSourceForwardAxis() Removed.
getSourceNodeName() Removed.
setSplineGraph() Removed.
getSplineGraph() Removed.
getNodeSegmentIndex() Removed.
getNodeSegmentTileIndex() Removed.
getNodeSourceIndex() Removed.

New Functions#

Variable Class#

Viewport Class#

Widget Class#

UNIGINE 2.7.2 UNIGINE 2.7.3
isCallback() Return value changed.
getCallbackAccel() Return value changed.

World Class#

WorldClutter Class#

Last update: 2018-12-27
Build: ()