mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 07:36:36 +02:00
add getUnscaledMeshExtents to FBXGeometry
This commit is contained in:
parent
3d066de169
commit
df0dc3bdd7
2 changed files with 16 additions and 0 deletions
|
@ -80,6 +80,19 @@ bool FBXGeometry::hasBlendedMeshes() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Extents FBXGeometry::getUnscaledMeshExtents() const {
|
||||||
|
const Extents& extents = meshExtents;
|
||||||
|
|
||||||
|
// even though our caller asked for "unscaled" we need to include any fst scaling, translation, and rotation, which
|
||||||
|
// is captured in the offset matrix
|
||||||
|
glm::vec3 minimum = glm::vec3(offset * glm::vec4(extents.minimum, 1.0f));
|
||||||
|
glm::vec3 maximum = glm::vec3(offset * glm::vec4(extents.maximum, 1.0f));
|
||||||
|
Extents scaledExtents = { minimum, maximum };
|
||||||
|
|
||||||
|
return scaledExtents;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int fbxGeometryMetaTypeId = qRegisterMetaType<FBXGeometry>();
|
static int fbxGeometryMetaTypeId = qRegisterMetaType<FBXGeometry>();
|
||||||
static int fbxAnimationFrameMetaTypeId = qRegisterMetaType<FBXAnimationFrame>();
|
static int fbxAnimationFrameMetaTypeId = qRegisterMetaType<FBXAnimationFrame>();
|
||||||
static int fbxAnimationFrameVectorMetaTypeId = qRegisterMetaType<QVector<FBXAnimationFrame> >();
|
static int fbxAnimationFrameVectorMetaTypeId = qRegisterMetaType<QVector<FBXAnimationFrame> >();
|
||||||
|
|
|
@ -234,6 +234,9 @@ public:
|
||||||
QStringList getJointNames() const;
|
QStringList getJointNames() const;
|
||||||
|
|
||||||
bool hasBlendedMeshes() const;
|
bool hasBlendedMeshes() const;
|
||||||
|
|
||||||
|
/// Returns the unscaled extents of the model's mesh
|
||||||
|
Extents getUnscaledMeshExtents() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(FBXGeometry)
|
Q_DECLARE_METATYPE(FBXGeometry)
|
||||||
|
|
Loading…
Reference in a new issue