ModelData
EditA ModelData is a container object that loads and holds data contained in 3D model files. This can include a variety of things like the node structure of the asset, the vertex data it contains, contains, the Image
and Material
properties, and any included animations.
The current supported formats are OBJ, glTF, and STL.
Usually you can just load a Model
directly, but using a ModelData
can be helpful if you want to load models in a thread or access more low-level information about the Model.
Constructor
lovr.data.newModelData | Create a new ModelData. |
Methods
ModelData:getAnimationChannelCount | Get the number of channels in an animation. |
ModelData:getAnimationCount | Get the number of animations in the model. |
ModelData:getAnimationDuration | Get the duration of an animation. |
ModelData:getAnimationKeyframe | Get a keyframe in a channel of an animation. |
ModelData:getAnimationKeyframeCount | Get the number of keyframes in a channel of an animation. |
ModelData:getAnimationName | Get the name of an animation. |
ModelData:getAnimationNode | Get the node targeted by the channel of an animation. |
ModelData:getAnimationProperty | Get the property targeted by the channel of an animation. |
ModelData:getAnimationSmoothMode | Get the smooth mode of a channel in an animation. |
ModelData:getBlendShapeCount | Get the number of blend shapes in the model. |
ModelData:getBlendShapeName | Get the name of a blend shape in the model. |
ModelData:getBlob | Get a Blob in the model. |
ModelData:getBlobCount | Get the number of Blobs stored in the model. |
ModelData:getBoundingBox | Get the bounding box of the model. |
ModelData:getBoundingSphere | Get the bounding sphere of the model. |
ModelData:getCenter | Get the center of the model's bounding box. |
ModelData:getDepth | Get the depth of the model. |
ModelData:getDimensions | Get the dimensions of the model. |
ModelData:getHeight | Get the height of the model. |
ModelData:getImage | Get an Image in the model. |
ModelData:getImageCount | Get the number of Images stored in the model. |
ModelData:getMaterial | Get the material properties for a material in the model. |
ModelData:getMaterialCount | Get the number of materials in the model. |
ModelData:getMaterialName | Get the name of a material in the model. |
ModelData:getMeshCount | Get the number of meshes in the model. |
ModelData:getMeshDrawMode | Get the draw mode of a mesh. |
ModelData:getMeshIndex | Get one of the vertex indices in a mesh. |
ModelData:getMeshIndexCount | Get the number of vertex indices in a mesh. |
ModelData:getMeshIndexFormat | Get the data format of vertex indices in a mesh. |
ModelData:getMeshMaterial | Get the index of the material applied to a mesh. |
ModelData:getMeshVertex | Get the data for a single vertex in a mesh. |
ModelData:getMeshVertexCount | Get the number of vertices in a mesh. |
ModelData:getMeshVertexFormat | Get the vertex format of a mesh. |
ModelData:getMetadata | Get extra information from the model file. |
ModelData:getNodeChildren | Get the children of a node. |
ModelData:getNodeCount | Get the number of nodes in the model. |
ModelData:getNodeMeshes | Get the indices of meshes attached to a node. |
ModelData:getNodeName | Get the name of a node. |
ModelData:getNodeOrientation | Get the local orientation of a node. |
ModelData:getNodeParent | Get the parent of a node. |
ModelData:getNodePose | Get the local pose of a node. |
ModelData:getNodePosition | Get the local position of a node. |
ModelData:getNodeScale | Get the local scale of a node. |
ModelData:getNodeSkin | Get the index of the skin used by a node. |
ModelData:getNodeTransform | Get the local transform of a node. |
ModelData:getRootNode | Get the index of the root node. |
ModelData:getSkinCount | Get the number of skins in the model. |
ModelData:getSkinInverseBindMatrix | Get the inverse bind matrix for a joint in the skin. |
ModelData:getSkinJoints | Get the joints in a skin. |
ModelData:getTriangleCount | Get the total number of triangles in the model. |
ModelData:getTriangles | Get all the triangles in the model. |
ModelData:getVertexCount | Get the total vertex count of the model. |
ModelData:getWidth | Get the width of the model. |