This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

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

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

Sets a new player used in the Editor mode at the moment.
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 - The editor player.

Ptr<Player> getPlayer() const#

Returns the current player used in the Editor mode at the moment.
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.)

Return value

Current editor player.

void setData ( const char * data ) #

Sets a new user string data associated with the world. this string is written directly into the data tag of the *.world file.

Arguments

  • const char * data - The user string data.

const char * getData() const#

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

Return value

Current user string data.

void setEnabled ( bool enabled ) #

Sets a new 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).

Arguments

  • bool enabled - Set true to enable the Enabled parameter; false - to disable it.

bool isEnabled() const#

Returns the current 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

true if the Enabled parameter is enabled; otherwise false.

bool isLoaded() const#

Returns the current value indicating if the editor is already loaded.

Return value

true if the editor is loaded; otherwise false.

void setVRPlayer ( const Ptr<Player>& vrplayer ) #

Sets a new player used to render VR in the Editor mode at the moment. If VR Player has not been set, VR is rendered to the Editor Player; if the Editor Player hasn't been set either, the Game Player is used for rendering.
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>& vrplayer - The player to render VR.

Ptr<Player> getVRPlayer() const#

Returns the current player used to render VR in the Editor mode at the moment. If VR Player has not been set, VR is rendered to the Editor Player; if the Editor Player hasn't been set either, the Game Player is used for rendering.
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.)

Return value

Current player to render VR.

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 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 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 ) const#

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

true if the Player is an Editor player; otherwise, false.

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 Vector<Ptr<Node>> & exclude, const Vector<Node::TYPE> & exclude_types ) #

Searches for all of the nodes intersected by the line traced from p0 to p1, ignoring the ones passed in the exclude list and except the ones of the types passed in the exclude_types 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 - Array of the nodes to exclude; all these nodes will be skipped while checking for intersection.
  • const Vector<Node::TYPE> & exclude_types - Array of the node types to exclude; nodes of the specified types will be skipped while checking for intersection.

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<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 instance.

Arguments

  • const Math::Vec3 & p0 - Line start point coordinates.
  • const Math::Vec3 & p1 - Line end point coordinates.
  • const Ptr<WorldIntersection> & intersection - WorldIntersection class instance containing the intersection information.

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 instance.

Arguments

  • const Math::Vec3 & p0 - Line start point coordinates.
  • const Math::Vec3 & p1 - Line end point coordinates.
  • const Ptr<WorldIntersectionNormal> & intersection - WorldIntersectionNormal class instance containing the intersection information.

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 instance.

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 - WorldIntersection class instance containing the intersection information.

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 Vector<Node::TYPE> & exclude_types, const Ptr<WorldIntersection> & intersection ) #

Searches for all of the nodes intersecting the line, ignoring the ones passed in the exclude list and except the ones of the types passed in the exclude_types list. The node closest to the start point is returned. The intersection result will be presented as a WorldIntersection instance.

Arguments

  • const Math::Vec3 & p0 - Line start point coordinates.
  • const Math::Vec3 & p1 - Line end point coordinates.
  • const Vector<Ptr<Node>> & exclude - Array of the nodes to exclude; all these nodes will be skipped while checking for intersection.
  • const Vector<Node::TYPE> & exclude_types - Array of the node types to exclude; nodes of the specified types will be skipped while checking for intersection.
  • const Ptr<WorldIntersection> & intersection - WorldIntersection class instance containing the intersection information.

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.

bool getIntersection ( const Math::WorldBoundFrustum & bs, Vector<Ptr<Node>> & OUT_nodes, bool use_handlers ) #

Finds all nodes intersected by the specified bound frustum and puts them to the specified output buffer. You can also get editor-only objects (node handlers) along with nodes, just set use_handlers to true.

Arguments

  • const Math::WorldBoundFrustum & bs - Bounding frustum where intersection search is to be performed.
  • Vector<Ptr<Node>> & OUT_nodes - Output buffer to store the list of intersected nodes (if any).
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.
  • bool use_handlers - true to include editor-only objects (node handlers) in the list of intersected nodes; false - to ignore handlers.

Return value

true if intersected nodes are found; otherwise, false.
Last update: 2024-08-16
Build: ()