Skip to content

Commit

Permalink
Move constructor implementation to source file and add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mentholyspirit committed Jun 29, 2024
1 parent 8f617eb commit 58fb7f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 8 additions & 5 deletions libs/gltfio/include/gltfio/Animator.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ class UTILS_PUBLIC Animator {
// For internal use only.
void addInstance(FFilamentInstance* instance);

/** Creates an Animator that will use the corresponding asset and instance,
* can be used to animate an instance with animation from another asset.
* When used, the caller is responsible for deleting it.
* The normal way of getting an Animator is to call FilamentInstance::getAnimator().
*/
Animator(FilamentAsset *asset, FilamentInstance *instance);
~Animator();

private:

/*! \cond PRIVATE */
Expand All @@ -112,11 +120,6 @@ class UTILS_PUBLIC Animator {
Animator& operator=(const Animator&) = delete;

AnimatorImpl* mImpl;
public:
Animator(FilamentAsset *asset, FilamentInstance *instance) : Animator(reinterpret_cast<FFilamentAsset*>(asset), reinterpret_cast<FFilamentInstance*>(instance))
{
}
~Animator();
};

} // namespace filament::gltfio
Expand Down
3 changes: 3 additions & 0 deletions libs/gltfio/src/Animator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ void Animator::addInstance(FFilamentInstance* instance) {
}
}

Animator::Animator(FilamentAsset *asset, FilamentInstance *instance) : Animator(reinterpret_cast<FFilamentAsset*>(asset), reinterpret_cast<FFilamentInstance*>(instance)) {
}

Animator::~Animator() {
delete mImpl;
}
Expand Down

0 comments on commit 58fb7f2

Please sign in to comment.