Libraries.Game.Graphics.ModelBuilder Documentation

The ModelBuilder class constructs new ModelBlueprints in code. It is primarily responsible for creating primitive shapes for use by the Model class. Most users will likely want to use the actions in Model to load primitives, rather than using this class directly.

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 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.
integer LINESThe LINES value is one of the possible primitive type values. The Mesh will form lines using pairs of vertices.

Actions Documentation

AddNode()

This action will add a new Node to the ModelBlueprint. Use any of the AddPart(...) methods to add a NodePart.

Return

Libraries.Game.Graphics.ModelData.Node:

AddPart(text id, integer primitiveType, Libraries.Game.Graphics.VertexAttributes attributes, Libraries.Game.Graphics.Material material)

This action will create a new MeshPart within the current Node that is being added to the ModelBlueprint under construction, and will return a MeshBuilder which can be used to build the shape of the part. Because MeshBuilders are reused during the construction process, only one part can be built at a time.

Parameters

Return

Libraries.Game.Graphics.MeshBuilder:

AddPart(text id, integer primitiveType, integer attributes, Libraries.Game.Graphics.Material material)

This action will create a new MeshPart within the current Node that is being added to the ModelBlueprint under construction, and will return a MeshBuilder which can be used to build the shape of the part. Because MeshBuilders are reused during the construction process, only one part can be built at a time.

Parameters

Return

Libraries.Game.Graphics.MeshBuilder:

AddPart(text id, Libraries.Game.Graphics.Mesh mesh, integer primitiveType, integer offset, integer size, Libraries.Game.Graphics.Material material)

This action will add a MeshPart to the current Node that is being added to the ModelBlueprint under construction.

Parameters

Return

Libraries.Game.Graphics.ModelData.MeshPart:

AddPart(text id, Libraries.Game.Graphics.Mesh mesh, integer primitiveType, Libraries.Game.Graphics.Material material)

This action will add a MeshPart to the current Node that is being added to the ModelBlueprint under construction.

Parameters

Return

Libraries.Game.Graphics.ModelData.MeshPart:

AddPart(Libraries.Game.Graphics.ModelData.MeshPart meshPart, Libraries.Game.Graphics.Material material)

The AddPart action will add the given MeshPart to the current Node that is being added to the ModelBlueprint under construction.

Parameters

Begin()

The Begin action prepares the ModelBuilder to build a new ModelBlueprint. If the ModelBlueprint was still in the process of building a ModelBlueprint, this will throw an error.

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

CreateAttributes(integer mask)

This action will convert an integer mask of attributes into a VertexAttributes object.

Parameters

  • integer mask

Return

Libraries.Game.Graphics.VertexAttributes:

CreateBox(number width, number height, number depth, Libraries.Game.Graphics.Color color)

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

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateBox(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)

This action will create a box with the given width, height, and depth, and applies the given Texture to it.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateBox(number width, number height, number depth, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributes)

This action will create a new ModelBlueprint with a single node containing a box shape. The box will be formed using the given width, height, and depth. The geometry will be formed using the given primitive type, which must be POINTS, LINES, or TRIANGLES. The resulting ModelBlueprint will use the given Material. The attributes mask should be the result of using the BitwiseOperations:Or(...) action on each of the VertexAttributes constant values that are to be used. The supported values are POSITION, COLOR, NORMAL, and TEXTURE_COORDINATES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateBox(number width, number height, number depth, Libraries.Game.Graphics.Material material, integer attributesMask)

This action will create a new ModelBlueprint with a single node containing a box shape. The box will be formed using the given width, height, and depth, and will use the given Material. The attributes mask should be the result of using the BitwiseOperations:Or(...) action on each of the VertexAttributes constant values that are to be used. The supported values are POSITION, COLOR, NORMAL, and TEXTURE_COORDINATES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Color color)

This action will create a new ModelBlueprint with a single node containing a cylinder shape. The cylinder will be constructed with the given width, height, and depth. The curve of the cylinder will be approximated with straight edges, using the provided number of divisions. A larger count of divisions will use more edges to create a smoother curve. The created cylinder will be a single diffuse color, matching the provided Color object.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateCylinder(number width, number height, number depth, integer divisions, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask)

This action will create a new ModelBlueprint with a single node containing a cylinder shape. The cylinder will be made using the given width, height, and depth, and using the provided primitive type, Material, and attributes.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Material material, integer attributesMask, number angleFrom, number angleTo)

This action will create a new ModelBlueprint with a single node containing a cylinder shape. The cylinder will be made using the given width, height, and depth, and using the provided Material and attributes. The cylinder will go from the starting angle provided to the ending angle provided, in degrees.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Material material, integer attributesMask)

This action will create a new ModelBlueprint with a single node containing a cylinder shape. The cylinder will be made using the given width, height, and depth. The primitive type used to form the cylinder will be TRIANGLES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateCylinder(number width, number height, number depth, integer divisions, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask, number angleFrom, number angleTo)

This action will create a new ModelBlueprint with a single node containing a cylinder shape. The cylinder will be constructed with the given width, height, and depth, and using the provided Material and other parameters to build the model.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Texture texture)

This action will create a new ModelBlueprint with a single node containing a cylinder shape. The cylinder will be constructed with the given width, height, and depth. The curve of the cylinder will be approximated with straight edges, using the provided number of divisions. A larger count of divisions will use more edges to create a smoother curve. The created cylinder will then be wrapped with the provided Texture.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, Libraries.Game.Graphics.Material material, integer attributesMask, boolean doubleSided)

This action will create a new ModelBlueprint with a single node containing a flat plane. The plane will be formed using the given width and depth, and will use the given Material. The attributes mask should be the result of using the BitwiseOperations:Or(...) action on each of the VertexAttributes constant values that are to be used. The supported values are POSITION, COLOR, NORMAL, and TEXTURE_COORDINATES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color)

This action will create a plane with the given width, depth, and color.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, Libraries.Game.Graphics.Texture texture, boolean doubleSided)

This action will create a plane with the given width and depth, and applies the given Texture to it.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributes, boolean doubleSided)

This action will create a new ModelBlueprint with a single node containing a plane shape. The plane will be formed using the given width and depth. The geometry will be formed using the given primitive type, which must be POINTS, LINES, or TRIANGLES. The resulting ModelBlueprint will use the given Material. The attributes mask should be the result of using the BitwiseOperations:Or(...) action on each of the VertexAttributes constant values that are to be used. The supported values are POSITION, COLOR, NORMAL, and TEXTURE_COORDINATES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color, boolean doubleSided)

This action will create a plane with the given width, depth, and color.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, Libraries.Game.Graphics.Texture texture)

This action will create a plane with the given width and depth, and applies the given Texture to it.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributes)

This action will create a new ModelBlueprint with a single node containing a plane shape. The plane will be formed using the given width and depth. The geometry will be formed using the given primitive type, which must be POINTS, LINES, or TRIANGLES. The resulting ModelBlueprint will use the given Material. The attributes mask should be the result of using the BitwiseOperations:Or(...) action on each of the VertexAttributes constant values that are to be used. The supported values are POSITION, COLOR, NORMAL, and TEXTURE_COORDINATES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreatePlane(number width, number depth, Libraries.Game.Graphics.Material material, integer attributesMask)

This action will create a new ModelBlueprint with a single node containing a flat plane. The plane will be formed using the given width and depth, and will use the given Material. The attributes mask should be the result of using the BitwiseOperations:Or(...) action on each of the VertexAttributes constant values that are to be used. The supported values are POSITION, COLOR, NORMAL, and TEXTURE_COORDINATES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Texture texture)

This action will create a new ModelBlueprint with a single node containing a sphere shape. The sphere will be constructed with the given width, height, and depth. The curve of the cylinder will be approximated with straight edges, using the provided number of divisions. A larger count of divisions will use more edges to create a smoother curve. The created sphere will then be wrapped with the provided Texture.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask)

This action will create a new ModelBlueprint with a single node containing a sphere shape. The sphere will be made using the given width, height, and depth, and using the provided primitive type, Material, and attributes.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Material material, integer attributesMask)

This action will create a new ModelBlueprint with a single node containing a sphere shape. The cylinder will be made using the given width, height, and depth. The primitive type used to form the cylinder will be TRIANGLES.

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Color color)

This action will create a new ModelBlueprint with a single node containing a sphere shape. The sphere will be constructed with the given width, height, and depth. The curve of the sphere will be approximated with straight edges, using the provided number of divisions. A larger count of divisions will use more edges to create a smoother curve. The created sphere will be a single diffuse color, matching the provided Color object.

Parameters