reckfellENGINE

MeshLibrary

Library of meshes.

On this page
class MeshLibraryReckfellSharpInherits Resource

Library of meshes.

A library of meshes. Contains a list of Mesh resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in GridMap.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

MeshLibraryConstructor
# MeshLibrary
C#
public MeshLibrary();

Methods27

Clearvoid
# Clear
C#
public void Clear();

Clears the library.

CreateItemvoid
# CreateItem
C#
public void CreateItem(int id);

Creates an empty item with a unique nonnegative ID. Assign mesh and shapes separately. Avoid sparse IDs in current-version files: 0/7 works in memory, but item 7 data is lost when saved/reloaded.

Parameters
NameTypeDefault
idint—
id

New item ID. Use contiguous 0,1,…; also respect the GridMap limit of 65535. Renumbering an existing library requires migration of map cell IDs.

FindItemByNameint
# FindItemByName
C#
public int FindItemByName(string name);

Returns the first item with the given name, or -1 if no item is found.

Parameters
NameTypeDefault
namestring—
Returns int
GetItemCategoryStringName
# GetItemCategory
C#
public StringName GetItemCategory(int id);

Returns the category for a specific item id. See also MeshLibrary.SetItemCategory.

Parameters
NameTypeDefault
idint—
Returns StringName
GetItemCountint
# GetItemCount
C#
public int GetItemCount();

Returns the number of items present in the library.

Returns int
GetItemListint[]
# GetItemList
C#
public int[] GetItemList();

Returns the list of item IDs in use.

Returns int[]
GetItemMeshMesh
# GetItemMesh
C#
public Mesh GetItemMesh(int id);

Returns the item's mesh.

Parameters
NameTypeDefault
idint—
Returns Mesh
GetItemMeshCastShadowRenderingServer.ShadowCastingSetting
# GetItemMeshCastShadow
C#
public RenderingServer.ShadowCastingSetting GetItemMeshCastShadow(int id);

Returns the item's shadow casting mode.

Parameters
NameTypeDefault
idint—
Returns RenderingServer.ShadowCastingSetting
GetItemMeshTransformTransform3D
# GetItemMeshTransform
C#
public Transform3D GetItemMeshTransform(int id);

Returns the transform applied to the item's mesh.

Parameters
NameTypeDefault
idint—
Returns Transform3D
GetItemNamestring
# GetItemName
C#
public string GetItemName(int id);

Returns the item's name.

Parameters
NameTypeDefault
idint—
Returns string
GetItemNavigationLayersuint
# GetItemNavigationLayers
C#
public uint GetItemNavigationLayers(int id);

Returns the item's navigation layers bitmask.

Parameters
NameTypeDefault
idint—
Returns uint
GetItemNavigationMeshNavigationMesh
# GetItemNavigationMesh
C#
public NavigationMesh GetItemNavigationMesh(int id);

Returns the item's navigation mesh.

Parameters
NameTypeDefault
idint—
Returns NavigationMesh
GetItemNavigationMeshTransformTransform3D
# GetItemNavigationMeshTransform
C#
public Transform3D GetItemNavigationMeshTransform(int id);

Returns the transform applied to the item's navigation mesh.

Parameters
NameTypeDefault
idint—
Returns Transform3D
GetItemPreviewTexture2D
# GetItemPreview
C#
public Texture2D GetItemPreview(int id);

When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using MeshLibrary.SetItemPreview. Returns an empty Texture2D if no preview was manually set in a running project.

Parameters
NameTypeDefault
idint—
Returns Texture2D
GetItemShapesReckfell.Collections.Array
# GetItemShapes
C#
public Reckfell.Collections.Array GetItemShapes(int id);

Returns an item's collision shapes. The array consists of each Shape3D followed by its Transform3D.

Parameters
NameTypeDefault
idint—
Returns Reckfell.Collections.Array
GetLastUnusedItemIdint
# GetLastUnusedItemId
C#
public int GetLastUnusedItemId();

Gets an unused ID for a new item.

Returns int
RemoveItemvoid
# RemoveItem
C#
public void RemoveItem(int id);

Removes the item.

Parameters
NameTypeDefault
idint—
SetItemCategoryvoid
# SetItemCategory
C#
public void SetItemCategory(int id, StringName category);

Sets the category for a specific item id for organization in the GridMap editor. A category can include / as a delimiter to create subcategories.

Parameters
NameTypeDefault
idint—
categoryStringName—
SetItemMeshvoid
# SetItemMesh
C#
public void SetItemMesh(int id, Mesh mesh);

Sets the item's mesh.

Parameters
NameTypeDefault
idint—
meshMesh—
SetItemMeshCastShadowvoid
# SetItemMeshCastShadow
C#
public void SetItemMeshCastShadow(int id, RenderingServer.ShadowCastingSetting shadowCastingSetting);

Sets the item's shadow casting mode to shadow_casting_setting.

Parameters
NameTypeDefault
idint—
shadowCastingSettingRenderingServer.ShadowCastingSetting—
SetItemMeshTransformvoid
# SetItemMeshTransform
C#
public void SetItemMeshTransform(int id, Transform3D meshTransform);

Sets the transform to apply to the item's mesh.

Parameters
NameTypeDefault
idint—
meshTransformTransform3D—
SetItemNamevoid
# SetItemName
C#
public void SetItemName(int id, string name);

Sets the item's name. This name is shown in the editor. It can also be used to look up the item later using MeshLibrary.FindItemByName.

Parameters
NameTypeDefault
idint—
namestring—
SetItemNavigationLayersvoid
# SetItemNavigationLayers
C#
public void SetItemNavigationLayers(int id, uint navigationLayers);

Sets the item's navigation layers bitmask.

Parameters
NameTypeDefault
idint—
navigationLayersuint—
SetItemNavigationMeshvoid
# SetItemNavigationMesh
C#
public void SetItemNavigationMesh(int id, NavigationMesh navigationMesh);

Sets the item's navigation mesh.

Parameters
NameTypeDefault
idint—
navigationMeshNavigationMesh—
SetItemNavigationMeshTransformvoid
# SetItemNavigationMeshTransform
C#
public void SetItemNavigationMeshTransform(int id, Transform3D navigationMesh);

Sets the transform to apply to the item's navigation mesh.

Parameters
NameTypeDefault
idint—
navigationMeshTransform3D—
SetItemPreviewvoid
# SetItemPreview
C#
public void SetItemPreview(int id, Texture2D texture);

Sets a texture to use as the item's preview icon in the editor.

Parameters
NameTypeDefault
idint—
textureTexture2D—
SetItemShapesvoid
# SetItemShapes
C#
public void SetItemShapes(int id, Reckfell.Collections.Array shapes);

Assigns item physics shapes independently from its mesh. Supply an even number of values as Shape3D, Transform3D pairs. Mesh transforms do not substitute for shape transforms.

Parameters
NameTypeDefault
idint—
shapesReckfell.Collections.Array—
id

Existing library item ID.

shapes

Array of [shape, local transform, …] pairs. A block raised by 1.5 needs that offset assigned separately to its shape and mesh.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.