Libraries.Game.Graphics.MeshBuilder Documentation

Inherits from: Libraries.Language.Object

Variables Table

VariablesDescription
integer TRIANGLESThe TRIANGLES value is one of the possible primitive type values. The Mesh will form triangles from triplets of vertices.
integer LINESThe LINES value is one of the possible primitive type values. The Mesh will form lines using pairs of vertices.
integer POINTSThe POINTS value is one of the possible primitive type values. It is used to indicate that each vertex of the Mesh should be considered an individual point, separate from the other vertices.

Actions Documentation

AddIndex(integer value)

This action will add a new index to the indices of the Mesh under construction.

Parameters

  • integer value

AddLine(Libraries.Game.Graphics.VertexSchematic point1, Libraries.Game.Graphics.VertexSchematic point2)

This action will add two new vertices to the current Mesh under construction, and then create a line between them. This is only valid if the primitive type being used is LINES - otherwise, an error will be thrown.

Parameters

AddLine(integer index1, integer index2)

This action will create a new line between the two given indices in the Mesh under construction. This is only valid if the primitive type being used is LINES - otherwise, an error will be thrown.

Parameters

  • integer index1
  • integer index2

AddLine(number x1, number y1, number z1, number x2, number y2, number z2)

This action will add two new vertices to the current Mesh under construction, and then create a line between them. This is only valid if the primitive type being used is LINES - otherwise, an error will be thrown.

Parameters

  • number x1
  • number y1
  • number z1
  • number x2
  • number y2
  • number z2

AddLine(Libraries.Compute.Vector3 point1, Libraries.Game.Graphics.Color color1, Libraries.Compute.Vector3 point2, Libraries.Game.Graphics.Color color2)

This action will add two new vertices to the current Mesh under construction, and then create a line between them. This is only valid if the primitive type being used is LINES - otherwise, an error will be thrown.

Parameters

AddLine(Libraries.Compute.Vector3 point1, Libraries.Compute.Vector3 point2)

This action will add two new vertices to the current Mesh under construction, and then create a line between them. This is only valid if the primitive type being used is LINES - otherwise, an error will be thrown.

Parameters

AddMesh(Libraries.Containers.Array<number> vertices, Libraries.Containers.Array<integer> indices)

This action will add the given vertex and index arrays to the geometry of the Mesh currently under construction by the MeshBuilder.

Parameters

AddTriangle(Libraries.Game.Graphics.VertexSchematic point1, Libraries.Game.Graphics.VertexSchematic point2, Libraries.Game.Graphics.VertexSchematic point3)

This action will add three new vertices to the Mesh under construction, and create a triangle between them. The primitive type used must be POINTS, LINES, or TRIANGLES. Otherwise, an error will be thrown.

Parameters

AddTriangle(integer index1, integer index2, integer index3)

This action will create a new triangle between the three given indices in the Mesh under construction. This is only valid if the primitive type being used is either POINTS, LINES, or TRIANGLES. Otherwise, an error will be thrown.

Parameters

  • integer index1
  • integer index2
  • integer index3

AddTriangle(Libraries.Compute.Vector3 point1, Libraries.Game.Graphics.Color color1, Libraries.Compute.Vector3 point2, Libraries.Game.Graphics.Color color2, Libraries.Compute.Vector3 point3, Libraries.Game.Graphics.Color color3)

This action will add three new vertices to the Mesh under construction, and create a triangle between them. The primitive type used must be POINTS, LINES, or TRIANGLES. Otherwise, an error will be thrown.

Parameters

AddTriangle(Libraries.Compute.Vector3 point1, Libraries.Compute.Vector3 point2, Libraries.Compute.Vector3 point3)

This action will add three new vertices to the Mesh under construction, and create a triangle between them. The primitive type used must be POINTS, LINES, or TRIANGLES. Otherwise, an error will be thrown.

Parameters

AddVertex(Libraries.Game.Graphics.VertexSchematic schematic)

This action will add the vertex described by the given VertexSchematic to the Mesh currently under construction. This action will return the index of the newly added vertex.

Parameters

Return

integer:

AddVertex(Libraries.Compute.Vector3 pos, Libraries.Compute.Vector3 norm, Libraries.Game.Graphics.Color col, Libraries.Compute.Vector2 uv)

This action will create a new vertex and add it to the Mesh currently under construction. The index of the newly created vertex will be returned.

Parameters

Return

integer:

Begin(Libraries.Game.Graphics.VertexAttributes vAttributes)

This action informs the MeshBuilder to begin constructing a new mesh. If a mesh is already in construction, this will throw an error.

Parameters

Begin(Libraries.Game.Graphics.VertexAttributes vAttributes, integer type)

This action informs the MeshBuilder to begin constructing a new mesh. If a mesh is already in construction, this will throw an error. The VertexAttributes must contain at least a Position attribute, and can also contain Normal, Binormal, Tangent, ColorUnpacked, ColorPacked, or TextureCoordinates attributes. The type should be one of the primitive type constants in the MeshBuilder: POINTS, LINES, or TRIANGLES.

Parameters

BuildBox(Libraries.Compute.Vector3 corner000, Libraries.Compute.Vector3 corner010, Libraries.Compute.Vector3 corner100, Libraries.Compute.Vector3 corner110, Libraries.Compute.Vector3 corner001, Libraries.Compute.Vector3 corner011, Libraries.Compute.Vector3 corner101, Libraries.Compute.Vector3 corner111)

BuildBox(Libraries.Game.Graphics.VertexSchematic corner000, Libraries.Game.Graphics.VertexSchematic corner010, Libraries.Game.Graphics.VertexSchematic corner100, Libraries.Game.Graphics.VertexSchematic corner110, Libraries.Game.Graphics.VertexSchematic corner001, Libraries.Game.Graphics.VertexSchematic corner011, Libraries.Game.Graphics.VertexSchematic corner101, Libraries.Game.Graphics.VertexSchematic corner111)

BuildBox(number width, number height, number depth)

This action will build a box with the given width, height, and depth.

Parameters

  • number width
  • number height
  • number depth

BuildBox(number x, number y, number z, number width, number height, number depth)

This action will build a box at the provided coordinates with the given width, height, and depth.

Parameters

  • number x
  • number y
  • number z
  • number width
  • number height
  • number depth

BuildCylinder(number width, number height, number depth, integer divisions)

This action will build a cylinder shape with the given width, height, and depth. The curve of the cylinder will be made using the provided number of divisions to approximate the curve using straight edges.

Parameters

  • number width
  • number height
  • number depth
  • integer divisions

BuildCylinder(number width, number height, number depth, integer divisions, number angleFrom, number angleTo, boolean close)

This action will build a cylinder shape with the given width, height, and depth. The curve of the cylinder will be made using the provided number of divisions to form straight edges from the starting angle to the ending angle (in degrees). If the provided boolean is true, the cylinder will be closed (the ends will be capped). Otherwise, the cylinder will be open (the ends will not be capped).

Parameters

  • number width
  • number height
  • number depth
  • integer divisions
  • number angleFrom
  • number angleTo
  • boolean close

BuildCylinder(number width, number height, number depth, integer divisions, number angleFrom, number angleTo)

This action will build a cylinder shape with the given width, height, and depth. The curve of the cylinder will be made using the provided number of divisions to form straight edges from the starting angle to the ending angle (in degrees).

Parameters

  • number width
  • number height
  • number depth
  • integer divisions
  • number angleFrom
  • number angleTo

BuildEllipse(number width, number height, integer divisions, Libraries.Compute.Vector3 center, Libraries.Compute.Vector3 normal, number angleFrom, number angleTo)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

BuildEllipse(number width, number height, number innerWidth, number innerHeight, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ, number angleFrom, number angleTo)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • number innerWidth
  • number innerHeight
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ
  • number angleFrom
  • number angleTo

BuildEllipse(number width, number height, integer divisions, Libraries.Compute.Vector3 center, Libraries.Compute.Vector3 normal, Libraries.Compute.Vector3 tangent, Libraries.Compute.Vector3 binormal)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

BuildEllipse(number width, number height, number innerWidth, number innerHeight, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ, number tangentX, number tangentY, number tangentZ, number binormalX, number binormalY, number binormalZ, number angleFrom, number angleTo)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • number innerWidth
  • number innerHeight
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ
  • number tangentX
  • number tangentY
  • number tangentZ
  • number binormalX
  • number binormalY
  • number binormalZ
  • number angleFrom
  • number angleTo

BuildEllipse(number width, number height, number innerWidth, number innerHeight, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • number innerWidth
  • number innerHeight
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ

BuildEllipse(number width, number height, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ, number angleFrom, number angleTo)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ
  • number angleFrom
  • number angleTo

BuildEllipse(number width, number height, number innerWidth, number innerHeight, integer divisions, Libraries.Compute.Vector3 center, Libraries.Compute.Vector3 normal)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

BuildEllipse(number width, number height, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ, number tangentX, number tangentY, number tangentZ, number binormalX, number binormalY, number binormalZ, number angleFrom, number angleTo)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ
  • number tangentX
  • number tangentY
  • number tangentZ
  • number binormalX
  • number binormalY
  • number binormalZ
  • number angleFrom
  • number angleTo

BuildEllipse(number width, number height, integer divisions, Libraries.Compute.Vector3 center, Libraries.Compute.Vector3 normal, Libraries.Compute.Vector3 tangent, Libraries.Compute.Vector3 binormal, number angleFrom, number angleTo)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

BuildEllipse(number width, number height, integer divisions, Libraries.Compute.Vector3 center, Libraries.Compute.Vector3 normal)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

BuildEllipse(number width, number height, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ, number tangentX, number tangentY, number tangentZ, number binormalX, number binormalY, number binormalZ)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ
  • number tangentX
  • number tangentY
  • number tangentZ
  • number binormalX
  • number binormalY
  • number binormalZ

BuildEllipse(number width, number height, integer divisions, number centerX, number centerY, number centerZ, number normalX, number normalY, number normalZ)

This action will add an ellipse to the geometry of the mesh that is under construction.

Parameters

  • number width
  • number height
  • integer divisions
  • number centerX
  • number centerY
  • number centerZ
  • number normalX
  • number normalY
  • number normalZ

BuildPlane(Libraries.Game.Graphics.VertexSchematic corner00, Libraries.Game.Graphics.VertexSchematic corner01, Libraries.Game.Graphics.VertexSchematic corner10, Libraries.Game.Graphics.VertexSchematic corner11, boolean doubleSided)

This action will create a box using the 8 provide