创建节点
A world in UNIGINE is a scene that includes a set of different built-in objects with certain parameters. All objects added to the world are called nodes. Nodes can be of different types, determining their visual representation and behavior. Some node types appear visually and have surfaces to represent their geometry (mesh), such as Objects, Decals, and Effects. Other nodes (Light Sources, Players, etc.) are invisible. UNIGINE中的世界是一个场景,其中包含一组带有特定参数的不同内置对象。 所有添加到世界上的对象称为节点。节点可以是不同类型,可以确定其视觉表示和行为。 一些节点类型在视觉上显示并具有表示其几何形状(网格)的表面,例如对象,贴图和效果。其他节点(光源,播放器等)不可见。
There are a number of ways you can add nodes to your world. You can create them using the UnigineEditor's functions as described in this article. You can also create nodes at runtime via code.您可以通过多种方式将节点添加到您的世界中。您可以按照本文中所述使用UnigineEditor的功能创建它们。您也可以通过代码在运行时创建节点。
Creating Nodes of Built-In Types创建内置类型的节点#
UNIGINE provides a set of diverse built-in node types that can be used to represent virtually any object or phenomenon present in real life. These node types are formed into several groups. UNIGINE提供了一组内置节点类型,这些节点类型可用于表示现实生活中的几乎所有对象。这些节点类型分为几组。
You can create a node of any built-in type by selecting the corresponding item in the Create menu and specifying necessary parameters.您可以通过在Create菜单中选择相应的项目并指定必要的参数来创建任何内置类型的节点。
Standard Primitives标准基元#
UNIGINE lets you add any 3D model created in a third party digital content creation tool via the FBX import option. Apart from that it offers you a set of standard primitives that might be useful as test objects or in block design. This set includes the following types: Box, Sphere, Plane, Cylinder, and Capsule. UNIGINE使您可以通过 FBX导入选项添加在第三方数字内容创建工具中创建的任何3D模型。除此之外,它还为您提供了一组标准原语,这在某些情况下可能会有所帮助。此集合包括以下类型:Box, Sphere, Plane, Cylinder和Capsule。
These primitives can be used either as placeholders and prototypes, or to create world objects with a simple shape (e.g., a plane is commonly used as a flat ground surface).这些原语可用作占位符和原型,或用于创建具有简单形状的世界对象(例如,通常将平面用作平坦的地面)。
You can create any primitive by choosing the corresponding item in the Create -> Primitives menu.您可以通过在Create -> Primitives菜单中选择相应的项目来创建任何原始类型。
When creating a standard primitive, specify its geometry parameters in the window that opens, as for the Box: 创建标准图元时,将显示带有参数的窗口,如下图所示 Box :
Having specified the primitive's parameters and clicking OK you confirm its creation. You can also click Cancel to abort. 指定了原语的参数,然后单击OK确认其创建。您也可以点击取消中止。
On confirmation, the Editor switches to the Snap to Surface Mode, so you can specify the position of the new node. 创建完成后,编辑器将切换到Snapping to Surface Mode,以便您可以指定新节点的位置。
Box框#
The Box primitive provides a simple geometry for representing boxes and cubes. It has the following parameters:框图元提供了用于表示框和立方体的简单几何形状。它具有以下参数:
X, Y, Z | dimensions along the X, Y, and Z axes.沿X,Y和Z轴的尺寸。 |
---|
Creation of a primitive produces a corresponding .mesh asset generated based on the specified parameters in the current directory of the Asset Browser window. The primitive shall be created as a Static Mesh.应将具有指定大小的框创建为Static Mesh。
Sphere领域#
The Sphere primitive provides a simple geometry for representing balls and spheres. The sphere has the following parameters:球体图元提供了用于表示球和球体的简单几何形状。 球体具有以下参数:
具有指定参数的球体应创建为Static Mesh。
Plane飞机#
The Plane primitive provides a flat polygon mesh for representing ground and surfaces. The plane has the following parameters:平面图元提供了用于表示地面和曲面的平面多边形网格。 该平面具有以下参数:
X, Y | dimensions along the X and Y axes. 数个将平面的表面切割成多个小平面的纵向和横向边缘。 |
---|---|
Segments | number of the lengthwise and transversal edges cutting the surface of the plane into facets. 将平面的表面切割成多个小平面的纵向和横向边缘的数量。 |
具有指定段数和大小的平面应创建为Static Mesh。
Cylinder圆柱#
The Cylinder primitive can be used to represent cylinders and tubes. The cylinder has the following parameters:圆柱圆柱图元可用于表示圆柱和管。圆柱体具有以下参数:
具有指定参数的圆柱体应创建为Static Mesh。
Capsule胶囊#
The Capsule primitive provides a geometry for representing capsules or rounded edge tubes. The capsule has the following parameters:胶囊图元提供了用于表示胶囊或圆形边缘管的几何形状。 胶囊具有以下参数:
一个具有指定参数的胶囊将被创建为Static Mesh。
Creating Nodes via Asset Browser通过资源浏览器创建节点#
A node can be created by simply dragging an asset from the Asset Browser either to the Editor Viewport or to the World Nodes window. Asset type determines the type of the node (or hierarchy of nodes) that will be created.只需将资源从 资源浏览器 拖动到 Editor视口或World Nodes窗口即可创建节点。资源类型确定将要创建的节点的类型(或节点的层次结构)。
Drag-and-drop creation of nodes is supported for the following types of assets:以下类型的资源支持拖放创建节点:
- .node - built-in asset type which contains any node (or a hierarchy of nodes) exported from the UNIGINE world previously.
This type of asset produces a Node Reference by default. You can change the type of node, that will be created by right-clicking on the asset in the Asset Browser window and selecting a corresponding item in the context menu:This type of asset produces a Node Reference by default. You can change the type of node, that will be created by right-clicking on the asset in the Asset Browser window and selecting a corresponding item in the context menu:
- Place as Node Reference will create a Node Reference.Place as Node Reference will create a Node Reference.
- Place as Node Layer will create a node of the Node Layer type.Place as Node Layer will create a node of the Node Layer type.
- Place as Node Content will import the contents of the *.node file, which can be a Static Mesh or any other node type, as well as a hierarchy of nodes.Place as Node Content will import the contents of the *.node file, which can be a Static Mesh or any other node type, as well as a hierarchy of nodes.
This type of asset produces a Node Reference by default. You can change the type of node, that will be created by right-clicking on the asset in the Asset Browser window and selecting a corresponding item in the context menu:这种类型的资源默认情况下会产生Node Reference。您可以更改节点的类型,可以通过在 Asset Browser 窗口中右键单击资源并在上下文菜单中选择相应的项目来创建:
- Place as Node Reference will create a Node Reference. Place as Node Reference将创建一个Node Reference。
- Place as Node Layer will create a node of the Node Layer type. Place as Node Layer将创建Node Layer类型的节点。
- Place as Node Content will import the contents of the *.node file, which can be a Static Mesh or any other node type, as well as a hierarchy of nodes. Place as Node Content将导入*.node文件的内容,该文件可以是Static Mesh或任何其他 节点类型,以及节点的层次结构。
- .mesh - built-in asset type that describes static and skinned geometry.
This type of asset produces a Static Mesh or a Skinned Mesh if the asset stores animation data as well.This type of asset produces a Static Mesh or a Skinned Mesh if the asset stores animation data as well.
This type of asset produces a Static Mesh or a Skinned Mesh if the asset stores animation data as well..mesh-描述静态和蒙皮几何体的内置资源类型。This type of asset produces a Static Mesh or a Skinned Mesh if the asset stores animation data as well.如果该资源还存储动画数据,则该资源会产生Static Mesh或Skinned Mesh。
- .fbx, .obj, .3ds, .dae - assets that contain 3D models created using a third-party modelling software.
This type of asset can produce a Static Mesh, a Skinned Mesh or a hierarchy of nodes depending on its contents (cameras, lights. etc.).This type of asset can produce a Static Mesh, a Skinned Mesh or a hierarchy of nodes depending on its contents (cameras, lights. etc.).
This type of asset can produce a Static Mesh, a Skinned Mesh or a hierarchy of nodes depending on its contents (cameras, lights. etc.)..fbx, .obj, .3ds, .dae-包含使用第三方建模软件创建的3D模型的资源。This type of asset can produce a Static Mesh, a Skinned Mesh or a hierarchy of nodes depending on its contents (cameras, lights. etc.).这种类型的资源可以根据其内容(相机,灯光等)产生Static Mesh或节点层次结构。
If you drag an asset to the World Nodes window, the created node will be placed right in front of the current camera. While dragging the asset to the Editor Viewport switches the Editor to the Snap to Surface Mode, so you can choose where to place the created node.如果将资源拖动到World Nodes窗口,则创建的节点将放置在当前摄像机的正前方。将资源拖动到 Editor视口时,会将编辑器切换到 捕捉到曲面模式 ,因此您可以选择