From 07a9b7623a7b1e543c372a9908bef8b773b3e24c Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 31 Dec 2013 01:12:50 +0100 Subject: [PATCH] Enable skeleton-based bounding boxes added in Ogre 1.10 --- components/nifogre/ogrenifloader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/nifogre/ogrenifloader.cpp b/components/nifogre/ogrenifloader.cpp index 345e7d6fd..453eff236 100644 --- a/components/nifogre/ogrenifloader.cpp +++ b/components/nifogre/ogrenifloader.cpp @@ -607,6 +607,14 @@ class NIFObjectLoader NIFMeshLoader::createMesh(name, fullname, group, shape->recIndex); Ogre::Entity *entity = sceneMgr->createEntity(fullname); + +#if OGRE_VERSION >= (1 << 16 | 10 << 8 | 0) + // Enable skeleton-based bounding boxes. With the static bounding box, + // the animation may cause parts to go outside the box and cause culling problems. + if (entity->hasSkeleton()) + entity->setUpdateBoundingBoxFromSkeleton(true); +#endif + entity->setVisible(!(flags&Nif::NiNode::Flag_Hidden)); scene->mEntities.push_back(entity);