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
Variables | Description |
---|---|
integer LINES | The LINES value is one of the possible primitive type values. The Mesh will form lines using pairs of vertices. |
integer POINTS | The 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 TRIANGLES | The TRIANGLES value is one of the possible primitive type values. The Mesh will form triangles from triplets 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
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
- text id
- integer primitiveType
- Libraries.Game.Graphics.VertexAttributes
- Libraries.Game.Graphics.Material
Return
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
- text id
- integer primitiveType
- integer attributes
- Libraries.Game.Graphics.Material
Return
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
- text id
- Libraries.Game.Graphics.Mesh
- integer primitiveType
- integer offset
- integer size
- Libraries.Game.Graphics.Material
Return
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
- text id
- Libraries.Game.Graphics.Mesh
- integer primitiveType
- Libraries.Game.Graphics.Material
Return
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
- Libraries.Language.Object: The object to compare to.
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
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
- number width
- number height
- number depth
- Libraries.Game.Graphics.Color
Return
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
- number width
- number height
- number depth
- Libraries.Game.Graphics.Texture
Return
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
- number width
- number height
- number depth
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributes
Return
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
- number width
- number height
- number depth
- Libraries.Game.Graphics.Material
- integer attributesMask
Return
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
- number width
- number height
- number depth
- integer divisions
- Libraries.Game.Graphics.Color
Return
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
- number width
- number height
- number depth
- integer divisions
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributesMask
Return
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
- number width
- number height
- number depth
- integer divisions
- Libraries.Game.Graphics.Material
- integer attributesMask
- number angleFrom
- number angleTo
Return
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
- number width
- number height
- number depth
- integer divisions
- Libraries.Game.Graphics.Material
- integer attributesMask
Return
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
- number width
- number height
- number depth
- integer divisions
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributesMask
- number angleFrom
- number angleTo
Return
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
- number width
- number height
- number depth
- integer divisions
- Libraries.Game.Graphics.Texture
Return
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
- number width
- number depth
- Libraries.Game.Graphics.Material
- integer attributesMask
- boolean doubleSided
Return
CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color)
This action will create a plane with the given width, depth, and color.
Parameters
- number width
- number depth
- Libraries.Game.Graphics.Color
Return
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
- number width
- number depth
- Libraries.Game.Graphics.Texture
- boolean doubleSided
Return
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
- number width
- number depth
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributes
- boolean doubleSided
Return
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
- number width
- number depth
- Libraries.Game.Graphics.Color
- boolean doubleSided
Return
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
- number width
- number depth
- Libraries.Game.Graphics.Texture
Return
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
- number width
- number depth
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributes
Return
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
- number width
- number depth
- Libraries.Game.Graphics.Material
- integer attributesMask
Return
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
- number width
- number height
- number depth
- integer divisionsU
- integer divisionsV
- Libraries.Game.Graphics.Texture
Return
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
- number width
- number height
- number depth
- integer divisionsU
- integer divisionsV
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributesMask
Return
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
- number width
- number height
- number depth
- integer divisionsU
- integer divisionsV
- Libraries.Game.Graphics.Material
- integer attributesMask
Return
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
- number width
- number height
- number depth
- integer divisionsU
- integer divisionsV
- Libraries.Game.Graphics.Color
Return
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 degrees.
Parameters
- number width
- number height
- number depth
- integer divisionsU
- integer divisionsV
- Libraries.Game.Graphics.Material
- integer attributesMask
- number angleUFrom
- number angleUTo
- number angleVFrom
- number angleVTo
Return
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 model.
Parameters
- number width
- number height
- number depth
- integer divisionsU
- integer divisionsV
- integer primitiveType
- Libraries.Game.Graphics.Material
- integer attributesMask
- number angleUFrom
- number angleUTo
- number angleVFrom
- number angleVTo
Return
End()
The End action stops building the current ModelBlueprint, returning the ModelBlueprint.
Return
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
Example
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
On this page
Variables TableAction Documentation- AddNode()
- AddPart(text id, integer primitiveType, Libraries.Game.Graphics.VertexAttributes attributes, Libraries.Game.Graphics.Material material)
- AddPart(text id, integer primitiveType, integer attributes, Libraries.Game.Graphics.Material material)
- AddPart(text id, Libraries.Game.Graphics.Mesh mesh, integer primitiveType, integer offset, integer size, Libraries.Game.Graphics.Material material)
- AddPart(text id, Libraries.Game.Graphics.Mesh mesh, integer primitiveType, Libraries.Game.Graphics.Material material)
- AddPart(Libraries.Game.Graphics.ModelData.MeshPart meshPart, Libraries.Game.Graphics.Material material)
- Begin()
- Compare(Libraries.Language.Object object)
- CreateAttributes(integer mask)
- CreateBox(number width, number height, number depth, Libraries.Game.Graphics.Color color)
- CreateBox(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)
- CreateBox(number width, number height, number depth, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributes)
- CreateBox(number width, number height, number depth, Libraries.Game.Graphics.Material material, integer attributesMask)
- CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Color color)
- CreateCylinder(number width, number height, number depth, integer divisions, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask)
- CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Material material, integer attributesMask, number angleFrom, number angleTo)
- CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Material material, integer attributesMask)
- CreateCylinder(number width, number height, number depth, integer divisions, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask, number angleFrom, number angleTo)
- CreateCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Texture texture)
- CreatePlane(number width, number depth, Libraries.Game.Graphics.Material material, integer attributesMask, boolean doubleSided)
- CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color)
- CreatePlane(number width, number depth, Libraries.Game.Graphics.Texture texture, boolean doubleSided)
- CreatePlane(number width, number depth, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributes, boolean doubleSided)
- CreatePlane(number width, number depth, Libraries.Game.Graphics.Color color, boolean doubleSided)
- CreatePlane(number width, number depth, Libraries.Game.Graphics.Texture texture)
- CreatePlane(number width, number depth, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributes)
- CreatePlane(number width, number depth, Libraries.Game.Graphics.Material material, integer attributesMask)
- CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Texture texture)
- CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, integer primitiveType, Libraries.Game.Graphics.Material material, integer attributesMask)
- CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Material material, integer attributesMask)
- CreateSphere(number width, number height, number depth, integer divisionsU, integer divisionsV, Libraries.Game.Graphics.Color color)
- 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)
- 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)
- End()
- Equals(Libraries.Language.Object object)
- GetHashCode()