From: <de...@us...> - 2003-12-21 10:21:06
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv27805 Modified Files: ObjectModel.cpp Log Message: no message Index: ObjectModel.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectModel.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ObjectModel.cpp 20 Oct 2003 00:23:23 -0000 1.23 --- ObjectModel.cpp 21 Dec 2003 10:21:03 -0000 1.24 *************** *** 35,38 **** --- 35,39 ---- #include <osgDB/Registry> #include <osgDB/ReadFile> + #include <osgFX/SpecularHighlights> #include <osgUtil/SmoothingVisitor> #include <osgUtil/DisplayListVisitor> *************** *** 179,183 **** m_PolygonOffset = 0.0; m_CullFace = -1; - m_MarkersVisible = true; } --- 180,183 ---- *************** *** 387,390 **** --- 387,392 ---- m_ContactMarkers->addChild(diamond); } + // set markers visible by default + m_ContactMarkers->setNodeMask(0x1); m_DebugMarkers->addChild(m_ContactMarkers.get()); } *************** *** 547,554 **** void ObjectModel::showContactMarkers(bool on) { if (on) ! m_DebugMarkers->setAllChildrenOn(); else ! m_DebugMarkers->setAllChildrenOff(); ! m_MarkersVisible = on; } --- 549,555 ---- void ObjectModel::showContactMarkers(bool on) { if (on) ! m_ContactMarkers->setNodeMask(0x1); else ! m_ContactMarkers->setNodeMask(0x0); } *************** *** 562,566 **** bool ObjectModel::getMarkersVisible() const { ! return m_MarkersVisible; } --- 563,567 ---- bool ObjectModel::getMarkersVisible() const { ! return (m_ContactMarkers->getNodeMask() != 0x0); } *************** *** 604,607 **** --- 605,617 ---- }; + + osg::Node *addEffect(osg::Node *model_node) { + // add an osgFX effect + osgFX::SpecularHighlights* effect = new osgFX::SpecularHighlights; + effect->setTextureUnit(1); + effect->addChild(model_node); + return effect; + } + SceneModel::SceneModel(simdata::Ref<ObjectModel> const & model) { m_Model = model; *************** *** 615,619 **** // create a working copy ModelCopy model_copy; ! model_node = model_copy(model_node); std::cout << "MODEL COPIED\n"; --- 625,630 ---- // create a working copy ModelCopy model_copy; ! //model_node = model_copy(model_node); ! model_node = model_copy(addEffect(model_node)); std::cout << "MODEL COPIED\n"; *************** *** 685,691 **** return true; else { ! size_t n = m_SmokeEmitterLocation.size(); ! if (n>0) { ! for (size_t i = 0; i <n; ++i) { fx::SmokeTrail *trail = new fx::SmokeTrail(); trail->setEnabled(false); --- 696,702 ---- return true; else { ! if (!m_SmokeEmitterLocation.empty()) { ! std::vector<simdata::Vector3>::const_iterator iEnd = m_SmokeEmitterLocation.end(); ! for (std::vector<simdata::Vector3>::iterator i = m_SmokeEmitterLocation.begin(); i != iEnd; ++i) { fx::SmokeTrail *trail = new fx::SmokeTrail(); trail->setEnabled(false); *************** *** 698,702 **** trail->addOperator(new fx::SmokeThinner); ! trail->setOffset(m_SmokeEmitterLocation[i]); m_SmokeTrails = new fx::SmokeTrailSystem; --- 709,713 ---- trail->addOperator(new fx::SmokeThinner); ! trail->setOffset(*i); m_SmokeTrails = new fx::SmokeTrailSystem; *************** *** 724,729 **** --- 735,742 ---- void SceneModel::enableSmoke() { + CSP_LOG(OBJECT, DEBUG, "SceneModel::enableSmoke()..."); if (!m_Smoke) { if (!addSmoke()) return; + CSP_LOG(OBJECT, DEBUG, "SceneModel::enableSmoke()"); m_SmokeTrails->setEnabled(true); m_Smoke = true; |