From a25758c3b1c3053d74631195500ab1f01d734223 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 31 Jul 2014 14:02:55 +0200 Subject: [PATCH] fixed visibility flags setting --- apps/opencs/view/render/object.cpp | 1 + components/nifogre/ogrenifloader.cpp | 18 ++++++++++++++++++ components/nifogre/ogrenifloader.hpp | 2 ++ 3 files changed, 21 insertions(+) diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index f72e9b0c0..359392d81 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -72,6 +72,7 @@ void CSVRender::Object::update() else { mObject = NifOgre::Loader::createObjects (mBase, "Meshes\\" + model); + mObject->setVisibilityFlags (Element_Reference); } } diff --git a/components/nifogre/ogrenifloader.cpp b/components/nifogre/ogrenifloader.cpp index 81b2e55d2..aee90d6e4 100644 --- a/components/nifogre/ogrenifloader.cpp +++ b/components/nifogre/ogrenifloader.cpp @@ -115,6 +115,24 @@ ObjectScene::~ObjectScene() mSkelBase = NULL; } +void ObjectScene::setVisibilityFlags (unsigned int flags) +{ + if (mSkelBase) + mSkelBase->setVisibilityFlags (flags); + + for (std::vector::iterator iter (mEntities.begin()); iter!=mEntities.end(); + ++iter) + (*iter)->setVisibilityFlags (flags); + + for (std::vector::iterator iter (mParticles.begin()); + iter!=mParticles.end(); ++iter) + (*iter)->setVisibilityFlags (flags); + + for (std::vector::iterator iter (mLights.begin()); iter!=mLights.end(); + ++iter) + (*iter)->setVisibilityFlags (flags); +} + void ObjectScene::rotateBillboardNodes(Ogre::Camera *camera) { for (std::vector::iterator it = mBillboardNodes.begin(); it != mBillboardNodes.end(); ++it) diff --git a/components/nifogre/ogrenifloader.hpp b/components/nifogre/ogrenifloader.hpp index badb6ccd3..f8438f114 100644 --- a/components/nifogre/ogrenifloader.hpp +++ b/components/nifogre/ogrenifloader.hpp @@ -82,6 +82,8 @@ struct ObjectScene { // Rotate nodes in mBillboardNodes so they face the given camera void rotateBillboardNodes(Ogre::Camera* camera); + + void setVisibilityFlags (unsigned int flags); }; typedef Ogre::SharedPtr ObjectScenePtr;