Overte C++ Documentation
Model Class Reference

A generic 3D model displaying geometry loaded from a URL. More...

#include <Model.h>

Inherits QObject, std::enable_shared_from_this< Model >, and scriptable::ModelProvider.

Inherited by CauterizedModel.

Collaboration diagram for Model:

Public Member Functions

virtual Q_INVOKABLE void setURL (const QUrl &url)
 Sets the URL of the model to render.
 
const Geometry::Pointer & getGeometry () const
 Returns a reference to the shared geometry.
 
const HFMModelgetHFMModel () const
 Provided as a convenience, will crash if !isLoaded()
 
void setJointState (int index, bool valid, const glm::quat &rotation, const glm::vec3 &translation, float priority)
 Sets the joint state at the specified index.
 
void setSnapModelToCenter (bool snapModelToCenter)
 is scale to fit enabled
 
int getJointStateCount () const
 Returns the number of joint states in the model.
 
bool getJointRotation (int jointIndex, glm::quat &rotation) const
 
int getParentJointIndex (int jointIndex) const
 Returns the index of the parent of the indexed joint, or -1 if not found.
 
Extents getBindExtents () const
 Returns the extents of the model in its bind pose.
 
Extents getMeshExtents () const
 Returns the extents of the model's mesh.
 
Extents getUnscaledMeshExtents () const
 Returns the unscaled extents of the model's mesh.
 
bool getIsScaledToFit () const
 enables/disables scale to fit behavior, the model will be automatically scaled to the specified largest dimension
 
glm::vec3 getScaleToFitDimensions () const
 is model scaled to fit
 
int getBlendshapeCoefficientsNum () const
 the dimensions model is scaled to, including inferred y/z
 

Protected Member Functions

void clearJointState (int index)
 Clear the joint states.
 
bool getJointPosition (int jointIndex, glm::vec3 &position) const
 
void invalidCalculatedMeshBoxes ()
 Allow sub classes to force invalidating the bboxes.
 

Protected Attributes

glm::vec3 _scaleToFitDimensions
 If you set scaleToFit, we will calculate scale based on MeshExtents.
 
bool _scaledToFit
 this is the dimensions that scale to fit will use
 
bool _snapModelToRegistrationPoint
 have we scaled to fit
 
bool _snappedToRegistrationPoint
 is the model's offset automatically adjusted to a registration point in model space
 
glm::vec3 _registrationPoint { glm::vec3(0.5f) }
 are we currently snapped to a registration point
 
bool _forceOffset { false }
 the point in model space our center is snapped to
 

Detailed Description

A generic 3D model displaying geometry loaded from a URL.

Member Function Documentation

◆ getJointPosition()

bool Model::getJointPosition ( int  jointIndex,
glm::vec3 &  position 
) const
protected
Parameters
jointIndexindex of joint in model structure
position[out]position of joint in model-frame
Returns
true if joint exists

◆ getJointRotation()

bool Model::getJointRotation ( int  jointIndex,
glm::quat &  rotation 
) const
Parameters
jointIndexindex of joint in model structure
rotation[out]rotation of joint in model-frame
Returns
true if joint exists

The documentation for this class was generated from the following files: