MeshLibrary

package
v0.0.0-...-01268d7 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package MeshLibrary provides methods for working with MeshLibrary object instances.

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 Instance

type Instance [1]gdclass.MeshLibrary

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].

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 [method get_last_unused_item_id].

func (Instance) FindItemByName

func (self Instance) FindItemByName(name string) int

Returns the first item with the given name, or [code]-1[/code] 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) [1]gdclass.Mesh

Returns the item's mesh.

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) [1]gdclass.NavigationMesh

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) [1]gdclass.Texture2D

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

func (Instance) GetItemShapes

func (self Instance) GetItemShapes(id int) []any

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

func (Instance) GetLastUnusedItemId

func (self Instance) GetLastUnusedItemId() int

Gets an unused ID for a new item.

func (Instance) RemoveItem

func (self Instance) RemoveItem(id int)

Removes the item.

func (Instance) SetItemMesh

func (self Instance) SetItemMesh(id int, mesh [1]gdclass.Mesh)

Sets the item's mesh.

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 [method find_item_by_name].

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 [1]gdclass.NavigationMesh)

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 [1]gdclass.Texture2D)

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

func (Instance) SetItemShapes

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

Sets an item's collision shapes. The array should consist of [Shape3D] objects, each followed by a [Transform3D] that will be applied to it. For shapes that should not have a transform, use [constant Transform3D.IDENTITY].

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

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