MeshLibrary

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsMeshLibrary() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsMeshLibrary

func (self *Extension[T]) AsMeshLibrary() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.MeshLibrary

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsMeshLibrary

func (self Instance) AsMeshLibrary() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) Clear

func (self Instance) Clear()

Clears the library.

func (Instance) CreateItem

func (self Instance) CreateItem(id int)

Creates a new item in the library with the given ID.

You can get an unused ID from GetLastUnusedItemId.

func (Instance) FindItemByName

func (self Instance) FindItemByName(name string) int

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

func (Instance) GetItemList

func (self Instance) GetItemList() []int32

Returns the list of item IDs in use.

func (Instance) GetItemMesh

func (self Instance) GetItemMesh(id int) Mesh.Instance

Returns the item's mesh.

func (Instance) GetItemMeshCastShadow

func (self Instance) GetItemMeshCastShadow(id int) RenderingServer.ShadowCastingSetting

Returns the item's shadow casting mode.

func (Instance) GetItemMeshTransform

func (self Instance) GetItemMeshTransform(id int) Transform3D.BasisOrigin

Returns the transform applied to the item's mesh.

func (Instance) GetItemName

func (self Instance) GetItemName(id int) string

Returns the item's name.

func (Instance) GetItemNavigationLayers

func (self Instance) GetItemNavigationLayers(id int) int

Returns the item's navigation layers bitmask.

func (Instance) GetItemNavigationMesh

func (self Instance) GetItemNavigationMesh(id int) NavigationMesh.Instance

Returns the item's navigation mesh.

func (Instance) GetItemNavigationMeshTransform

func (self Instance) GetItemNavigationMeshTransform(id int) Transform3D.BasisOrigin

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

func (Instance) GetItemPreview

func (self Instance) GetItemPreview(id int) Texture2D.Instance

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 SetItemPreview. Returns an empty Texture2D if no preview was manually set in a running project.

func (Instance) GetItemShapes

func (self Instance) GetItemShapes(id int) []Shape3D.Instance

Returns an item's collision shapes.

The array consists of each Shape3D followed by its Transform3D.BasisOrigin.

func (Instance) GetLastUnusedItemId

func (self Instance) GetLastUnusedItemId() int

Gets an unused ID for a new item.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) RemoveItem

func (self Instance) RemoveItem(id int)

Removes the item.

func (Instance) SetItemMesh

func (self Instance) SetItemMesh(id int, mesh Mesh.Instance)

Sets the item's mesh.

func (Instance) SetItemMeshCastShadow

func (self Instance) SetItemMeshCastShadow(id int, shadow_casting_setting RenderingServer.ShadowCastingSetting)

Sets the item's shadow casting mode to 'shadow_casting_setting'.

func (Instance) SetItemMeshTransform

func (self Instance) SetItemMeshTransform(id int, mesh_transform Transform3D.BasisOrigin)

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

func (Instance) SetItemName

func (self Instance) SetItemName(id int, name string)

Sets the item's name.

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

func (Instance) SetItemNavigationLayers

func (self Instance) SetItemNavigationLayers(id int, navigation_layers int)

Sets the item's navigation layers bitmask.

func (Instance) SetItemNavigationMesh

func (self Instance) SetItemNavigationMesh(id int, navigation_mesh NavigationMesh.Instance)

Sets the item's navigation mesh.

func (Instance) SetItemNavigationMeshTransform

func (self Instance) SetItemNavigationMeshTransform(id int, navigation_mesh Transform3D.BasisOrigin)

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

func (Instance) SetItemPreview

func (self Instance) SetItemPreview(id int, texture Texture2D.Instance)

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

func (Instance) SetItemShapes

func (self Instance) SetItemShapes(id int, shapes []Shape3D.Instance)

Sets an item's collision shapes.

The array should consist of Shape3D objects, each followed by a Transform3D.BasisOrigin that will be applied to it. For shapes that should not have a transform, use [Transform3d.Identity].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL