Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Model Class Reference

Functions to manipulate and retrieve information about 3D models. More...

Public Member Functions

integer GetVertexCount (integer model)
 Returns how many vertices are in the model.
integer GetAnimationCount (integer model)
 Returns how many animations exist in the model.
string GetAnimationName (integer model, integer animation)
 Gets the name of the model animation with the specified index.
integer GetAnimationIndex (integer model, string animationName)
 Gets the index of the model animation with the specified name.
integer GetFrameCount (integer model)
 Returns how many frames exist in the model.
integer GetAnimationLength (integer model, integer animation)
 Returns the length of the animation.
boolean HasMaterials (integer model)
 Checks to see if the model has materials.
boolean HasBones (integer model)
 Checks to see if the model has bones.
integer GetMaterialCount (integer model)
 Returns the amount of materials in the model.
Material GetMaterial (integer model, string material)
 Gets a material from a model.
Material GetMaterial (integer model, integer material)
 Gets a material from a model.
integer CreateArmature (integer model)
 Creates an armature from the model.
void PoseArmature (integer model, integer armature, integer animation, decimal frame)
 Poses an armature.
void ResetArmature (integer model, integer armature)
 Resets an armature to its default pose.
void DeleteArmature (integer model, integer armature)
 Deletes an armature from the model.

Detailed Description

Functions to manipulate and retrieve information about 3D models.

Member Function Documentation

◆ CreateArmature()

integer Model.CreateArmature ( integer model)

Creates an armature from the model.

Parameters
modelThe model index.
Returns
Returns the index of the armature.

◆ DeleteArmature()

void Model.DeleteArmature ( integer model,
integer armature )

Deletes an armature from the model.

Parameters
modelThe model index.
armatureThe armature index to delete.

◆ GetAnimationCount()

integer Model.GetAnimationCount ( integer model)

Returns how many animations exist in the model.

Parameters
modelThe model index to check.
Returns
Returns an integer value.

◆ GetAnimationIndex()

integer Model.GetAnimationIndex ( integer model,
string animationName )

Gets the index of the model animation with the specified name.

Parameters
modelThe model index to check.
animationNameName of the animation to find.
Returns
Returns the animation index, or -1 if the animation could not be found. Will always return -1 if the model contains no animations.

◆ GetAnimationLength()

integer Model.GetAnimationLength ( integer model,
integer animation )

Returns the length of the animation.

Parameters
modelThe model index to check.
animationThe animation index to check.
Returns
The number of keyframes in the animation.

◆ GetAnimationName()

string Model.GetAnimationName ( integer model,
integer animation )

Gets the name of the model animation with the specified index.

Parameters
modelThe model index to check.
animationIndex of the animation.
Returns
Returns the animation name, or null if the model contains no animations.

◆ GetFrameCount()

integer Model.GetFrameCount ( integer model)

Returns how many frames exist in the model.

Parameters
modelThe model index to check.
Returns
Returns an integer value.
Deprecated
Use Model.GetAnimationLength instead.

◆ GetMaterial() [1/2]

Material Model.GetMaterial ( integer model,
integer material )

Gets a material from a model.

Parameters
modelThe model index to check.
materialThe material to get, from its index.
Returns
Returns a Material, or null if the model has no materials.

◆ GetMaterial() [2/2]

Material Model.GetMaterial ( integer model,
string material )

Gets a material from a model.

Parameters
modelThe model index to check.
materialThe material to get, from its name.
Returns
Returns a Material, or null if the model has no materials.

◆ GetMaterialCount()

integer Model.GetMaterialCount ( integer model)

Returns the amount of materials in the model.

Parameters
modelThe model index to check.
Returns
Returns an integer value.

◆ GetVertexCount()

integer Model.GetVertexCount ( integer model)

Returns how many vertices are in the model.

Parameters
modelThe model index to check.
Returns
The vertex count.

◆ HasBones()

boolean Model.HasBones ( integer model)

Checks to see if the model has bones.

Parameters
modelThe model index to check.
Returns
Returns whether the model has bones.

◆ HasMaterials()

boolean Model.HasMaterials ( integer model)

Checks to see if the model has materials.

Parameters
modelThe model index to check.
Returns
Returns whether the model has materials.
Deprecated
Use Model.GetMaterialCount instead.

◆ PoseArmature()

void Model.PoseArmature ( integer model,
integer armature,
integer animation,
decimal frame )

Poses an armature.

Parameters
modelThe model index.
armatureThe armature index to pose.
animationAnimation to pose the armature.
frameFrame to pose the armature.

◆ ResetArmature()

void Model.ResetArmature ( integer model,
integer armature )

Resets an armature to its default pose.

Parameters
modelThe model index.
armatureThe armature index to reset.