Merge pull request #3386 from ZappoMan/getUnscaledMeshExtents

add getUnscaledMeshExtents to FBXGeometry
This commit is contained in:
Philip Rosedale 2014-09-09 20:51:23 -07:00
commit 4294da20bc
2 changed files with 16 additions and 0 deletions

View file

@ -80,6 +80,19 @@ bool FBXGeometry::hasBlendedMeshes() const {
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 fbxAnimationFrameMetaTypeId = qRegisterMetaType<FBXAnimationFrame>();
static int fbxAnimationFrameVectorMetaTypeId = qRegisterMetaType<QVector<FBXAnimationFrame> >();

View file

@ -234,6 +234,9 @@ public:
QStringList getJointNames() const;
bool hasBlendedMeshes() const;
/// Returns the unscaled extents of the model's mesh
Extents getUnscaledMeshExtents() const;
};
Q_DECLARE_METATYPE(FBXGeometry)