ImmediateGeometry

Draws simple geometry from code.

Uses a drawing mode similar to OpenGL 1.x. See also ArrayMesh, MeshDataTool and SurfaceTool for procedural geometry generation. Note: ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use ArrayMesh, MeshDataTool or SurfaceTool instead. Note: Godot uses clockwise url=https://learnopengl.com/Advanced-OpenGL/Face-cullingwinding order/url for front faces of triangle primitive modes. Note: In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under ProjectSettings.rendering/limits/buffers/immediateBufferSizeKb.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

addSphere
void addSphere(long lats, long lons, double radius, bool add_uv)

Simple helper to draw an UV sphere with given latitude, longitude and radius.

addVertex
void addVertex(Vector3 position)

Adds a vertex in local coordinate space with the currently set color/uv/etc.

begin
void begin(long primitive, Texture texture)

Begin drawing (and optionally pass a texture override). When done call end. For more information on how this works, search for glBegin() and glEnd() references. For the type of primitive, see the Mesh.primitivetype enum.

clear
void clear()

Clears everything that was drawn using begin/end.

end
void end()

Ends a drawing context and displays the results.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(ImmediateGeometry other)
opEquals
bool opEquals(typeof(null) n)
setColor
void setColor(Color color)

The current drawing color.

setNormal
void setNormal(Vector3 normal)

The next vertex's normal.

setTangent
void setTangent(Plane tangent)

The next vertex's tangent (and binormal facing).

setUv
void setUv(Vector2 uv)

The next vertex's UV.

setUv2
void setUv2(Vector2 uv)

The next vertex's second layer UV.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
ImmediateGeometry _new()

Construct a new instance of ImmediateGeometry. Note: use memnew!ImmediateGeometry instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta