Documentation
¶
Overview ¶
Package ImmediateMesh provides methods for working with ImmediateMesh object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsImmediateMesh() Instance
- func (self Instance) AsMesh() Mesh.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) ClearSurfaces()
- func (self Instance) SurfaceAddVertex(vertex Vector3.XYZ)
- func (self Instance) SurfaceAddVertex2d(vertex Vector2.XY)
- func (self Instance) SurfaceBegin(primitive gdclass.MeshPrimitiveType)
- func (self Instance) SurfaceEnd()
- func (self Instance) SurfaceSetColor(color Color.RGBA)
- func (self Instance) SurfaceSetNormal(normal Vector3.XYZ)
- func (self Instance) SurfaceSetTangent(tangent Plane.NormalD)
- func (self Instance) SurfaceSetUv(uv Vector2.XY)
- func (self Instance) SurfaceSetUv2(uv2 Vector2.XY)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
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 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 (Instance) AsImmediateMesh ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) SurfaceAddVertex ¶
Add a 3D vertex using the current attributes previously set.
func (Instance) SurfaceAddVertex2d ¶
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 ¶
Set the color attribute that will be pushed with the next vertex.
func (Instance) SurfaceSetNormal ¶
Set the normal attribute that will be pushed with the next vertex.
func (Instance) SurfaceSetTangent ¶
Set the tangent attribute that will be pushed with the next vertex.
func (Instance) SurfaceSetUv ¶
Set the UV attribute that will be pushed with the next vertex.
func (Instance) SurfaceSetUv2 ¶
Set the UV2 attribute that will be pushed with the next vertex.