Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UnrealShare.UIParticleSystem


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
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
//================================================================
// class: UIParticleSystem
// file: UIParticleSystem.uc
// author: Raven
// www: http://turniej.unreal.pl/rp
// description:
// base class for particle system.
// store structure definitions in case someone will need'em
// in subclasses other then 'ParticleEmitter'
//================================================================
class UIParticleSystem extends UIFX abstract;
#exec TEXTURE IMPORT NAME=ParticleEmitter FILE="Textures\Icons\Emitter.pcx" GROUP=Icons LODSET=2
#exec TEXTURE IMPORT NAME=ParticleForce FILE="Textures\Icons\Force.pcx" GROUP=Icons LODSET=2
#exec TEXTURE IMPORT NAME=ParticlePath FILE="Textures\Icons\Path.pcx" GROUP=Icons LODSET=2 FLAGS=2
#exec TEXTURE IMPORT NAME=ParticleCombiner FILE="Textures\Icons\Combiner.pcx" GROUP=Icons LODSET=2
//================================================================
// ENUMS
//================================================================
enum EAccelType
{
	ACC_Addictive,                                                     // acceleration will be added to velocity.
	ACC_Multiply                                                       // velocity will be multiplied by acceleration.
};
enum ESizeType
{
	ST_Normal,                                                         // particle will not change size
	ST_Grow,                                                           // particle will grow (ParticleGrowth)
	ST_Shrink,                                                         // particle will shrink (ParticleShrink)
	ST_Cycle                                                           // particle will cyclically shrinks and grow
};
enum ESizing
{
	SIZING_Infinity,                                                   // particle will grow/shrink till lifespan ends
	SIZING_UserDecided                                                 // particle will grow/shrink till DrawScale reach specifeid size
};
enum ETAnim
{
	AN_PlayOnce,                                                       // should animation be played only once
	AN_Loop                                                            // or should it be looped
};
enum EFType
{
	FACE_None,                                                         // rotation is not changed
	FACE_Velocity,                                                     // mesh always faces velocity
	FACE_Actor                                                         // mesh always faces chosen actor
};
enum EDest
{
	DEST_None,                                                         // no destination :)
	DEST_Once,                                                         // will pick target's destination only once
	DEST_Seek                                                          // will constantly try to found a way to destination actor
};
enum EDestActor
{
	DA_Chosen,                                                         // destination actor is used as a target
	DA_Self                                                            // emitter is particle destination
};
enum ESType
{
	ST_Normal,                                                        // no special calculations
	ST_Box,                                                           // particles are spawned inside a box
	ST_Sphere,                                                        // particles are spawned inside a sphere
	ST_Cylindrical                                                    // particles will be spawned inside of a cylinder
};
enum ESpawnStyle
{
	SS_BindToParticle,
	SS_StayStill
};
//================================================================
// AdditionalSpawn Effect
//================================================================
struct SSpawnEffect
{
	var() bool bUseSpawnEffect;
	var() class<Actor> SpawnedEffect;
	var() ESpawnStyle SpawnStyle;
};
//================================================================
// GLOBAL STRUCTURE
//================================================================
struct SGlobal                                                        // global can be force tu used instead of variables in MAIN
{
	var() float ParticleLifeTime;                                      // lifespan (in seconds)
	var() float ParticleLifeTimeVariance;                              // lifespan variance (in seconds)
	var() bool bDefineSpeedAsVector;                                   // defines speed as a vector
	var() vector BaseSpeed;                                            // base particle speed (if bDefineSpeedAsVector is true)
	var() float SpeedVariance;                                         // speed variance
	var() float ParticleSpeed;                                         // speed when particle system is rotated as generator
	var() float SprayFactor;                                           // spray
	var() float SprayFactorVariance;                                   // spray vairance
};
//================================================================
// TEMPLATE STRUCTURES
//================================================================
struct SMain
{
	var() bool bForceGlobalSettings;                                   // if true global settings will be used
	var() rotator ParticleRotation;                                    // custom particle rotation (useful when we have mesh instead of sprite)
	var() bool bUseParticleRotation;                                   // should we use custom particle rotation
	var() float ParticleLifeTime;                                      // lifespan (in seconds)
	var() float ParticleLifeTimeVariance;                              // lifespan variance (in seconds)
	var() float ParticleSlowingDownFactor;                             // particle slow down factor (can not be 0 (!!) 1.0 - no slow down, higher then 1.0 - faster, lower then 1.0 - lower)
	var() bool bMoveSmooth;                                            // particle will move smooth
	var() bool bDefineSpeedAsVector;                                   // defines speed as a vector
	var() vector BaseSpeed;                                            // base particle speed (if bDefineSpeedAsVector is true)
	var() float SpeedVariance;                                         // speed variance
	var() float ParticleSpeed;                                         // speed when particle system is rotated as generator
	var() float SprayFactor;                                           // spray
	var() float SprayFactorVariance;                                   // spray vairance
};
struct SAnimation
{
	var() texture AnimTextures[60];                                    // animation textures
	var() int NumOfTextures;                                           // number of textures
	var() bool DefineAnimationStorage;                                 // should animated textures be taken from 'AnimationStorage' class (for coders)
	var() class<UIParticleAnimationStorage> ParticleAnimationStorage;  // stores animations (for coders)
};
struct SAdvanced
{
	var() bool bUseParticleClass;                                      // can we use custom class
	var() class<UIBasicParticle> ParticleClass;                        // custom class
};
struct SSize
{
	var() float ParticleDrawScale;                                     // particle size
	var() float ParticleDrawScaleVariance;                             // particle size variance
	var() float ParticleGrowth;                                        // particle grow rate
	var() ESizeType SizeType;                                          // size type
	var() float ParticleShrink;                                        // particle shring rate
	var() float MinSize;                                               // the smallest of particle (only if SizeType is ST_Cycle or Sizing is SIZING_UserDecided)
	var() float MaxSize;                                               // the biggest size of particle (only if SizeType is ST_Cycle or Sizing is SIZING_UserDecided)
	var() ESizing Sizing;                                              // describes end size of particle (not used if SizeType is ST_Cycle)
//   var() bool bCycleSize;                                           // will cyclically makes particle grow and shrink
};
struct SDisplay
{
	var() ERenderStyle ParticleStyle;                                  // particle render style
	var() bool bUnlitParticle;                                         // is particle unlit
	var() bool bParticleCastShadow;                                    // particle cast shadow
	var() bool bParticleMeshEnviroMap;                                 // only when particle is a mesh
	var() bool bUseMesh;                                               // particle will use mesh instead of sprite
	var() mesh PraticleMesh;                                           // mesh (if use_mesh is true)
	var() bool bUseRandomTexture;                                      // uses random texture from anim_textures
	var() texture ParticleTexture;                                     // particle texture (if doesn't use particle animation
	var() bool bUseSpriteAnimation;                                    // particle will use sprite animation
};
struct SDecal
{
	var() texture ParticleDecalTexture;                                // texture used for decal
	var() bool ParticleSpawnDecal;                                     // particle will spawn decal (true) when they hit wall
	var() class<decal> ParticleDecal;                                  // decal class
	var() float ParticleDecalSize;                                     // decal size
	var() bool bLimitDecals;                                           // if true, decals will be limited
};
struct SSound
{
	var() sound BornSound;                                             // when particle starts it's life
	var() sound FlyingSound;                                           // particle flying sound
	var() sound DyingSound;                                            // particle dying sound
	var() sound LandingSound;                                          // particle landing sound
	var() sound HittingSound;                                          // when particle hit's wall
	var() sound TouchingSound;                                         // when particle hits an actor
	var() ESoundSlot ParticleSoundSlot;                                // sound slot
	var() float ParticleSoundVolume;                                   // sound volume
	var() bool ParticleSoundbNoOverride;                               // sound no override
	var() float ParticleSoundRadius;                                   // sound radius
	var() float ParticleSoundPitch;                                    // sound pitch
};
struct SLight
{
	var() bool CastLight;                                              // particle will cast light!!
};
struct SLightColor
{
	var() byte ParticleLightBrightness;                                // light brightness
	var() byte ParticleLightHue;                                       // light hue
	var() byte ParticleLightSaturation;                                // light satruation
};
struct SLighting
{
	var() ELightType  ParticleLightType;                               // light type (can lag :))
	var() ELightEffect ParticleLightEffect;                            // light effect (can lag :))
	var() byte ParticleLightRadius;                                    // light radius
	var() byte ParticleLightPeriod;                                    // light period
	var() byte ParticleLightPhase;                                     // light phase
	var() byte ParticleLightCone;                                      // light cone
	var() byte ParticleVolumeBrightness;                               // volume brightness
	var() byte ParticleVolumeRadius;                                   // volume radius
	var() byte ParticleVolumeFog;                                      // volume fog
};
struct SFading
{
	var() bool CanFadeOut;                                             // can fade out
	var() bool CanFadeIn;                                              // can fade in
	var() float InitailScaleGlow;                                      // initial glow
	var() float FadeOutTime;	               	                      // fade out time
	var() float FadeOutScaleFactor;                                    // feade out scale factor
	var() float FadeInTime;	                            	      // fade in time
	var() float FadeInScaleFactor;                                     // feade scale factor
};
struct SDamage
{
	var() bool ParticleGivesDamage;                                    // particle will give damage when touchening actor
	var() name ParticleDamageType;                                     // damage type
	var() int ParticleDamage;                                          // damage
	var() bool PlayerTakeDamage;                                       // player pawn can be damaged
	var() bool ScriptedPawnTakeDamage;                                 // scripted pawns can be damaged
	var() bool FlockPawnTakeDamage;                                    // flock pawns can be damaged
	var() bool OtherActorTakeDamage;                                   // all other actors such as eg. wooden boxes can be damaged
	var() int MomentumTransfer;                                        // momentum transfer
};
struct SPPhysics
{
	var() EPhysics ParticlePhysics;                                    // custom physic
	var() bool bCanAccelerate;                                         // particle can accelerate
	var() vector AccelerateFactor;                                     // accelerate factor
	var() vector TerminalVelocity;                                     // max accelerate
	var() EAccelType AccelerationType;                                 // acceleration type
};
struct SCollision
{                                                                     // acceleration type
	var() bool ParticlesUseCollision;                                   // particle shoud collide with world and actors?
	var() float ParticleCollisonRadius;                                 // collision radius
	var() float ParticleCollisonHeight;                                 // collision height
	var() bool CollideWithActors;                                       // will collide with actors if true
	var() bool BlockPlayers;                                            // will block players if true
	var() bool BlockActors;                                             // will block actors if true
	var() bool ParticleCollideWorld;                                    // will Collide world
	var() bool DestroyWhenTouch;                                        // will destroy particle when touching an actor
	var() bool DestroyWhenColideWorld;                                  // will destroy particle when touching world geometry (eg walls)
	var() bool DestroyWhenLand;                                         // will destroy particle when land
	var() bool DestroyWhenTouchWater;                                   // will destroy particle when touches water
	var() bool StopWhenTouchWall;                                       // will stop when touches world geometry
	var() bool StopWhenTouchPawn;                                       // will stop when touches pawn
	var() bool StickToWall;                                             // will stick to wall
	var() bool StickToPawn;                                             // will stick to pawn
	var() bool bSpawnLandEffect;                                        // spawn effect when landed
	var() class<actor> LandEffect;                                      // land effect
	var() bool bOverrideWaterEntrySound;                                // override default water entry sound (if particles_use_collision is false)
	var() sound WaterEntrySound;                                        // water entry sound
	var() bool bOverrideWaterEntryEffect;                               // override default water entry actor (if particles_use_collision is false)
	var() class<actor> WaterEntryActor;                                 // water entry actor
	var() bool bSpawnEffectOnDestroy;                                   // spawn effect when destroy
	var() class<actor> DestroyEffect;                                   // destroy effect
};
struct SBounce
{
	var() bool CanBounce;                                               // can we use bounce
	var() float BounceRatio;                                            // bounce ratio
	var() float BounceModifier;                                         // bounce height (when landed)
	var() bool EndlessBounce;                                           // will bounce till it die if true
	var() int BounceNum;                                                // if EndlessBounce is false this is number of bounces
};
struct SBuoyance
{
	var() bool CanBuoyance;                                             // can buoyance in water
	var() bool SplashWhenHitWater;                                      // splash when hit water
	var() bool SoundWhenHitWater;                                       // plays sound when hit water
	var() float ParticleBuoyancy;                                       // particle buoyancy
	var() float ParticleMass;                                           // particle mass
};
struct SVelocity
{
	var() bool bUseInvertVelocity;                                      // should velocity be inversed
	var() bool bLoop;                                                   //
	var() bool InvertX;                                                 // X-Axis velocity vill be inversed
	var() bool InvertY;                                                 // Y-Axis velocity vill be inversed
	var() bool InvertZ;                                                 // Z-Axis velocity vill be inversed
	var() float InvertDelay;                                            // inverse delay
};
struct SSpawnPlace
{
	var() vector OwnEffectArea;                                         // each template can override effect area
	var() bool bUseOwnEffectArea;                                       // overrided effect area
};
struct SDest
{
	var() actor Destination;                                            // particle destination
	var() EDest DestinationType;                                        // type of destination
	var() EDestActor DestinationActor;                                  // destination actor type
	var() bool bForceFollow;                                            // will ignore anything just to reach destination
};
struct SMesh
{
	var() bool bAnimatedMesh;                                           // if mesh have to be animated
	var() name AnimationName;                                           // name of animation which should be played
	var() float AnimationRate;                                          // animation rate
	var() float TweenRate;                                              // tween rate
	var() ETAnim AnimationType;                                         // animation type
	var() EFType FaceObject;                                            // object particle should face
	var() actor LookTarget;                                             // Used if DynamicRotation == FACE_Actor
	var() rotator MeshRotationRate;                                     // rotation rate (only if DynamicRotation == FACE_None)
};
struct SRot
{
	var() bool bRandomizeRotation;                                      // uses random spawn rotation
	var() bool bRandPitch;                                              // random pitch
	var() bool bRandYaw;                                                // random yaw
	var() bool bRandRoll;                                               // randomed roll
	var() rotator MinRotation;                                          // min rotation
	var() rotator MaxRotation;                                          // max rotation
	var() bool bForceRndRot;                                            // forces RotRand() function
	var() bool bAlignRotator;                                           // aligns current spawn rotator to emitters rotation
};
struct SAdvSpwn
{
	var() ESType SpawnType;                                          // Spawn type
	var() vector BoxMinArea;                                         // box min values
	var() vector BoxMaxArea;                                         // box max values
	var() float SphereRadius;                                        // sphere radius
	var() vector SpawnOffset;                                        // spawn offset
	var() bool bSpawnOnSurface;                                      // Should particles be spawn ONLY on spawn area surface
	var() float CylinderHeight;                                      // Cylinder height
	var() float CylinderRadius;                                      // Cylinder radius
	var() bool bAlignSpawnSurface;                                   // Should spawn area be rotated according to emitter rotation
	var() rotator AlignModifier;                                     // Modifies rotation afer it's aligned
};
struct SMisc
{
	var() float ParticlesBounce_Min;
	var() float ParticlesBounce_Max;
	var() bool ParticlesFixedTrailer;
	var() bool ParticlesUseJerkyness;
	var() float ParticlesJerkyness;
	var() bool bUseDistanceCulling;
	var() float PartVisibilityHeight;
	var() float PartVisibilityRadius;
};


//================================================================
// BASIC FUNCTIONS
//================================================================
simulated function int RandFloat(float max)
{
	local int num;
	local float delta;
	num = max;
	delta= max - num;

	if (rand(100)<delta*100) num++;
	return num;
}
simulated function int Jiiter(float max)
{
	return rand(2*max)-max;
}
simulated function vector RotateVector(rotator VRotation, vector VOffset)
{
	local vector X,Y,Z;
	GetAxes(VRotation,X,Y,Z);
	return VOffset.X * X + VOffset.Y * Y + VOffset.Z * Z;
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:28.000 - Creation time: zo 11-11-2012 21:14:21.147 - Created with UnCodeX