Documentation/Articles/Overview of Object Type Editor

From NeoAxis 3D Engine Wiki

Jump to: navigation, search
Go to higher level

Contents

Overview

Object Type Editor is a part of the Resource Editor. It's used to create and edit object types (.type files). A personage, a car, a building, a tree or anything can go in an object type. By creating a type, you are assigning a class to it that determines the actions it is able to perform and the properties it has. These properties may include appearance, physics model, sounds, etc.

Some properties can be added as Attached Objects, such as visual appearance proprties of the object. For example, when you attach a mesh to an object, this object is visually represented by that mesh. You can also attach sound, thus making the object produce the attached sound.

You can also read the following articles on creating object types:

Object Type Editor

General View

The editor consists of the following elements:

  1. Upper panel.
  2. Resource tree.
  3. Attached objects window.
  4. Properties window.
  5. Working area.

The upper panel, the resource tree, the properties window, and the workspace are integral parts of the Resource Editor, while the Attached objects window is found only in this Editor.

Object Type Editor window

Properties Window

Properties Window (Properties) is used for changing type parameters. Most operations of the development process are performed through this window.

ObjectEditor 005.jpg

The properties window includes additional options for object editing.

ObjectEditor 006.jpg

Edit Physics Model button. If a physics model is assigned to an object type the Physics Model Editor starts.

Show Physics checkbox. If this one is checked, attached objects are displayed along with the physics model of the object type.

Show Invisible Objects checkbox. If this one is checked, invisible attached objects are displayed. The invisible object is any object with the Visible parameter (of the General list) set to False.

Filter Objects By Alias dropdown list. Displays objects only with the specified alias (the Alias parameter in the General list of attached object's parameters). The list includes all aliases of objects plus the following entries:

  • No filter — displays all objects,
  • Without alias only — displays all objects without aliases.

Attached Objects Window

The attached object window includes the list of Attached objects. It allows to edit attached objects using a context menu.

ObjectEditor 003.jpg
ObjectEditor 004.jpg
Name Description
Move Enable the object highlighting and moving mode. When it's set on, you can move the objects using a special tool which is responsible for transformation in the editor workspace.
Rotate Enable the object highlighting and rotating mode. When it's set on, you can rotate the objects using a special tool which is responsible for transformation in the editor workspace.
Scale Enable the object highlighting and scaling mode. When it's set on, you can scale the objects using a special tool which is responsible for transformation in the editor workspace.
Select Enable the object highlighting mode.
Attach Allows to attach a new resource to the object. Learn more about attaching objects.
Delete Allows to delete the attached object.


Attached Objects

ObjectEditor 008.jpg

Such properties as appearance are implemented via the Attached Objects system. This system enables attaching various resources to the object. For example, attaching a certain mesh will make the object look like that mesh. You can also attach a sound to make the object produce that sound.

The AttachedObjects list is located in the AttachedObjects property. You can edit this list to add or delete any attached object.

ObjectEditor 007.jpg

You also can attach the object using the editor context menu. To do that, right-click on the editor window, select the Attach Object menu and specify an object type to attach. In order to adjust object parameters select the attached object or begin editing the AttachedObjects list. The following objects can be attached:

  • 3D Model (three-dimensional model),
  • Object Type (object type),
  • Particle System (particle system),
  • Light Source (light source),
  • Sound Source (sound source),
  • Billboard (flat object facing the camera),
  • RibbonTrail (ribbon trail),
  • In-Game 3D GUI (3D user interface),
  • Helper (auxiliary object).

We will deal with all attached object types in detail below.

General parameters of Attached Objects

Parameters of any attached object can be split to two groups: basic (General) and special ones. Basic parameters are the same for all object types while special parameters differ depending on the object type.

Parameter Description
General
Alias Alias of the object. It can be used for filtering objects according to this criterion. Programmers can find the desirable attached object from the code using this parameter.
Body Name of the body to attach the object to.
BoneSlot Name of the skeleton bone to attach the object to.
OnlyForEditor If this parameter is set to True, the object will be visible in editors only. It will not be created in the game.
Position Object's shift relative to object type's position.
Rotation Object's rotation relative to object type's rotation.
Scale Object scaling.
TextUserData Any random text useful for the developer.
Visible If this parameter is set to True, the object will be visible.

3D Model (Three-dimensional Model)

An attached three-dimensional model that determines appearance of the object.

All the parameters of the attached 3D model are divided into two categories:

  • Mesh (3D model),
  • Physics (physics).
Parameter Description
Mesh
AnimationTree Animation tree file name.
BoneSlots List of bones, other objects can be attached to.
CastDynamicShadows Turns on/off dynamic shadow generation for this object.
CastStaticShadows Turns on/off static (lightmap) shadow generation for this object.
ForceMaterials Force an alternative material for the mesh.
LinkBonesToBodies If this parameter is set to True, bones will be attached to the bodies. Usually it can be used for the ragdolls.
MeshName Mesh file name.
ReceiveStaticShadows This parameter enables shadow rendering at this object. If the parameter is ON, other objects' shadows are drawn at this object.
RenderingDistance With this parameter you can specify the distance at which the object becomes invisible. If this parameter is set to 0, the object is always endered.
RenderingDistanceForShadows With this parameter you can specify the distance at which object's shadow becomes invisible. If this parameter is set to 0, object's shadow is always rendered.
RenderingQueueGroup Determine the object rendering order relative to the others. The property only influences objects with non-transparent materials.
TransparentObjectSortPriority The priority of transparent object sorting defined by an integer value.
UseOwnerScale Enable/Disable the influence of the owner object scale on the given object. If this parameter is set to True, the owner scale is added to the scale of the target object.
Physics
Collision Turns on/off object's processing when calculating collisions.
CollisionMaterialName Physics material name. This parameter affects interaction properties of physical bodies. You can choose the type of material, for example: Metal, Wood, Rubber, Ice. You can add new types of physical materials from Data\Base\Constants\PhysicsSystem.config
CollisionSpecialMeshName The name of special 3D mesh for collisions calculation. With this parameter you can change collision geometry for this object. On collision, the mesh selected in the Meshname parameter is visible. Use this parameter to speed up calculation of complex physical objects.
CollisionVehicleDrivableSurface Enable/Disable the calculation of a physical object as a surface for car movement calculation.

Particle System

Attached particle system.

Parameter Description
Particle
OwnerRotation Enable/Disable the influence of owner object rotation on the given object. With this parameter set to True, the parent rotation of the object is added to the target object rotation. Owner rotation of the object type is used.
ParticleName Name of the particle.
RenderingDistance With this parameter you can specify the distance at which the particle becomes invisible. If this paremeter is set to 0, the particle is always rendered.
RenderingDistanceForShadows With this parameter you can specify the distance at which the particle shadow becomes invisible. If this paremeter is set to 0, the particle shadow is always rendered.
RenderQueueGroup Determines the object rendering order relative to the others. The property only influences objects with non-transparent materials.
StartTime The moment the particle activates after it’s created.
UpdateWhenItNotInView If this parameter is set to True, the particle is updated even if it is invisible. This parameter can significantly slow down the engine general speed in cases when there are many particle systems on the scene.

Light Source

Attached light source.

Parameter Description
Light
AllowStaticLighting Enable/Disable static lighting (lightmap) calculation. If this parameter is set to True this light source is used when calculating static lighting. Learn more at StaticLightingManager.type.
AttenuationFar Maximum distance of the light source. Can only be used for Spot and Point light sources.
AttenuationNear Distance at which light starts to fade out. Can only be used for Spot and Point light sources.
AttenuationPower Light fading factor. Can only be used for Spot and Point light sources.
CastShadows If this parameter is set to True, all objects blocking this light cast shadows.
CustomShaderParameter Specific parameter for developers that allows you sending the set value to a shader.
DiffuseColor Diffusive light source.
DiffusePower Power of the source.
FFPAttenuationConstant Constant factor which is a multiplier affecting other light fading parameters (for very old video cards).
FFPAttenuationLinear Linear fading in the rendering in the fix pipe mode (for very old video cards).
FFPAttenuationQuadric Quadratic fading in the rendering in the fix pipe mode (for very old video cards).
LightType Light source type. You can chose from three values: Point (exact light source), Directional (one-directional light source), Spot (projector).
SpecularColor Light source hotspot color.
SpecularPower The parameter determines specular light intensity on the surface of the illuminated object.
SpotlightFalloff This parameter determines light fading from internal to external cone. The more this value is, the smoother fading is. This parameter works only for the Spot light source type.
SpotlightInnerAngle This parameter determines the inner cone width – the intensity of light concentration near the center. The difference is visible only when the SpotlightFalloff parameter is more than minimal value. If the SpotlightInnerAngle and the SpotlightOuterAngle parameters have the same values, the effect is the same as if the SpotlightFalloff value is minimal.
SpotlightOuterAngle This parameter determines inner cone width of a light ray. The range is from 0 to 180, where the value 180 is for the widest beam of light.

Sound Source

Attached sound.

Parameter Description
Sound
CalculateSoundVelocity Enable/Disable sound speed calculation. It is necessary for Doppler Effect calculation.
Pitch Sound playback speed coefficient.
Priority This parameter allows setting the priority of sound playback. If a lot of sounds are played simultaneously, sounds with the minimal priority will be turned off, because it is impossible to play all the sounds considering the sound card restrictions.
SoundName Sound file name.
Volume Sound volume.
Misc
MaxDistance Maximum distance at which the object is audible.
MinDistance Minimum distance at which the object is audible.
RolloffLogarithmicFactor Sound fade coefficient for the logarifmic mode.
RolloffMode Object fade mode. You can chose between Linear, Logarithmic and Manually modes.

Billboard (flat object facing the camera )

Attached billboard. (flat rectangular object facing the camera).

Parameter Description
Billboard
BillboardType Billboard type. You can select from five values: Point (dotted), OrientedCommon (directed and rotated by the CommonDirection vector), OrientedSelf (directed and rotated by its own vector), PerpendicularCommon (perpendicular to the CommonDirection vector), PerpendicularSelf (perpendicular to its own vector).
Color Billboard color.
CommonDirection Vector directing the billboard. This parameter is only required for OrientedCommon and PerpendicularCommon types.
CommonUpVector Vector describing billboards ‘up’ direction. This parameter is only required for PerpendicularCommon and PerpendicularSelf types.
FadeVelocity Billboard fading speed when the object is invisible.
MaterialName Material name.
RenderingDistance With this parameter you can specify the distance at which the billboard becomes invisible. If this paremeter is set to 0, billboard is always rendered.
RenderQueueGroup Determines the object rendering order relative to the others. The property only influences objects with non-transparent materials.
Size Billboard size.
Camera Visibility
CameraVisibleCheck Enable/Disable object visibility check. If this parameter is set to True, object visibility check is performed. If the center of the object is not visible, the object will not be displayed.
CameraVisibleStartOffset Distance at which the object is visible for the camera.

RibbonTrail

RibbonTrail in action: a trail left after the shot from fire arms.

RibbonTrail is an attached object, which renders the geometry in the shape of sheet beam. An example of using it is the bullet tail imitation creation. This is ShotgunGravityBullet.type, which is located in the "Data\Types\Bullets\ShotgunGravityBullet". The alternative (right-click) fire mode of the Shotgun in Game.exe is implemented using the ribbon trail.

Ribbon trail parameters:

Parameter Description
RibbonTrail
CastShadows Turns on/off shadow generation for the object
Chains List of chains shaping the trail.
LifeTimeAfterDestroy Trail’s lifetime after removal.
MaterialName Material name, applied to the object and setting the ribbon trail's appearance.
MaxChainElements Maximum number of ribbon trail elements (the larger the number is, the smoother the trail looks).
RenderingDistance With this parameter you can specify the distance at which the trail becomes invisible. If this paremeter is set to 0, the trail interface is always rendered.
RenderQueueGroup Determines the object rendering order relative to the others. The property only influences objects with non-transparent materials.
TrailLength Trail length.

The trail shape is determined by the Chains parameter. Press the "..." button next to this parameter to open the chain edit mode. The Add andRemove buttons are responsible for adding and removing the chains. Each Chain has four parameters:

ObjectEditor 010.jpg

Trail color gradually changes from InitialColor to ChangeColor as long as the trail is visible. The same happens with the ribbon trail width: it gradually changes from InitialWidth to ChangeWidth.

Parameter Description
ChangeColor End color of the ribbon trail.
ChangeWidth End width of the ribbon trail.
InitialColor Initial color of the ribbon trail.
InitialWidth Initial width of the ribbon trail.

In-Game 3D GUI (user interface)

The attached user interface allows adding rendering the user interface in 3D and providing interaction with it.

Three-dimentional game interface

Gui parameters list:

Parameter Description
Gui
AspectRatio Aspect ratio of the displayed user interface.
DrawFromBackSide Enable/Disable the rendering of the user interface from behind.
RenderingDistance With this parameter you can specify the distance at which the user interface becomes invisible. If this paremeter is set to 0, user interface is always rendered.
RenderQueueGroup Determines the object rendering order relative to the others.

Helper (auxiliary object)

Attached auxiliary object. This object is for developer’s needs. It can be used to determine position of some object relative to the parent object position.

Moving, Rotating and Scaling Attached Objects

Each attached object has a set of basic (General) parameters. The following three of them are of most importance:

  • Position,
  • Rotation,
  • Scale.

These parameters can be set up from the keyboard and using the desktop window instruments (gizmo). Desktop window instruments are available from the toolbar of the object editor window.

ObjectEditor 012.jpg

Select an object before moving, rotating or scaling it. You can do it by clicking on the object in the workspace or by selecting it in the attached objects list.

ObjectEditor 013.jpg

Here you can see the picture of the editor workspace in the object moving mode:

Moving an object

In the rotation mode:

Rotating an object

And in the scaling mode:

Scaling an object

Attaching Objects to BoneSlot

While creating an object type it is often necessary to attach an object to a bone of a three-dimensional skeleton. E.g. attach a gun model to character’s hand bone. You can do it using the BoneSlots parameter. BoneSlot is a point in the space connected to one of skeleton bones.

For this, you have to do the following two things in Object Editor:

  • create a BoneSlot,
  • attach an object to the BoneSlot.
BoneSlot adding

Thus, to create a new BoneSlot you need to select the mesh to use its skeleton and press the "..." button in the BoneSlots parameter.

BoneSlot adding

After that the Bone slot list editing window appears. The Add and Remove buttons are used for adding and removing the bone slot respectively.

BoneSlots list editing

Each BoneSlot has 4 parameters:

Parameter Description
BoneName The name of a mesh bone which is used in this slot. It is selected from the bones list of the attached mesh.
Name Slot name.
Position BoneSlot position relative to the bone.
Rotation BoneSlot rotation relative to the bone.

Once the BoneSlot is created the second step of attaching the object to the bone begins. You can proceed to specifying a BoneSlot for this attached object.

Attaching the object to  BoneSlot

Select the attached object and specify the BoneSlot parameter to do that.

Attaching the object to BoneSlot

Creating a New Object Type

In order to create a new object type, right-click the folder you want to create a new type in. Press the New button in the context menu.

ObjectEditor 022.jpg

Now, specify the type of the resource to be created: Enity Type.

Finally, specify the Name and Class of the new object type in the open window.

ObjectEditor 023.jpg

An object type file was created, and you can start editing it now.

You can also learn the information concerning the New Object type creation from the following tutorials:

Editor Settings

Press the Options button in the Tools menu and then select Entity Type to configure Object Editor.

ObjectEditor 024.jpg

Editor parameters:

Parameter Description
General
Background Color The background color in RGBA mode (red, green, blue, transparency).

Note - Background is only visible when Sky Box is not used.

Show Axes Enable/Disable the displaying of axes.
Show Grid Enable/Disable the displaying of the grid.
Sky Box This parameter is used for changing skybox (sky) displayed at the editor background.

After having finished with editor configuration press OK to save the changes or Cancel to cancel all changes.