MeshLibrary

Inherits: Resource < Reference < Object Library of meshes.

Description

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

Tutorials

  • 3D Kinematic Character Demo
  • 3D Platformer Demo

    Methods

    Method Descriptions

  • clear ( ) Clears the library.

  • create_item ( int id ) Creates a new item in the library with the given ID. get_last_unused_item_id.

  • int find_item_by_name ( String name ) const Returns the first item with the given name.

  • PoolIntArray get_item_list ( ) const Returns the list of item IDs in use.

  • Mesh get_item_mesh ( int id ) const Returns the item’s mesh.

  • Transform get_item_mesh_transform ( int id ) const Returns the transform applied to the item’s mesh.

  • String get_item_name ( int id ) const Returns the item’s name.

  • NavigationMesh get_item_navmesh ( int id ) const Returns the item’s navigation mesh.

  • Transform get_item_navmesh_transform ( int id ) const Returns the transform applied to the item’s navigation mesh.

  • Texture get_item_preview ( int id ) const set_item_preview. Returns an empty Texture if no preview was manually set in a running project.

  • Array get_item_shapes ( int id ) const Returns an item’s collision shapes. Shape followed by its Transform.

  • int get_last_unused_item_id ( ) const Gets an unused ID for a new item.

  • remove_item ( int id ) Removes the item.

  • set_item_mesh ( int id, Mesh mesh ) Sets the item’s mesh.

  • set_item_mesh_transform ( int id, Transform mesh_transform ) Sets the transform to apply to the item’s mesh.

  • set_item_name ( int id, String name ) Sets the item’s name. find_item_by_name.

  • set_item_navmesh ( int id, NavigationMesh navmesh ) Sets the item’s navigation mesh.

  • set_item_navmesh_transform ( int id, Transform navmesh ) Sets the transform to apply to the item’s navigation mesh.

  • set_item_preview ( int id, Texture texture ) Sets a texture to use as the item’s preview icon in the editor.

  • set_item_shapes ( int id, Array shapes ) Sets an item’s collision shapes. Shape objects, each followed by a Transform that will be applied to it. For shapes that should not have a transform, use Transform.IDENTITY.