10#define ERRORTIME -2321.51
42 std::vector<std::shared_ptr<ModelObject>>
child;
43 std::vector<std::shared_ptr<ModelObject>>
parent;
119 if (it->name == name)
130 if (it->name == name)
143 if (it->name == name)
155 if (it->name == name)
169 std::cout <<
"********************" << it->name <<
"\n";
171 if (select == -1)
continue;
173 Mat4f inverseMatrix = it->localTransform.inverse();
174 for (
size_t i = 0; i < it->parent.size(); i++)
176 auto parent = it->parent[i];
177 inverseMatrix *= parent->localTransform.inverse();
178 std::cout << parent->name <<
"\n";
189 for (
size_t i = 0; i <
mBones.size(); i++)
192 if (select == -1)
continue;
194 auto iterR =
mBones[select];
213 if (select == -1)
continue;
215 Mat4f worldMatrix = it->localTransform;
216 for (
size_t i = 0; i < it->parent.size(); i++){
217 auto parent = it->parent[i];
218 worldMatrix *= parent->localTransform;
229 if (!
bool(data.size()))
233 if (idx >= data.size() - 1) {
234 return data[data.size() - 1];
237 if (data[idx] != data[idx + 1]) {
238 float weight = (time - timeCode[idx]) / (timeCode[idx + 1] - timeCode[idx]);
239 return lerp(data[idx], data[idx + 1], weight);
251 int right = arr.size() - 1;
259 if (arr[arr.size() - 1] < v)
260 return arr.size() - 1;
263 while (left <= right) {
264 int mid = left + (right - left) / 2;
281 std::vector<std::shared_ptr<MeshInfo>>
mMeshs;
282 std::vector<std::shared_ptr<Bone>>
mBones;;
296 return v0 + (v1 - v0) * weight;
Implementation of quaternion.
Real lerp(Real v0, Real v1, float weight)
void updateInverseBindMatrix()
std::vector< std::shared_ptr< MeshInfo > > mMeshs
int findMeshIndexByName(std::string name)
std::vector< Mat4f > mBoneWorldMatrix
std::shared_ptr< ModelObject > getObjectByName(std::string name)
std::vector< Mat4f > mBoneInverseBindMatrix
std::vector< std::shared_ptr< Bone > > mBones
int getObjIndexByName(std::string name)
void updateFrameWorldTransform(Real time)
std::vector< Vec3f > mBoneScales
std::vector< Vec3f > mBoneRotations
int findMaxSmallerIndex(const std::vector< float > &arr, float v)
Real getVectorDataByTime(std::vector< Real > data, std::vector< Real > timeCode, Real time)
std::vector< std::shared_ptr< ModelObject > > mModelObjects
int getBoneIndexByName(std::string name)
std::vector< Vec3f > mBoneTranslations
std::vector< Vec3f > normals
std::vector< Vec4f > boneIndices0
std::vector< Vec3f > vertices
std::vector< CArrayList< uint > > facegroup_polygons
std::map< int, std::vector< int > > pointId_verticeId
std::vector< Vec4f > boneIndices2
std::vector< Vec2f > texcoords
std::vector< Vec4f > boneWeights2
std::vector< std::vector< TopologyModule::Triangle > > facegroup_triangles
std::vector< Vec4f > boneWeights0
std::vector< Vec4f > boneWeights1
std::vector< std::shared_ptr< Material > > materials
std::vector< int > verticeId_pointId
std::vector< Vec4f > boneIndices1
std::vector< Vec3f > verticesColor
std::vector< Transform3f > boundingTransform
std::vector< TAlignedBox3D< Real > > boundingBox
bool operator==(const ModelObject &model)
std::vector< std::shared_ptr< ModelObject > > parent
std::vector< Real > m_Rotation_Times[3]
std::vector< std::shared_ptr< ModelObject > > child
std::vector< Real > m_Translation_Values[3]
std::vector< Real > m_Rotation_Values[3]
std::vector< Real > m_Translation_Times[3]
Vec3f getFrameRotation(Real time)
Vec3f getFrameScale(Real time)
std::vector< Real > m_Scale_Times[3]
Vec3f getFrameTranslation(Real time)
std::vector< Real > m_Scale_Values[3]
This is an implementation of AdditiveCCD based on peridyno.
SquareMatrix< float, 4 > Mat4f