Documentation/Entity Types/Base/StaticMesh.type

From NeoAxis Engine Wiki

Jump to: navigation, search
Go to higher level
StaticMesh 001.jpg

Description

Almost every project has a lot of static objects on the map. For example tunnels, separate rooms, hallways, rocks, towers, buildings, etc. There are two ways to make this kind of objects:

  • With StaticMesh.type.
  • With a game object (.type file) created with Resource Editor.

Each method has it pros and cons:

1. There is no need for a special type for created object. You simply place the model (.mesh file) on the map and configure settings for each objects location. This method is used to create a large static objects (buildings, rooms and geometry, etc.).

2. With the second method, you must first create a game object type (.type file) and then place that object on the map. This way you can configure an object once and then simply place it on the map. Required properties will already be configured. Also it is better to use this method if you want to add more interactivity than plain collision. This method is described here.

In this article we will describe the first method.

Creation

Open the Map Editor and in it, open map TankDemo. You can see a few models of trees. Let's add one more.

Tree models placed on a map.

To do this, go to Types -> Base and choose StaticMesh.

Entity Creation window opens, in which we can find all models available to us for placement through StaticMesh.

Expand the list and go to Maps -> TankDemo -> Resources -> Meshes -> Trees. In this folder, we see two types of trees available for placement on the map. Choose TankDemoTree01.mesh.

Choosing a tree.

As we see, to the cursor changed from a white cube to a tree model. Click the left mouse button on the place where you want to place a tree.

Admire a newly placed tree.

Now we will let the trees cast shadows from dynamic light sources. To do this click on the tree with left mouse button. We see that properties of this object become available.

Editing properties.

Select CastDynamicShadows and change option from False to True. Now our tree casts a shadow not only from static light sources, but also from the dynamic ones. We should now click on the Save button to complete the placement and editing of the new StaticMesh object.

Properties

Name Description
AlignmentMethod Allows you to configure automatic alignment of the object relative to the surface. Available are 3 positions: By Bounds - aligns objects by size, By Bounds With Rotation - Performs alignment in size and also changes the orientation to match the object if it is not horizontal to the surface, By Center - alignment point is in the object's center.
Layer Allows you to choose / find the layer on which the object is placed.
Position Allows you to view / edit the object's position on the map.
Rotation Allows you to view / edit the orientation of the object on the map.
Scale Allows you to stretch / resize the object.
AllowDecals Enables / disables the attachment of decals to this object. If not allowed, the decals (for example, the marks of bullets, explosions) will not appear on the object.
СastDynamicShadows Allows you to enable / disable the generation of dynamic shadows on the object.
СastStaticShadows Allows you to enable / disable the generation of static (lightmap) shadows on the object.
Collision Allows you to enable / disable rendering collisions with an object. If disabled, other physical bodies (eg. characters) will pass through the object.
СollisionMaterialName Physical material. Allows you to select from 4 values - Metal, Wood, Rubber, Ice.This parameter affects the properties of the interaction between physical body and environment. For example, if you place the card box, change the setting to Ice and push it, it will slide like on ice.
СollisionSpecialMeshName This option allows you to change the geometry of collisions for this object. Can be used to facilitate the rendering of complex physical objects. If you specify a different mesh, then the collisions will calculate it exactly, and its name and path will be visible in MeshName parameter.
ForceMaterial Allows you to specify a different material for the object.
MeshName Mesh file name.
ReceiveStаticShadows Allows you to draw shadows on this object. If this option is enabled, the shadow cast by other objects will be drawn on it.
RenderingDistance Allows you to specify the distance, after which the object is not visible. A value of 0 means that it is always visible.
RenderQueueGroup Defines rendering of the object relative to other objects.
SplitGeometry Allows you to automatically cut the mesh into small pieces that match the size set in SplitGeometrySize. This allows managers to better filter out the geometry of the scene that were not in the screen. It is used for large objects (such as rooms, buildings, inside of which is a character).
SplitGeometryPieceSize Allows you to specify the size of cut piece. The higher the value, the larger piece. See SplitGeometry.