|
|
@ -88,18 +88,13 @@ osg::ref_ptr<Resource::BulletShape> BulletNifLoader::load(const Nif::NIFFilePtr&
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool autogenerated = hasAutoGeneratedCollision(node);
|
|
|
|
bool autogenerated = hasAutoGeneratedCollision(node);
|
|
|
|
bool isAnimated = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// files with the name convention xmodel.nif usually have keyframes stored in a separate file xmodel.kf (see Animation::addAnimSource).
|
|
|
|
// files with the name convention xmodel.nif usually have keyframes stored in a separate file xmodel.kf (see Animation::addAnimSource).
|
|
|
|
// assume all nodes in the file will be animated
|
|
|
|
// assume all nodes in the file will be animated
|
|
|
|
std::string filename = nif->getFilename();
|
|
|
|
std::string filename = nif->getFilename();
|
|
|
|
size_t slashpos = filename.find_last_of("/\\");
|
|
|
|
const std::size_t slashpos = filename.find_last_of("/\\");
|
|
|
|
if (slashpos == std::string::npos)
|
|
|
|
const std::size_t letterPos = slashpos == std::string::npos ? 0 : slashpos + 1;
|
|
|
|
slashpos = 0;
|
|
|
|
const bool isAnimated = letterPos < filename.size() && (filename[letterPos] == 'x' || filename[letterPos] == 'X');
|
|
|
|
if (slashpos+1 < filename.size() && (filename[slashpos+1] == 'x' || filename[slashpos+1] == 'X'))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
isAnimated = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleNode(node, 0, autogenerated, isAnimated, autogenerated);
|
|
|
|
handleNode(node, 0, autogenerated, isAnimated, autogenerated);
|
|
|
|
|
|
|
|
|
|
|
|