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 directl

Inherits from: Libraries.Language.Object

Summary

Variable Summary Table

VariablesDescription
integer TRIANGLESThe TRIANGLES value is one of the possible primitive type values. The Mesh will form triangles from triplets of vertice
integer LINESThe LINES value is one of the possible primitive type values. The Mesh will form lines using pairs of vertice
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 vertice

Actions Summary Table

ActionsDescription
AddNode()This action will add a new Node to the ModelBlueprint.
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.
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.
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 constructio
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 constructio
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 constructio
Begin()The Begin action prepares the ModelBuilder to build a new ModelBlueprint.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
CreateAttributes(integer mask)This action will convert an integer mask of attributes into a VertexAttributes objec
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 colo
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 i
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.
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.
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.
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.
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.
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.
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.
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.
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.
CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color)This action will create a plane with the given width, depth, and colo
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 i
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.
CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color, boolean doubleSided)This action will create a plane with the given width, depth, and colo
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 i
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.
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.
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.
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.
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.
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.
CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Material material, integer attributesMask, number angleUFrom, number angleUTo, number angleVFrom, number angleVTo)This action will create a new ModelBlueprint with a single node containing a sphere shape.
CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask, number angleUFrom, number angleUTo, number angleVFrom, number angleVTo)This action will create a new ModelBlueprint with a single node containing a sphere shape.
End()The End action stops building the current ModelBlueprint, returning the ModelBlueprin
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetHashCode()This action gets the hash code for an object.

Actions Documentation

AddNode()

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

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 tim

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 tim

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 constructio

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 constructio

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 constructio

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 erro

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.

Example Code

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

Parameters

Return

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

CreateAttributes(integer mask)

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

Parameters

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 colo

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 i

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_COORDINATE

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_COORDINATE

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 objec

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 attribute

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 degree

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 TRIANGLE

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 mode

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 Textur

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_COORDINATE

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 colo

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 i

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_COORDINATE

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 colo

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 i

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_COORDINATE

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_COORDINATE

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 Textur

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 attribute

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 TRIANGLE

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 objec

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

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

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 Material and attributes. The sphere will go from the starting angle provided to the ending angle provided, in degree

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, number angleUFrom, number angleUTo, number angleVFrom, number angleVTo)

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, and using the provided Material and other parameters to build the mode

Parameters

Return

Libraries.Game.Graphics.ModelBlueprint:

End()

The End action stops building the current ModelBlueprint, returning the ModelBlueprin

Return

Libraries.Game.Graphics.ModelBlueprint:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode

Return

integer: The integer hash code of the object.