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

Engine.xEmitter


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
//=============================================================================
// xEmitter - particle emission! renamed to avoid conflict with Emitter
// Copyright 2001 Digital Extremes - All Rights Reserved.
// Confidential.
//=============================================================================
class xEmitter extends Actor native placeable;

#exec Texture Import File=Textures\S_Emitter.tga Name=S_Emitter Mips=Off

replication
{
    unreliable if (Role == ROLE_Authority)
        mSpawnVecA, blockOnNet;
}

// particle system config...
var(PclEmitter) enum ExParticleTypes
{
	PT_Sprite,
	PT_Stream,
	PT_Line,
	PT_Disc,
	PT_Mesh,
	PT_Branch,
    PT_Beam,
} mParticleType;

// particle system config...
var(PclEmitter) enum ExSpawningTypes
{
	ST_Sphere,
	ST_Line,
	ST_Disc,
	ST_Cylinder,
    ST_AimedSphere,
    ST_StaticMesh,
    ST_Explode,
    ST_ExplodeRing,
    ST_OwnerSkeleton,
    ST_Test,
} mSpawningType;

var(PclEmitter) bool	mRegen;
var(PclEmitter) bool	mRegenPause;
var(PclEmitter) float	mRegenOnTime[2];
var(PclEmitter) float	mRegenOffTime[2];
var(PclEmitter) int		mStartParticles;	// at runtime also, you can set this > 0 to spawn this many next tick
var(PclEmitter) private int		mMaxParticles;
var(PclEmitter) float	mDelayRange[2];
var(PclEmitter) float	mLifeRange[2];
var(PclEmitter) float	mRegenRange[2];
var(PclEmitter) float	mRegenDist;
var(PclEmitter) Name	mSourceActor;
var(PclEmitter) Name	mChildName;
var			   xEmitter mChildEmitter;
var(PclEmitter) StaticMeshActor SourceStaticMesh;
var(PclEmitter) bool    bSuspendWhenNotVisible;
var(PclVisuals) bool    mDistanceAtten;

var(PclMovement) vector	mDirDev;
var(PclMovement) vector	mPosDev;
var(PclMovement) vector mSpawnVecA;
var(PclMovement) vector	mSpawnVecB;

var(PclMovement) float	mSpeedRange[2];
var(PclMovement) bool	mPosRelative;
var(PclMovement) float	mMassRange[2];
var(PclMovement) float	mAirResistance;
var(PclMovement) bool	mCollision;
var(PclMovement) float  mOwnerVelocityFactor;

var(PclVisuals) bool	mRandOrient;

var(PclMovement) float	mSpinRange[2];

var(PclVisuals) float	mSizeRange[2];
var(PclVisuals) float	mGrowthRate;
var(PclVisuals) color	mColorRange[2];

// attenuation
var(PclVisuals) bool	mAttenuate;
var(PclVisuals) float	mAttenKa;
var(PclVisuals) float	mAttenKb;
var(PclVisuals) enum	EAttenFunc
{
	ATF_LerpInOut,
	ATF_ExpInOut,
	ATF_SmoothStep,
	ATF_Pulse,
	ATF_Random,
	ATF_None,
} mAttenFunc;
var				int		mpAttenFunc;

var(PclVisuals) bool	mRandTextures;	// choose a random texture for each instance of this emitter
var(PclVisuals) bool	mTileAnimation;	// animate the particle from the set of tiles throughout life
var(PclVisuals) int		mNumTileColumns;
var(PclVisuals) int		mNumTileRows;
var(PclVisuals) bool	mUseMeshNodes;
var(PclVisuals) bool	mRandMeshes;
var(PclVisuals) StaticMesh	mMeshNodes[8]; // if using meshes as particle nodes
var(PclVisuals) Texture	mPosColorMapXY;
var(PclVisuals) Texture	mPosColorMapXZ;
var(PclVisuals) Texture	mLifeColorMap;

var(PclSoftBody) float	springK;
var(PclSoftBody) float	springD;
var(PclSoftBody) float	springMaxStretch;
var(PclSoftBody) float	springMaxCompress;

// ver 1.1
var(PclMovement) float	mColElasticity; // bounciness of particle collision 0-1
var(PclMovement) float	mAttraction;	// attractive force between particles
var(PclMovement) bool	mColMakeSound;

var(pclBeam)     float  mWaveFrequency;
var(pclBeam)     float  mWaveAmplitude;
var(pclBeam)     float  mWaveShift;
var(pclBeam)     float  mBendStrength;
var(pclBeam)     bool   mWaveLockEnd;

var(Force) bool bForceAffected;

// native stuff.
var transient int	SystemHandle;
var transient int	Expire;

var transient pointer mpParticles; // ptr to tarray
var transient int	mNumActivePcl;
var transient pointer  mpIterator;
var transient int	mbSpinningNodes;
var transient vector mLastPos;
var transient vector mLastVector;
var transient float	mTime;
var transient float	mT; // delta
var transient float  mRegenBias;
var transient float  mRegenTimer;
var transient float  mPauseTimer;
var transient Box	mBounds;
var transient plane	mSphere;
var transient vector mDir;
var transient int	mNumUpdates;
var transient int	mAtLeastOneFrame;
var transient int	mRenderableVerts;
var transient float	mTexU;
var transient float	mTexV;
var transient float  mTotalTiles;
var transient float  mInvTileCols;
var transient pointer	mpSprings; // ptr to Spring class
var transient int	mNumSprings;
var transient float mWavePhaseA;
var transient float mWavePhaseB;

var bool blockOnNet;
var bool bCallPreSpawn;
// v 1.4
var transient int	mHeadIndex;

event CollisionSound(); //amb
event PreSpawned()
{
	if ( !Level.bStartup )
	{
		bSuspendWhenNotVisible = false;
		if ( Level.bDropDetail && (mMaxParticles > 5) 
			&& ((mParticleType == PT_Sprite) || (mParticleType == PT_Mesh) || (mParticleType == PT_Line)) )
		{
			mMaxParticles = mMaxParticles * 0.65;
			mRegenRange[0] *= 0.8;
			mRegenRange[1] *= 0.8;
			mStartParticles = 0.65 * mStartParticles;
		}
	}
}

simulated final function float ClampToMaxParticles(float InPart)
{
	return FMin(InPart, mStartParticles);
}

event Trigger( Actor Other, Pawn EventInstigator )
{
	mRegenPause = !mRegenPause;
}

simulated function UpdatePrecacheMaterials()
{
	if ( mPosColorMapXY != None )
		Level.AddPrecacheMaterial(mPosColorMapXY);
	if ( mPosColorMapXZ != None )
	    Level.AddPrecacheMaterial(mPosColorMapXZ);
	if ( mLifeColorMap != None )
		Level.AddPrecacheMaterial(mLifeColorMap);

	super.UpdatePrecacheMaterials();
}

static function PrecacheContent(LevelInfo Level)
{
	if ( Default.mPosColorMapXY != None )
		Level.AddPrecacheMaterial(Default.mPosColorMapXY);
	if ( Default.mPosColorMapXZ != None )
	    Level.AddPrecacheMaterial(Default.mPosColorMapXZ);
	if ( Default.mLifeColorMap != None )
		Level.AddPrecacheMaterial(Default.mLifeColorMap);
	if ( Default.Skins.Length > 0 )
		Level.AddPrecacheMaterial(Default.Skins[0]);
}

defaultproperties
{
	mParticleType=PT_Sprite
	mSpawningType=ST_Sphere
	mRegen=true
	mRegenPause=false
	mStartParticles=1
	mMaxParticles=50
	mDelayRange(0)=0.0
	mDelayRange(1)=0.0
	mLifeRange(0)=4.000000
	mLifeRange(1)=4.000000
	mRegenRange(0)=1.00000
	mRegenRange(1)=1.00000
	mRegenDist=0.0

	mDirDev=(X=0.0,Y=0.0,Z=0.0)
	mPosDev=(X=0.0,Y=0.0,Z=0.0)
	mMassRange(0)=0.0
	mMassRange(1)=0.0
	mCollision=false
	mRandOrient=false
	mSpinRange(0)=0.0
	mSpinRange(1)=0.0

	mSizeRange(0)=10.00000
	mSizeRange(1)=10.00000
	mSpeedRange(0)=40.00000
	mSpeedRange(1)=40.00000
    mOwnerVelocityFactor=0.0
	mGrowthRate=0.0
	mColorRange(0)=(R=255,G=255,B=255,A=255)
	mColorRange(1)=(R=255,G=255,B=255,A=255)
	mAttenuate=true
	mRandTextures=false
	mTileAnimation=false
	mNumTileColumns=1
	mNumTileRows=1
	mUseMeshNodes=false
	mPosRelative=false
	//mRandMeshes=

	Texture=S_Emitter
	Skins(0)=S_Emitter
	bHiddenEd=false
	bDirectional=true
	SystemHandle=-1

	// inherited vars
    DrawType=DT_Particle
    Style=STY_Normal
	Physics=PHYS_None
	bUnlit=true
	bNetTemporary=true
	bGameRelevant=true
	RemoteRole=ROLE_None

	CollisionRadius=+0.00000
	CollisionHeight=+0.00000
	ScaleGlow=1.0

	// ver 1.1
	mColElasticity=0.5

	// ver 1.2
	mAttenKa=0.2
	mAttenKb=1.0
	mAttenFunc=ATF_LerpInOut
	mAirResistance=0.4

    bCollideActors=false
	bCallPreSpawn=true
    bAcceptsProjectors=false
    
    mSpawnVecB=(X=0.0,Y=0.0,Z=0.05)

    bActorShadows=false
    bForceAffected=false

    LightEffect=LE_QuadraticNonIncidence
    bNetInitialRotation=false

	bSuspendWhenNotVisible=true
	bNotOnDedServer=true
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:28:42.000 - Creation time: Do 14.8.2014 09:58:56.102 - Created with UnCodeX