[Gcblue-commits] gcb_wx/src/graphics ObjectUpdater.cpp,1.5,1.6 cspSky.cpp,1.5,1.6 tc3DModel.cpp,1.4,
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@us...> - 2004-01-20 03:02:56
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv12457/src/graphics Modified Files: ObjectUpdater.cpp cspSky.cpp tc3DModel.cpp tcwindow.cpp Removed Files: tcrendersurface.cpp Log Message: Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ObjectUpdater.cpp 16 Jan 2004 00:04:14 -0000 1.5 --- ObjectUpdater.cpp 20 Jan 2004 03:02:53 -0000 1.6 *************** *** 99,104 **** // not correct for child objects ! Producer::Vec3 cp = viewer->GetCameraPosition(); ! osg::Vec3 cameraDelta = osg::Vec3(x,y,z) - osg::Vec3(cp.x(),cp.y(),cp.z()); distanceFromCamera = cameraDelta.length(); --- 99,103 ---- // not correct for child objects ! osg::Vec3 cameraDelta = osg::Vec3(x,y,z) - viewer->GetCameraPosition(); distanceFromCamera = cameraDelta.length(); Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cspSky.cpp 22 Dec 2003 02:32:37 -0000 1.5 --- cspSky.cpp 20 Jan 2004 03:02:53 -0000 1.6 *************** *** 502,506 **** ! Moon::Moon(): AstronomicalBody() { _radius = 1738000.0; m_Latitude = -100.0; --- 502,507 ---- ! Moon::Moon(): AstronomicalBody() ! { _radius = 1738000.0; m_Latitude = -100.0; *************** *** 527,558 **** // set up the drawstate. ! osg::StateSet* dstate = new osg::StateSet; ! dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); ! dstate->setMode(GL_LIGHTING,osg::StateAttribute::OFF); ! dstate->setTextureAttributeAndModes(0, m_Texture.get(),osg::StateAttribute::ON); ! dstate->setMode(GL_CLIP_PLANE0, osg::StateAttribute::OFF); ! dstate->setMode(GL_CLIP_PLANE1, osg::StateAttribute::OFF); ! dstate->setMode(GL_CLIP_PLANE2, osg::StateAttribute::OFF); ! dstate->setMode(GL_CLIP_PLANE3, osg::StateAttribute::OFF); ! dstate->setMode(GL_CLIP_PLANE4, osg::StateAttribute::OFF); ! dstate->setMode(GL_CLIP_PLANE5, osg::StateAttribute::OFF); ! dstate->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); osg::BlendFunc *bf = new osg::BlendFunc; bf->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA); ! dstate->setAttributeAndModes(bf, osg::StateAttribute::ON); ! osg::Depth *depth = new osg::Depth; ! ! depth->setFunction(osg::Depth::LEQUAL); ! depth->setRange(10.0, 1000000.0); ! dstate->setAttributeAndModes(depth, osg::StateAttribute::ON); ! /* depth->setFunction(osg::Depth::ALWAYS); depth->setRange(1.0, 1.0); ! dstate->setAttributeAndModes(depth, osg::StateAttribute::OFF); ! */ // set up the geoset. Geometry* geom = new Geometry; ! geom->setStateSet(dstate); Vec3Array* coords = new Vec3Array(4); --- 528,558 ---- // set up the drawstate. ! osg::StateSet* stateSet = new osg::StateSet; ! stateSet->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); ! stateSet->setMode(GL_LIGHTING,osg::StateAttribute::OFF); ! stateSet->setTextureAttributeAndModes(0, m_Texture.get(),osg::StateAttribute::ON); ! stateSet->setMode(GL_CLIP_PLANE0, osg::StateAttribute::OFF); ! stateSet->setMode(GL_CLIP_PLANE1, osg::StateAttribute::OFF); ! stateSet->setMode(GL_CLIP_PLANE2, osg::StateAttribute::OFF); ! stateSet->setMode(GL_CLIP_PLANE3, osg::StateAttribute::OFF); ! stateSet->setMode(GL_CLIP_PLANE4, osg::StateAttribute::OFF); ! stateSet->setMode(GL_CLIP_PLANE5, osg::StateAttribute::OFF); osg::BlendFunc *bf = new osg::BlendFunc; bf->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA); ! stateSet->setAttributeAndModes(bf, osg::StateAttribute::ON); ! ! stateSet->setRenderBinDetails(-2,"RenderBin"); ! ! osg::Depth *depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); depth->setRange(1.0, 1.0); ! depth->setWriteMask(false); ! stateSet->setAttributeAndModes(depth, osg::StateAttribute::OFF); ! ! // set up the geoset. Geometry* geom = new Geometry; ! geom->setStateSet(stateSet); Vec3Array* coords = new Vec3Array(4); *************** *** 579,595 **** m_Moon = geom; ! //dstate->setMode(GL_FOG, osg::StateAttribute::OFF); ! //dstate->setRenderBinDetails(-2,"RenderBin"); m_Transform = new osg::MatrixTransform; m_Billboard = new AstroBillboard; m_Billboard->setCullingActive(false); ! m_Billboard->setStateSet(dstate); m_Billboard->addDrawable(m_Moon.get()); m_Billboard->setAxes(osg::Vec3(0.0,1.0,0.0), osg::Vec3(0.0,0.0,1.0), osg::Vec3(0.0,1.0,0.0)); m_Transform->addChild(m_Billboard.get()); ! m_Transform->setStateSet(dstate); m_Transform->setCullingActive(false); ! // moon->setStateSet(dstate); } --- 579,595 ---- m_Moon = geom; ! //stateSet->setMode(GL_FOG, osg::StateAttribute::OFF); ! //stateSet->setRenderBinDetails(-2,"RenderBin"); m_Transform = new osg::MatrixTransform; m_Billboard = new AstroBillboard; m_Billboard->setCullingActive(false); ! m_Billboard->setStateSet(stateSet); m_Billboard->addDrawable(m_Moon.get()); m_Billboard->setAxes(osg::Vec3(0.0,1.0,0.0), osg::Vec3(0.0,0.0,1.0), osg::Vec3(0.0,1.0,0.0)); m_Transform->addChild(m_Billboard.get()); ! m_Transform->setStateSet(stateSet); m_Transform->setCullingActive(false); ! // moon->setStateSet(stateSet); } *************** *** 1018,1027 **** dstate->setMode(GL_CLIP_PLANE4, osg::StateAttribute::OFF); dstate->setMode(GL_CLIP_PLANE5, osg::StateAttribute::OFF); ! dstate->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); osg::Depth *depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); ! depth->setRange(1.0, 1.0); dstate->setAttributeAndModes(depth, osg::StateAttribute::OFF); setStateSet(dstate); } --- 1018,1029 ---- dstate->setMode(GL_CLIP_PLANE4, osg::StateAttribute::OFF); dstate->setMode(GL_CLIP_PLANE5, osg::StateAttribute::OFF); ! osg::Depth *depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); ! depth->setRange(1.0, 1.0); ! depth->setWriteMask(false); dstate->setAttributeAndModes(depth, osg::StateAttribute::OFF); setStateSet(dstate); + } *************** *** 1203,1209 **** m_SkyDome->setColorBinding(Geometry::BIND_PER_VERTEX); ! // XXX XXX StateSet *dstate = new StateSet; ! ! if (1) { Image *image = new Image(); image->allocateImage(64, 64, 1, GL_RGB, GL_UNSIGNED_BYTE); --- 1205,1209 ---- m_SkyDome->setColorBinding(Geometry::BIND_PER_VERTEX); ! { Image *image = new Image(); image->allocateImage(64, 64, 1, GL_RGB, GL_UNSIGNED_BYTE); *************** *** 1234,1266 **** dome_state->setMode(GL_LIGHTING, StateAttribute::OFF); dome_state->setMode(GL_CULL_FACE, StateAttribute::OFF); - dome_state->setMode(GL_DEPTH_TEST, StateAttribute::OFF); dome_state->setMode(GL_FOG, osg::StateAttribute::OFF); ! dome_state->setRenderBinDetails(-2,"RenderBin"); osg::Depth* depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); depth->setRange(1.0, 1.0); dome_state->setAttributeAndModes(depth,StateAttribute::OFF); ! } ! // clear the depth to the far plane. ! /* XXX XXX ! osg::Depth* depth = new osg::Depth; ! depth->setFunction(osg::Depth::ALWAYS); ! depth->setRange(1.0, 1.0); ! dstate->setAttributeAndModes(depth,StateAttribute::OFF); ! */ - - m_StarDome = new StarSystem(); - StateSet *star_state = m_StarDome->getOrCreateStateSet(); - star_state->setMode(GL_LIGHTING, StateAttribute::OFF); - star_state->setMode(GL_CULL_FACE, StateAttribute::OFF); - star_state->setMode(GL_DEPTH_TEST, StateAttribute::ON); // had to change from CSP, must've messed up code? - star_state->setMode(GL_FOG, osg::StateAttribute::OFF); - osg::Depth* depth = new osg::Depth; - depth->setFunction(osg::Depth::LEQUAL); // changed from CSP, was ALWAYS - depth->setRange(10.0, 1000000.0); - star_state->setAttributeAndModes(depth,StateAttribute::ON); // changed from CSP - osg::Geode *geode = new osg::Geode(); geode->addDrawable(m_SkyDome.get()); --- 1234,1261 ---- dome_state->setMode(GL_LIGHTING, StateAttribute::OFF); dome_state->setMode(GL_CULL_FACE, StateAttribute::OFF); dome_state->setMode(GL_FOG, osg::StateAttribute::OFF); ! // render bins: skydome and stars = -3, moon = -2, terrain = -1, rest = 0 (default) ! dome_state->setRenderBinDetails(-3,"RenderBin"); osg::Depth* depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); depth->setRange(1.0, 1.0); + depth->setWriteMask(false); dome_state->setAttributeAndModes(depth,StateAttribute::OFF); ! } ! { ! m_StarDome = new StarSystem(); ! StateSet *star_state = m_StarDome->getOrCreateStateSet(); ! star_state->setMode(GL_LIGHTING, StateAttribute::OFF); ! star_state->setMode(GL_CULL_FACE, StateAttribute::OFF); ! star_state->setMode(GL_FOG, osg::StateAttribute::OFF); ! star_state->setRenderBinDetails(-3,"RenderBin"); ! osg::Depth* depth = new osg::Depth; ! depth->setFunction(osg::Depth::ALWAYS); ! depth->setRange(1.0, 1.0); ! depth->setWriteMask(false); ! star_state->setAttributeAndModes(depth,StateAttribute::OFF); ! } osg::Geode *geode = new osg::Geode(); geode->addDrawable(m_SkyDome.get()); Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tc3DModel.cpp 18 Jan 2004 18:42:41 -0000 1.4 --- tc3DModel.cpp 20 Jan 2004 03:02:53 -0000 1.5 *************** *** 179,183 **** if (foundAnimation) { ! std::cout << " Found matching animation\n"; osg::MatrixTransform* mt = dynamic_cast<osg::MatrixTransform*>(ret_node->asTransform()); if (mt) --- 179,183 ---- if (foundAnimation) { ! //std::cout << "Found matching animation\n"; osg::MatrixTransform* mt = dynamic_cast<osg::MatrixTransform*>(ret_node->asTransform()); if (mt) Index: tcwindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcwindow.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcwindow.cpp 18 Jan 2004 18:42:41 -0000 1.15 --- tcwindow.cpp 20 Jan 2004 03:02:53 -0000 1.16 *************** *** 50,53 **** --- 50,54 ---- EVT_ENTER_WINDOW(tcWindow::OnEnterWindow) EVT_LEAVE_WINDOW(tcWindow::OnLeaveWindow) + EVT_SHOW(tcWindow::OnShow) EVT_SIZE(tcWindow::OnSize) END_EVENT_TABLE() *************** *** 100,103 **** --- 101,112 ---- } + /** + * Do nothing for show event. + */ + void tcWindow::OnShow(wxShowEvent& event) + { + return; + } + void tcWindow::OnKeyDown(wxKeyEvent& event) { *************** *** 107,116 **** void tcWindow::OnLButtonDown(wxMouseEvent& event) { ! event.Skip(); } void tcWindow::OnLButtonUp(wxMouseEvent& event) { ! event.Skip(); } --- 116,125 ---- void tcWindow::OnLButtonDown(wxMouseEvent& event) { ! SkipMouseEvent(event); } void tcWindow::OnLButtonUp(wxMouseEvent& event) { ! SkipMouseEvent(event); } *************** *** 137,141 **** void tcWindow::OnRButtonDown(wxMouseEvent& event) { ! event.Skip(); } --- 146,150 ---- void tcWindow::OnRButtonDown(wxMouseEvent& event) { ! SkipMouseEvent(event); } *************** *** 231,241 **** if (abActive) { wxWindow::Enable(true); - wxWindow::Show(TRUE); } else { wxWindow::Enable(false); - wxWindow::Show(FALSE); } mbActive=abActive; --- 240,252 ---- if (abActive) { + if (!wxWindow::IsShown()) + { + wxWindow::Show(TRUE); + } wxWindow::Enable(true); } else { wxWindow::Enable(false); } mbActive=abActive; *************** *** 568,576 **** tcWindow::tcWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW| wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { ! SetBackgroundColour(*wxBLACK); ! Show(FALSE); mbCloned = false; mbActive = false; --- 579,587 ---- tcWindow::tcWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { ! wxWindow::SetBackgroundColour(*wxBLACK); ! wxWindow::Show(FALSE); mbCloned = false; mbActive = false; --- tcrendersurface.cpp DELETED --- |