You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently preparing to import the FBX file into the bullet, and the entity model has been imported. How should I import the animation information.
btTriangleMesh* mesh = new btTriangleMesh();
int numIndices = fbxMesh->GetPolygonVertexCount();
int* indices = fbxMesh->GetPolygonVertices();
for (int k = 0; k < numIndices; k += 3) {
mesh->addTriangleIndices(indices[k], indices[k + 1], indices[k + 2]);
}
FbxTime mFrameTime;
std::vector<std::vector<FbxAMatrix>> frame_bones_matrix_vec_;
mFrameTime.SetTime(0, 0, 0, 1, 0, scene->GetGlobalSettings().GetTimeMode());
for (FbxTime pTime = mStart; pTime < mStop; pTime += mFrameTime) {
FbxAMatrix lGlobalPosition = pNode->EvaluateGlobalTransform(pTime);
FbxAMatrix lGlobalOffPosition = lGlobalPosition * lGeometryOffset;
std::vector<FbxAMatrix> one_frame_bone_matrix_vec;
for (int lClusterIndex = 0; lClusterIndex < lClusterCount; ++lClusterIndex) {
FbxCluster *lCluster = lSkinDeformer->GetCluster(lClusterIndex);
FbxAMatrix lVertexTransformMatrix;
ComputeClusterDeformation(lGlobalOffPosition, pMesh, lCluster, lVertexTransformMatrix, pTime);
one_frame_bone_matrix_vec.push_back(lVertexTransformMatrix);
}
frame_bones_matrix_vec_.push_back(one_frame_bone_matrix_vec);
}
The transformation matrix of each frame in each cluster is stored. How can I use these matrices to calculate the mesh, because there is only one mesh, do I need to divide one mesh into multiple submashes and calculate them separately?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The transformation matrix of each frame in each cluster is stored. How can I use these matrices to calculate the mesh, because there is only one mesh, do I need to divide one mesh into multiple submashes and calculate them separately?
Beta Was this translation helpful? Give feedback.
All reactions