Thread: [Gcblue-commits] gcb_wx/src/graphics tc3DWindow.cpp,1.9,1.10 tcCreditView.cpp,1.8,1.9 tcHookInfo.cpp
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:41:58
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/src/graphics Modified Files: tc3DWindow.cpp tcCreditView.cpp tcHookInfo.cpp tcParticleEffect.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcCreditView.cpp 2 Nov 2004 04:23:56 -0000 1.8 --- tcCreditView.cpp 7 Nov 2004 03:40:44 -0000 1.9 *************** *** 107,110 **** --- 107,113 ---- AddCredit(s, 60.0f, 0); + s = "Some sound effects courtesy of A1 Sound Effects, www.a1freesoundeffects.com\n"; + AddCredit(s, 60.0f, 0); + s = "3D sky code\n"; AddCredit(s, 25.0f, 0); Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcHookInfo.cpp 6 Nov 2004 15:13:41 -0000 1.5 --- tcHookInfo.cpp 7 Nov 2004 03:40:44 -0000 1.6 *************** *** 38,41 **** --- 38,42 ---- #include "tcDatabase.h" #include "tcTime.h" + #include "tcMissileObject.h" #ifdef _DEBUG *************** *** 396,400 **** // AI action text for platform objects tcPlatformObject* pPlatformObj = dynamic_cast<tcPlatformObject*>(pHookedObj); ! if(pPlatformObj != NULL) { std::string text; --- 397,401 ---- // AI action text for platform objects tcPlatformObject* pPlatformObj = dynamic_cast<tcPlatformObject*>(pHookedObj); ! if (pPlatformObj != NULL) { std::string text; *************** *** 407,410 **** --- 408,419 ---- ftexty += 15; } + if (tcMissileObject* missile = dynamic_cast<tcMissileObject*>(pHookedObj)) + { + sprintf(zBuff, "Runtime: %.1f", missile->RuntimeRemaining()); + + DrawTextR(zBuff, ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); + ftexty += 15; + + } } Index: tcParticleEffect.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcParticleEffect.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcParticleEffect.cpp 2 Nov 2004 04:23:56 -0000 1.4 --- tcParticleEffect.cpp 7 Nov 2004 03:40:44 -0000 1.5 *************** *** 192,207 **** case AFTERBURNER: { ! counter->setRateRange(300, 350); ! ptemplate.setLifeTime(3); // 3 seconds of life ! ptemplate.setSizeRange(osgParticle::rangef(0.75f, 3.0f)); ! ptemplate.setAlphaRange(osgParticle::rangef(0.0f, 1.5f)); ptemplate.setColorRange(osgParticle::rangev4( ! osg::Vec4(0.8f, 0.6f, 0.6f, 1.5f), osg::Vec4(0, 0.7f, 1.0f, 0.0f))); ! ptemplate.setRadius(0.5f); // 5 cm wide particles ! ptemplate.setMass(0.05f); // 50 g heavy ! shooter->setInitialSpeedRange(0, 0); accelOp->setAcceleration(osg::Vec3(0, 0, 0)); } break; --- 192,209 ---- case AFTERBURNER: { ! //counter->setRateRange(300, 350); ! ptemplate.setLifeTime(2); ! ptemplate.setSizeRange(osgParticle::rangef(0.5f, 10.0f)); ! ptemplate.setAlphaRange(osgParticle::rangef(0.1f, 0.3f)); ptemplate.setColorRange(osgParticle::rangev4( ! osg::Vec4(0.5f, 0.2f, 0.2f, 1.5f), osg::Vec4(0, 0.7f, 1.0f, 0.0f))); ! ptemplate.setRadius(1.0f); ! ptemplate.setMass(0.05f); ! //shooter->setInitialSpeedRange(0, 0); accelOp->setAcceleration(osg::Vec3(0, 0, 0)); + + particlePlacer->setApplyJitter(true); } break; *************** *** 230,233 **** --- 232,259 ---- } break; + case GUN: + { + counter->setRateRange(20, 40); + ptemplate.setLifeTime(8); // 3 seconds of life + ptemplate.setSizeRange(osgParticle::rangef(2.5f, 5.0f)); + ptemplate.setAlphaRange(osgParticle::rangef(0.0f, 1.5f)); + ptemplate.setColorRange(osgParticle::rangev4( + osg::Vec4(0.0f, 0.0f, 0.0f, 1.5f), + osg::Vec4(0.7, 0.6f, 0.6f, 0.0f))); + ptemplate.setRadius(25.0f); + ptemplate.setMass(0.05f); // for friction op I guess + + + shooter->setInitialSpeedRange(3, 15); + shooter->setThetaRange(-0.1, 0.1); + shooter->setPhiRange(0, 0); + + accelOp->setAcceleration(osg::Vec3(0, 0, -0.5)); + + osgParticle::FluidFrictionOperator *op = new osgParticle::FluidFrictionOperator; + op->setFluidToAir(); + program->addOperator(op); + } + break; default: break; *************** *** 267,270 **** --- 293,324 ---- } + void tcParticleEffect::InitializeGunEffect() + { + osgParticle::ModularEmitter* modularEmitter = new osgParticle::ModularEmitter; + emitter = modularEmitter; + + modularEmitter->setParticleSystem(this); + + counter = new osgParticle::RandomRateCounter; + + modularEmitter->setCounter(counter.get()); + + particlePlacer = new osgParticle::tcParticlePlacer; + particlePlacer->setCenter(0, 0, 0); + + modularEmitter->setPlacer(particlePlacer); + modularEmitter->setReferenceFrame(osgParticle::Emitter::RELATIVE_TO_ABSOLUTE); + + shooter = new osgParticle::RadialShooter; + + modularEmitter->setShooter(shooter.get()); + + program = new osgParticle::ModularProgram; + program->setParticleSystem(this); + + // create an operator that simulates the gravity acceleration. + accelOp = new osgParticle::AccelOperator; + program->addOperator(accelOp.get()); + } *************** *** 272,276 **** : root(0), smokeMode(smokeModeCode) { ! if (smokeModeCode == MISSILE) { osgParticle::SmokeTrailEmitter* smokeTrailEmitter = --- 326,330 ---- : root(0), smokeMode(smokeModeCode) { ! if ((smokeModeCode == MISSILE) || (smokeModeCode == AFTERBURNER)) { osgParticle::SmokeTrailEmitter* smokeTrailEmitter = Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DWindow.cpp 2 Nov 2004 04:23:56 -0000 1.9 --- tc3DWindow.cpp 7 Nov 2004 03:40:44 -0000 1.10 *************** *** 1392,1395 **** --- 1392,1396 ---- + #ifdef _DEBUG if (osg::StateSet* stateSet = textRoot->getStateSet()) { *************** *** 1415,1418 **** --- 1416,1420 ---- fprintf(stderr, "Error - TextObject null stateset\n"); } + #endif text->dirtyBound(); text->dirtyDisplayList(); *************** *** 1515,1519 **** { ! if (osg::StateSet* stateSet = backgroundRoot->getStateSet()) { --- 1517,1521 ---- { ! #ifdef _DEBUG if (osg::StateSet* stateSet = backgroundRoot->getStateSet()) { *************** *** 1533,1536 **** --- 1535,1539 ---- fprintf(stderr, "Error - backgroundRoot null stateset\n"); } + #endif |