UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-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

Unigine::Editor Class

Header: #include <UnigineEditor.h>

This class provides functionality for the editor script that loads and manages the hierarchy of nodes displayed in the editor.

Notice
C++ methods running editor script functions are described in the Engine class reference.

See Also#

  • C++ API sample located in the folder <UnigineSDK>/source/samples/Api/Systems/Editor
  • C# API sample located in the folder <UnigineSDK>/source/csharp/samples/Api/Systems/Editor

Editor Class

Members


bool isLoaded ( ) #

Returns a value indicating if the editor is already loaded.

Return value

1 if the editor is loaded; otherwise, 0.

void setEnabled ( bool enabled ) #

Enable or disable the editor.

Arguments

  • bool enabled - 1 to enable the editor, 0 to disable it.

bool isEnabled ( ) #

Returns a value of the Enabled parameter. The Enabled parameter controls all internal additional engine processing (for example, reloading of textures when their recording time is changed and so on). For example, the Enabled parameter can be set to 0 when using Syncker in order to increase engine performance (as Syncker operates inside the editor environment and can reduce engine performance).

Return value

1 if the Enabled parameter is set; otherwise, 0.

void setData ( const char * data ) #

Sets user data associated with the world. In the *.world file, the data is set in the data tag.

Arguments

  • const char * data - New user data.

const char * getData ( ) #

Returns user string data associated with the world. This string is written directly into the data tag of the *.world file.

Return value

User string data.

void load ( const char * script = "editor/editor.usc" ) #

Loads the editor from the specified script.

Arguments

  • const char * script - Path to the script.

void quit ( ) #

Quit the editor.

void videoRestart ( ) #

Restarts the video application to apply changes to video settings, if any.

void reload ( ) #

Reloads the Unigine Editor. This functions updates node hierarchy, updates loaded textures if they were modified, etc.

int needReload ( ) #

Returns a value indicating if Unigine Editor should be reloaded.

Return value

1 if the editor should be reloaded; otherwise, 0.

void setPlayer ( const Ptr<Player> & player ) #

Sets the current player to be used in the Editor mode.
Notice
Editor player is handled differently than in-game players. Parameters set directly for the player are ignored; instead, Editor player uses Camera parameters set via the interface. (See Editor scripts in data/core/editor folder for implementation.)

Arguments

  • const Ptr<Player> & player - Editor player to set.

Ptr<Player> getPlayer ( ) #

Returns the current player used in the editor.

Return value

Current editor player.

void addEditorPlayer ( const Ptr<Player> & player ) #

Adds another editor player.

Arguments

  • const Ptr<Player> & player - Pointer to Player.

void removeEditorPlayer ( const Ptr<Player> & player ) #

Removes a given player from the editor.

Arguments

  • const Ptr<Player> & player - Pointer to Player.

bool isEditorPlayer ( const Ptr<Player> & player ) #

Returns a value indicating if the given player is an Editor player.

Arguments

  • const Ptr<Player> & player - A smart pointer to the Player.Player instance.

Return value

1 if the Player is an Editor player; otherwise, 0.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1 ) #

Searches for all of the nodes intersected by the line traced from p0 to p1. The node closest to the start point is returned.

Arguments

  • const Math::Vec3 & p0 - Line start point coordinates
  • const Math::Vec3 & p1 - Line end point coordinates

Return value

The first intersected node found at the line; otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Vector< Ptr<Node> > & exclude ) #

Searches for all of the nodes intersected by the line traced from p0 to p1, except for the ones passed in the exclude list. The node closest to the start point is returned.

Arguments

  • const Math::Vec3 & p0 - Line start point coordinates.
  • const Math::Vec3 & p1 - Line end point coordinates.
  • const Vector< Ptr<Node> > & exclude - List of nodes to be ignored when searching for intersection by the traced line.

Return value

The first intersected node found at the line (except for the ones passed in the exclude list); otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Ptr<WorldIntersection> & intersection ) #

Searches for all of the nodes intersecting the line. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersection node.

Arguments

  • const Math::Vec3 & p0 - Start point of the line.
  • const Math::Vec3 & p1 - End point of the line.
  • const Ptr<WorldIntersection> & intersection - Pointer to WorldIntersection.

Return value

The first intersected node smart pointer if found; otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Ptr<WorldIntersectionNormal> & intersection ) #

Searches for all of the nodes intersecting the line. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersectionNormal node.

Arguments

  • const Math::Vec3 & p0 - Start point of the line.
  • const Math::Vec3 & p1 - End point of the line.
  • const Ptr<WorldIntersectionNormal> & intersection - Pointer to WorldIntersectionNormal.

Return value

The first intersected node smart pointer if found; otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Ptr<WorldIntersectionTexCoord> & intersection ) #

Searches for all of the nodes intersecting the line. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersectionTexCoord node.

Arguments

  • const Math::Vec3 & p0 - Start point of the line.
  • const Math::Vec3 & p1 - End point of the line.
  • const Ptr<WorldIntersectionTexCoord> & intersection - Pointer to WorldIntersectionTexCoord.

Return value

The first intersected node smart pointer if found; otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Vector< Ptr<Node> > & exclude, const Ptr<WorldIntersection> & intersection ) #

Searches for all of the nodes intersecting the line. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersection node.

Arguments

  • const Math::Vec3 & p0 - Start point of the line.
  • const Math::Vec3 & p1 - End point of the line.
  • const Vector< Ptr<Node> > & exclude - Array of the nodes to exclude; all these nodes will be skipped while checking for intersection.
  • const Ptr<WorldIntersection> & intersection - Pointer to WorldIntersection.

Return value

The first intersected node smart pointer if found; otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Vector< Ptr<Node> > & exclude, const Ptr<WorldIntersectionNormal> & intersection ) #

Searches for all of the nodes intersecting the line. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersectionNormal node.

Arguments

  • const Math::Vec3 & p0 - Start point of the line.
  • const Math::Vec3 & p1 - End point of the line.
  • const Vector< Ptr<Node> > & exclude - Array of the nodes to exclude; all these nodes will be skipped while checking for intersection.
  • const Ptr<WorldIntersectionNormal> & intersection - Pointer to WorldIntersectionNormal.

Return value

The first intersected node smart pointer if found; otherwise, nullptr pointer.

Ptr<Node> getIntersection ( const Math::Vec3 & p0, const Math::Vec3 & p1, const Vector< Ptr<Node> > & exclude, const Ptr<WorldIntersectionTexCoord> & intersection ) #

Searches for all of the nodes intersecting the line. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersectionTexCoord node.

Arguments

  • const Math::Vec3 & p0 - Start point of the line.
  • const Math::Vec3 & p1 - End point of the line.
  • const Vector< Ptr<Node> > & exclude - Array of the nodes to exclude; all these nodes will be skipped while checking for intersection.
  • const Ptr<WorldIntersectionTexCoord> & intersection - Pointer to WorldIntersectionTexCoord.

Return value

The first intersected node smart pointer if found; otherwise, nullptr pointer.
Last update: 2019-12-25