I use the following code to get a hkaRagdollInstance pointer:
hkRootLevelContainer* container= static_cast<hkRootLevelContainer*>(hkNativePackfileUtils::loadInPlace(data,szData));
hkaRagdollInstance *corereinterpret_cast<hkaRagdollInstance*>( container->findObjectByType( hkaRagdollInstanceClass.getName() ));
hkaRagdollInstance *p=core->clone();//crashes here!!
(data/szData contains a hkx file's raw data,which in binary package format.)
Both the core and container pointer are valid,and their contents seem correct.and I can access them without crashing.
But when I call the clone function,it crashes. Also the following codes will lead a crash too:
const hkArray<hkpConstraintInstance*>& constraints =core->getConstraintArray();
hkpInertiaTensorComputer::optimizeInertiasOfConstraintTree( constraints.begin(), constraints.getSize(),core->getRigidBodyOfBone(0) );
So I switch to another method to load the file,I dump a xml/tag hkx file and using the following codes to read it
hkSerializeUtil::ErrorDetails ed;
hkResource *res=hkSerializeUtil::load(data.data,data.szData,&ed);
To my surprise, it fails and reports the following error:
+ m_stringAndFlag 0x07bb5cb1 "nable to version data of class hkpSetupStabilizationAtom, version 0x00000001
Patching to latest version failed. Have you registered the necessary patches? e.g. hkFeature_serializeRegisterKeycodePatches() See the hkError output for more details
Seems that I am loading from an old format file.But the version of the content tool and sdk are both 2011.3.1,do this 2 version acturally match?
The attachment are the files(binary and tag) I am loading.
Can some one see this problem for me? Thanks.



