summaryrefslogtreecommitdiff
path: root/thirdparty/assimp/code/Common/SceneCombiner.cpp
diff options
context:
space:
mode:
authorRevoluPowered <gordon@gordonite.tech>2019-11-05 17:06:06 +0000
committerRevoluPowered <gordon@gordonite.tech>2019-11-05 20:38:26 +0000
commit5fb160c7c692c469488f11aca90a36ac3248dfee (patch)
treed1eba0971b63f8f8e39e6f2752fc8d9944960318 /thirdparty/assimp/code/Common/SceneCombiner.cpp
parent0bd877780fb7b344b5ed1d2fa7765078616f069b (diff)
Updated assimp to 308db73 from https://github.com/assimp/assimp/
Diffstat (limited to 'thirdparty/assimp/code/Common/SceneCombiner.cpp')
-rw-r--r--thirdparty/assimp/code/Common/SceneCombiner.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/thirdparty/assimp/code/Common/SceneCombiner.cpp b/thirdparty/assimp/code/Common/SceneCombiner.cpp
index 4e6bc5b475..f7b13cc951 100644
--- a/thirdparty/assimp/code/Common/SceneCombiner.cpp
+++ b/thirdparty/assimp/code/Common/SceneCombiner.cpp
@@ -1196,6 +1196,7 @@ void SceneCombiner::Copy( aiAnimation** _dest, const aiAnimation* src ) {
// and reallocate all arrays
CopyPtrArray( dest->mChannels, src->mChannels, dest->mNumChannels );
+ CopyPtrArray( dest->mMorphMeshChannels, src->mMorphMeshChannels, dest->mNumMorphMeshChannels );
}
// ------------------------------------------------------------------------------------------------
@@ -1215,6 +1216,26 @@ void SceneCombiner::Copy(aiNodeAnim** _dest, const aiNodeAnim* src) {
GetArrayCopy( dest->mRotationKeys, dest->mNumRotationKeys );
}
+void SceneCombiner::Copy(aiMeshMorphAnim** _dest, const aiMeshMorphAnim* src) {
+ if ( nullptr == _dest || nullptr == src ) {
+ return;
+ }
+
+ aiMeshMorphAnim* dest = *_dest = new aiMeshMorphAnim();
+
+ // get a flat copy
+ ::memcpy(dest,src,sizeof(aiMeshMorphAnim));
+
+ // and reallocate all arrays
+ GetArrayCopy( dest->mKeys, dest->mNumKeys );
+ for (ai_uint i = 0; i < dest->mNumKeys;++i) {
+ dest->mKeys[i].mValues = new unsigned int[dest->mKeys[i].mNumValuesAndWeights];
+ dest->mKeys[i].mWeights = new double[dest->mKeys[i].mNumValuesAndWeights];
+ ::memcpy(dest->mKeys[i].mValues, src->mKeys[i].mValues, dest->mKeys[i].mNumValuesAndWeights * sizeof(unsigned int));
+ ::memcpy(dest->mKeys[i].mWeights, src->mKeys[i].mWeights, dest->mKeys[i].mNumValuesAndWeights * sizeof(double));
+ }
+}
+
// ------------------------------------------------------------------------------------------------
void SceneCombiner::Copy( aiCamera** _dest,const aiCamera* src) {
if ( nullptr == _dest || nullptr == src ) {