ImmediateMesh

package
v0.0.0-...-59761c8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package ImmediateMesh provides methods for working with ImmediateMesh 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
	AsImmediateMesh() Instance
}

type Instance

type Instance [1]gdclass.ImmediateMesh

A mesh type optimized for creating geometry manually, similar to OpenGL 1.x immediate mode. Here's a sample on how to generate a triangular face: [codeblocks] [gdscript] var mesh = ImmediateMesh.new() mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES) mesh.surface_add_vertex(Vector3.LEFT) mesh.surface_add_vertex(Vector3.FORWARD) mesh.surface_add_vertex(Vector3.ZERO) mesh.surface_end() [/gdscript] [csharp] var mesh = new ImmediateMesh(); mesh.SurfaceBegin(Mesh.PrimitiveType.Triangles); mesh.SurfaceAddVertex(Vector3.Left); mesh.SurfaceAddVertex(Vector3.Forward); mesh.SurfaceAddVertex(Vector3.Zero); mesh.SurfaceEnd(); [/csharp] [/codeblocks] [b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly inefficient. Instead, it is designed to generate simple geometry that changes often.

var Nil Instance

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

func New

func New() Instance

func (Instance) AsImmediateMesh

func (self Instance) AsImmediateMesh() Instance

func (Instance) AsMesh

func (self Instance) AsMesh() Mesh.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) ClearSurfaces

func (self Instance) ClearSurfaces()

Clear all surfaces.

func (Instance) SurfaceAddVertex

func (self Instance) SurfaceAddVertex(vertex Vector3.XYZ)

Add a 3D vertex using the current attributes previously set.

func (Instance) SurfaceAddVertex2d

func (self Instance) SurfaceAddVertex2d(vertex Vector2.XY)

Add a 2D vertex using the current attributes previously set.

func (Instance) SurfaceBegin

func (self Instance) SurfaceBegin(primitive gdclass.MeshPrimitiveType)

Begin a new surface.

func (Instance) SurfaceEnd

func (self Instance) SurfaceEnd()

End and commit current surface. Note that surface being created will not be visible until this function is called.

func (Instance) SurfaceSetColor

func (self Instance) SurfaceSetColor(color Color.RGBA)

Set the color attribute that will be pushed with the next vertex.

func (Instance) SurfaceSetNormal

func (self Instance) SurfaceSetNormal(normal Vector3.XYZ)

Set the normal attribute that will be pushed with the next vertex.

func (Instance) SurfaceSetTangent

func (self Instance) SurfaceSetTangent(tangent Plane.NormalD)

Set the tangent attribute that will be pushed with the next vertex.

func (Instance) SurfaceSetUv

func (self Instance) SurfaceSetUv(uv Vector2.XY)

Set the UV attribute that will be pushed with the next vertex.

func (Instance) SurfaceSetUv2

func (self Instance) SurfaceSetUv2(uv2 Vector2.XY)

Set the UV2 attribute that will be pushed with the next vertex.

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