MCPcopy Create free account
hub / github.com/carbonengine/trinity / SetupBoosters

Method SetupBoosters

trinity/Eve/SpaceObjectFactory/EveSOF.cpp:2650–2779  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: add the booster to the new ship --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2648// add the booster to the new ship
2649// --------------------------------------------------------------------------------
2650void EveSOF::SetupBoosters( EveShip2Ptr ship, const EveSOFDNAPtr dna ) const
2651{
2652 CCP_STATS_ZONE( __FUNCTION__ );
2653
2654 // does this hull have boosters at all?
2655 if( dna->GetHullBoosterCount() == 0 )
2656 {
2657 return;
2658 }
2659
2660 // create
2661 EveBoosterSet2Ptr set;
2662 set.CreateInstance();
2663
2664 // per-race data
2665 const EveSOFDataMgr::RaceBoosterData* rdata = dna->GetRaceBoosterData();
2666 // each booster is a locator with an index, keep track
2667 uint32_t boosterLocatorIndex = 0;
2668 // cycle over all hulls in the multi-hull list
2669 Vector3 hullOffset( 0.f, 0.f, 0.f );
2670 for( size_t hullIdx = 0; hullIdx < dna->GetMultiHullCount(); ++hullIdx )
2671 {
2672 // per-hull data
2673 const EveSOFDataMgr::HullBoosterData* hdata = dna->GetHullBoosterData( hullIdx );
2674
2675 // set the booster set's internal data
2676 set->SetData(
2677 rdata->glowScale,
2678 &rdata->glowColor,
2679 &rdata->warpGlowColor,
2680 rdata->symHaloScale,
2681 rdata->haloScaleX,
2682 rdata->haloScaleY,
2683 &rdata->haloColor,
2684 &rdata->warpHaloColor,
2685 hdata->alwaysOn );
2686 set->SetLightData( rdata->lightOffset, rdata->lightFlickerAmplitude, rdata->lightFlickerFrequency, rdata->lightRadius, rdata->lightColor, rdata->lightWarpRadius, rdata->lightWarpColor );
2687
2688 Tr2EffectPtr effect = CreateBoosterEffect( rdata, BlueSharedString( "BOOSTER_LOD_HIGH" ) );
2689 Tr2EffectPtr effectFar = CreateBoosterEffect( rdata, BlueSharedString( "BOOSTER_LOD_LOW" ) );
2690
2691 set->SetEffect( effect, effectFar );
2692
2693 // create and setup glows
2694 EveSpriteSetPtr glow;
2695 glow.CreateInstance();
2696
2697 Tr2EffectPtr glowEffect;
2698 glowEffect.CreateInstance();
2699 glowEffect->StartUpdate();
2700 glowEffect->SetEffectPathName( "res:/Graphics/Effect/Managed/Space/Booster/BoosterGlowAnimated.fx" );
2701 glowEffect->AddResourceTexture2D( BlueSharedString( "NoiseMap" ), "res:/Texture/global/noise.dds" );
2702 glowEffect->AddResourceTexture2D( BlueSharedString( "DiffuseMap" ), "res:/Texture/Particle/whitesharp.dds" );
2703 // finish effect and set it
2704 glowEffect->EndUpdate();
2705 glow->SetEffect( glowEffect );
2706 set->SetGlow( glow );
2707

Callers

nothing calls this directly

Calls 15

TriMatrixTranslateFunction · 0.85
GetHullBoosterCountMethod · 0.80
CreateInstanceMethod · 0.80
GetRaceBoosterDataMethod · 0.80
GetMultiHullCountMethod · 0.80
GetHullBoosterDataMethod · 0.80
StartUpdateMethod · 0.80
SetEffectPathNameMethod · 0.80
AddResourceTexture2DMethod · 0.80
SetGlowMethod · 0.80
AddParameterVector4Method · 0.80
AddParameterColorMethod · 0.80

Tested by

no test coverage detected