Mesh

Inherits: Resource < Reference < Object

Inherited By: ArrayMesh, PrimitiveMesh

Category: Core

Brief Description

A Resource that contains vertex-array based geometry.

Member Variables

Numeric Constants

  • PRIMITIVE_POINTS = 0 — Render array as points (one vertex equals one point).
  • PRIMITIVE_LINES = 1 — Render array as lines (every two vertices a line is created).
  • PRIMITIVE_LINE_STRIP = 2 — Render array as line strip.
  • PRIMITIVE_LINE_LOOP = 3 — Render array as line loop (like line strip, but closed).
  • PRIMITIVE_TRIANGLES = 4 — Render array as triangles (every three vertices a triangle is created).
  • PRIMITIVE_TRIANGLE_STRIP = 5 — Render array as triangle strips.
  • PRIMITIVE_TRIANGLE_FAN = 6 — Render array as triangle fans.
  • BLEND_SHAPE_MODE_NORMALIZED = 0
  • BLEND_SHAPE_MODE_RELATIVE = 1
  • ARRAY_FORMAT_VERTEX = 1
  • ARRAY_FORMAT_NORMAL = 2
  • ARRAY_FORMAT_TANGENT = 4
  • ARRAY_FORMAT_COLOR = 8
  • ARRAY_FORMAT_TEX_UV = 16
  • ARRAY_FORMAT_TEX_UV2 = 32
  • ARRAY_FORMAT_BONES = 64
  • ARRAY_FORMAT_WEIGHTS = 128
  • ARRAY_FORMAT_INDEX = 256
  • ARRAY_COMPRESS_BASE = 9
  • ARRAY_COMPRESS_VERTEX = 512
  • ARRAY_COMPRESS_NORMAL = 1024
  • ARRAY_COMPRESS_TANGENT = 2048
  • ARRAY_COMPRESS_COLOR = 4096
  • ARRAY_COMPRESS_TEX_UV = 8192
  • ARRAY_COMPRESS_TEX_UV2 = 16384
  • ARRAY_COMPRESS_BONES = 32768
  • ARRAY_COMPRESS_WEIGHTS = 65536
  • ARRAY_COMPRESS_INDEX = 131072
  • ARRAY_FLAG_USE_2D_VERTICES = 262144
  • ARRAY_FLAG_USE_16_BIT_BONES = 524288
  • ARRAY_COMPRESS_DEFAULT = 97792
  • ARRAY_VERTEX = 0
  • ARRAY_NORMAL = 1
  • ARRAY_TANGENT = 2
  • ARRAY_COLOR = 3
  • ARRAY_TEX_UV = 4
  • ARRAY_TEX_UV2 = 5
  • ARRAY_BONES = 6
  • ARRAY_WEIGHTS = 7
  • ARRAY_INDEX = 8
  • ARRAY_MAX = 9

Description

Mesh is a type of Resource that contains vertex-array based geometry, divided in surfaces. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.

Member Function Description

  • Shape create_convex_shape ( ) const

Calculate a ConvexPolygonShape from the mesh.

Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise).

  • Shape create_trimesh_shape ( ) const

Calculate a ConcavePolygonShape from the mesh.

Generate a TriangleMesh from the mesh.

Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.