ArrayMesh

The ArrayMesh is used to construct a Mesh by specifying the attributes as arrays. The most basic example is the creation of a single triangle

More...

Members

Aliases

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

Enums

ArrayFormat
enum ArrayFormat
ArrayType
enum ArrayType
Constants
enum Constants

Functions

addBlendShape
void addBlendShape(StringArg0 name)
addSurfaceFromArrays
void addSurfaceFromArrays(long primitive, Array arrays, Array blend_shapes, long compress_flags)

Creates a new surface. Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. See Mesh for details. (As a note, when using indices, it is recommended to only use points, lines or triangles). Mesh.getSurfaceCount will become the surf_idx for this new surface. The arrays argument is an array of arrays. See arraytype for the values used in this array. For example, arrays$(D 0) is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for ARRAY_INDEX if it is used. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices. Godot uses clockwise winding order for front faces of triangle primitive modes.

centerGeometry
void centerGeometry()

Centers the geometry.

clearBlendShapes
void clearBlendShapes()

Remove all blend shapes from this ArrayMesh.

getBlendShapeCount
long getBlendShapeCount()

Returns the number of blend shapes that the ArrayMesh holds.

getBlendShapeMode
Mesh.BlendShapeMode getBlendShapeMode()
getBlendShapeName
String getBlendShapeName(long index)

Returns the name of the blend shape at this index.

getCustomAabb
AABB getCustomAabb()
lightmapUnwrap
GodotError lightmapUnwrap(Transform transform, double texel_size)

Will perform a UV unwrap on the ArrayMesh to prepare the mesh for lightmapping.

opAssign
ArrayMesh opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(ArrayMesh other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
regenNormalmaps
void regenNormalmaps()

Will regenerate normal maps for the ArrayMesh.

setBlendShapeMode
void setBlendShapeMode(long mode)
setCustomAabb
void setCustomAabb(AABB aabb)
surfaceFindByName
long surfaceFindByName(StringArg0 name)

Return the index of the first surface with this name held within this ArrayMesh. If none are found -1 is returned.

surfaceGetArrayIndexLen
long surfaceGetArrayIndexLen(long surf_idx)

Return the length in indices of the index array in the requested surface (see addSurfaceFromArrays).

surfaceGetArrayLen
long surfaceGetArrayLen(long surf_idx)

Return the length in vertices of the vertex array in the requested surface (see addSurfaceFromArrays).

surfaceGetFormat
long surfaceGetFormat(long surf_idx)

Return the format mask of the requested surface (see addSurfaceFromArrays).

surfaceGetName
String surfaceGetName(long surf_idx)

Get the name assigned to this surface.

surfaceGetPrimitiveType
Mesh.PrimitiveType surfaceGetPrimitiveType(long surf_idx)

Return the primitive type of the requested surface (see addSurfaceFromArrays).

surfaceRemove
void surfaceRemove(long surf_idx)

Remove a surface at position surf_idx, shifting greater surfaces one surf_idx slot down.

surfaceSetMaterial
void surfaceSetMaterial(long surf_idx, Material material)

Set a Material for a given surface. Surface will be rendered using this material.

surfaceSetName
void surfaceSetName(long surf_idx, StringArg1 name)

Set a name for a given surface.

surfaceUpdateRegion
void surfaceUpdateRegion(long surf_idx, long offset, PoolByteArray data)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

blendShapeMode
Mesh.BlendShapeMode blendShapeMode [@property getter]
long blendShapeMode [@property setter]
customAabb
AABB customAabb [@property getter]
AABB customAabb [@property setter]

An overriding bounding box for this mesh.

Static functions

_new
ArrayMesh _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
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
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
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.

Detailed Description

var vertices = PoolVector3Array() vertices.push_back(Vector3(0,1,0)) vertices.push_back(Vector3(1,0,0)) vertices.push_back(Vector3(0,0,1)) # Initialize the ArrayMesh. var arr_mesh = ArrayMesh.new() var arrays = [] arrays.resize(ArrayMesh.ARRAY_MAX) arraysArrayMesh.ARRAY_VERTEX = vertices # Create the Mesh. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) var m = MeshInstance.new() m.mesh = arr_mesh

The MeshInstance is ready to be added to the SceneTree to be shown.

Meta