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 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class UTEmitter extends Emitter native notplaceable; /** this is used for a few special cases where we wanted a completely new particle system at certain distances * instead of just turning off an emitter or two inside a single one */ struct native DistanceBasedParticleTemplate { /** the template to use */ var ParticleSystem Template; /** the minimum distance all local players must be from the spawn location for this template to be used */ var float MinDistance; }; /** utility function to select the best template from the passed in list * the list is assumed to be in order from greatest distance to shortest distance */ static final function ParticleSystem GetTemplateForDistance(const out array<DistanceBasedParticleTemplate> TemplateList, vector SpawnLocation, WorldInfo WI) { local PlayerController PC; local int i; local float Dist; if (TemplateList.length == 0 || WI.NetMode == NM_DedicatedServer) { return None; } // figure out the distance to use (smallest of all local players) Dist = TemplateList[0].MinDistance * 10.0; foreach WI.LocalPlayerControllers(class'PlayerController', PC) { Dist = FMin(Dist, VSize(PC.ViewTarget.Location - SpawnLocation) * PC.LODDistanceFactor); } for (i = 0; i < TemplateList.length; i++) { if (Dist >= TemplateList[i].MinDistance) { return TemplateList[i].Template; } } return None; } simulated event SetTemplate(ParticleSystem NewTemplate, optional bool bDestroyOnFinish) { local PlayerController PC; local int LODLevel; Super.SetTemplate(NewTemplate, bDestroyOnFinish); if (NewTemplate != None) { // reduce detail if low framerate if (WorldInfo.bDropDetail) { LODLevel = 1; } else if (NewTemplate.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 - Location) * PC.LODDistanceFactor < NewTemplate.LODDistances[1] && vector(PC.Rotation) dot (Location - PC.ViewTarget.Location) >= 0.0 ) { LODLevel = 0; break; } } } ParticleSystemComponent.SetLODLevel(LODLevel); } } function SetLightEnvironment(LightEnvironmentComponent Light) { if(ParticleSystemComponent != none) { ParticleSystemComponent.SetLightEnvironment(Light); } } defaultproperties { Begin Object Class=ParticleSystemComponent Name=ParticleSystemComponent0 ObjName=ParticleSystemComponent0 Archetype=ParticleSystemComponent'Engine.Default__Emitter:ParticleSystemComponent0' bOverrideLODMethod=True SecondsBeforeInactive=0.000000 LODMethod=PARTICLESYSTEMLODMETHOD_DirectSet ObjectArchetype=ParticleSystemComponent'Engine.Default__Emitter:ParticleSystemComponent0' End Object ParticleSystemComponent=ParticleSystemComponent0 bDestroyOnSystemFinish=True Components(0)=ParticleSystemComponent0 bNoDelete=False LifeSpan=7.000000 CollisionType=COLLIDE_CustomDefault Name="Default__UTEmitter" ObjectArchetype=Emitter'Engine.Default__Emitter' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |