Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 |
/** * * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class UTEmitterPool extends EmitterPool native; /** info about attached explosion lights */ struct native AttachedExplosionLight { var UTExplosionLight Light; var Actor Base; var vector RelativeLocation; }; var array<AttachedExplosionLight> RelativeExplosionLights; // (cpptext) // (cpptext) // (cpptext) // (cpptext) function ParticleSystemComponent SpawnEmitter(ParticleSystem EmitterTemplate, vector SpawnLocation, optional rotator SpawnRotation, optional Actor AttachToActor) { local PlayerController PC; local int LODLevel; local ParticleSystemComponent PSC; if( EmitterTemplate == none ) { LogInternal("UTEmitterPool was passed a none EmitterTemplate"); // ScriptTrace(); return none; } PSC = Super.SpawnEmitter(EmitterTemplate, SpawnLocation, SpawnRotation, AttachToActor); // reduce detail if low framerate if (WorldInfo.bDropDetail) { LODLevel = 1; } else if (EmitterTemplate.LODDistances.length > 1) { // also reduce detail if all local players are too far away or effect is behind them LODLevel = 1; foreach LocalPlayerControllers(class'PlayerController', PC) { if ( PC.ViewTarget != None && VSize(PC.ViewTarget.Location - SpawnLocation) * PC.LODDistanceFactor < EmitterTemplate.LODDistances[1] && vector(PC.Rotation) dot (SpawnLocation - PC.ViewTarget.Location) >= 0.0 ) { LODLevel = 0; break; } } } PSC.SetLODLevel(LODLevel); PSC.SetDepthPriorityGroup(SDPG_World); return PSC; } /** hooked up to UTExplosionLight's OnLightFinished delegate to clean it up */ function OnExplosionLightFinished(UTExplosionLight Light) { local int i; DetachComponent(Light); i = RelativeExplosionLights.Find('Light', Light); if (i != INDEX_NONE) { RelativeExplosionLights.Remove(i, 1); } } /** creates an explosion light (currently not pooled) */ function UTExplosionLight SpawnExplosionLight(class<UTExplosionLight> LightClass, vector SpawnLocation, optional Actor AttachToActor) { local UTExplosionLight Light; local int i; // AttachToActor is only for movement, so if it can't move, then there is no point in using it if (AttachToActor != None && (AttachToActor.bStatic || !AttachToActor.bMovable)) { AttachToActor = None; } Light = new(self) LightClass; Light.SetTranslation(SpawnLocation); Light.OnLightFinished = OnExplosionLightFinished; AttachComponent(Light); if (AttachToActor != None) { i = RelativeExplosionLights.length; RelativeExplosionLights.length = i + 1; RelativeExplosionLights[i].Light = Light; RelativeExplosionLights[i].Base = AttachToActor; RelativeExplosionLights[i].RelativeLocation = SpawnLocation - AttachToActor.Location; } return Light; } defaultproperties { Begin Object Class=ParticleSystemComponent Name=ParticleSystemComponent0 ObjName=ParticleSystemComponent0 Archetype=ParticleSystemComponent'Engine.Default__EmitterPool:ParticleSystemComponent0' bOverrideLODMethod=True LODMethod=PARTICLESYSTEMLODMETHOD_DirectSet ObjectArchetype=ParticleSystemComponent'Engine.Default__EmitterPool:ParticleSystemComponent0' End Object PSCTemplate=ParticleSystemComponent0 MaxActiveEffects=200 SMC_MIC_ReductionTime=2.000000 IdealStaticMeshComponents=200 IdealMaterialInstanceConstants=200 Name="Default__UTEmitterPool" ObjectArchetype=EmitterPool'Engine.Default__EmitterPool' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |