expose joint inverse bind matrices via method on FilamentInstance (#6388)
* expose joint inverse bind matrices via method on FilamentInstance * change const pointer refs, add asserts and update release notes Co-authored-by: Mathias Agopian <mathias@google.com>
This commit is contained in:
@@ -16,6 +16,7 @@ A new header is inserted each time a *tag* is created.
|
||||
- materials: `getNormalizedViewportCoord()` now returns the logical (i.e. user) viewport
|
||||
normalized position and keeps z reversed [⚠️ **Recompile Materials**]
|
||||
- backend: workaround Adreno shader compiler bug (#6355) [⚠️ **Recompile Materials**]
|
||||
- gltfio: expose joint inverse bind matrices via method on FilamentInstance
|
||||
- geometry: change computing tangent basis from normal vector to use Frisvad's method
|
||||
- filamesh: add error when uv coords size does not match num of vertices. (#6351)
|
||||
|
||||
|
||||
@@ -126,6 +126,13 @@ public:
|
||||
*/
|
||||
void detachSkin(size_t skinIndex, utils::Entity target) noexcept;
|
||||
|
||||
/**
|
||||
* Gets inverse bind matrices for all joints at the given skin index.
|
||||
*
|
||||
* See getJointCountAt for determining the number of matrices returned (i.e. the number of joints).
|
||||
*/
|
||||
math::mat4f const* getInverseBindMatricesAt(size_t skinIndex) const;
|
||||
|
||||
/**
|
||||
* Resets the AABB on all renderables by manually computing the bounding box.
|
||||
*
|
||||
|
||||
@@ -117,6 +117,8 @@ struct FFilamentInstance : public FilamentInstance {
|
||||
const utils::Entity* getJointsAt(size_t skinIndex) const noexcept;
|
||||
void attachSkin(size_t skinIndex, utils::Entity target) noexcept;
|
||||
void detachSkin(size_t skinIndex, utils::Entity target) noexcept;
|
||||
math::mat4f const* getInverseBindMatricesAt(size_t skinIndex) const;
|
||||
|
||||
void recomputeBoundingBoxes();
|
||||
};
|
||||
|
||||
|
||||
@@ -90,6 +90,12 @@ void FFilamentInstance::detachSkin(size_t skinIndex, Entity target) noexcept {
|
||||
mSkins[skinIndex].targets.erase(target);
|
||||
}
|
||||
|
||||
mat4f const* FFilamentInstance::getInverseBindMatricesAt(size_t skinIndex) const {
|
||||
assert_invariant(mOwner);
|
||||
ASSERT_PRECONDITION(skinIndex < mOwner->mSkins.size(), "skinIndex must be less than the number of skins in this instance.");
|
||||
return mOwner->mSkins[skinIndex].inverseBindMatrices.data();
|
||||
}
|
||||
|
||||
void FFilamentInstance::recomputeBoundingBoxes() {
|
||||
ASSERT_PRECONDITION(mOwner->mSourceAsset,
|
||||
"Do not call releaseSourceData before recomputeBoundingBoxes");
|
||||
@@ -415,6 +421,10 @@ void FilamentInstance::detachSkin(size_t skinIndex, Entity target) noexcept {
|
||||
return downcast(this)->detachSkin(skinIndex, target);
|
||||
}
|
||||
|
||||
math::mat4f const* FilamentInstance::getInverseBindMatricesAt(size_t skinIndex) const {
|
||||
return downcast(this)->getInverseBindMatricesAt(skinIndex);
|
||||
}
|
||||
|
||||
void FilamentInstance::recomputeBoundingBoxes() {
|
||||
return downcast(this)->recomputeBoundingBoxes();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user