-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuEffects.pas
77 lines (62 loc) · 1.58 KB
/
uEffects.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
unit uEffects;
interface
uses
GLScene, GLObjects, GLParticleFX, GLFireFX, GLPerlinPFX, GLColor,
Classes, GLMaterial;
type
TFireEffect = class (TGLDummyCube)
public
Manager: TGLFireFXManager;
Run: Boolean;
procedure Init;
end;
function AddIceVapour(CollisionsList: TList; Scene: TGLScene; FManager: TGLParticleFXManager; x,y: Integer): TGLPlane;
implementation
//* TFireEffect *//
procedure TFireEffect.Init;
begin
Manager:= TGLFireFXManager.Create(nil);
with Manager do
begin
Disabled:= True;
InnerColor.Color:= clrWhite;
OuterColor.Color:= clrGray;
ParticleLife:= 10;
ParticleSize:= 5;
FireBurst:= 1;
FireBurst:= 0;
FireDensity:= 0.5;
FireRadius:= 0.5;
MaxParticles:= 124;
end;
GetOrCreateFireFX(Self).Manager:= Manager;
end;
function AddIceVapour(CollisionsList: TList; Scene: TGLScene; FManager: TGLParticleFXManager; x,y: Integer): TGLPlane;
var
Eff: TGLPlane;
begin
Eff:= TGLPlane(Scene.Objects.AddNewChild(TGLPlane));
Eff.Tag:= 503;
//Eff.Visible:= False;
Eff.Material.BlendingMode:= bmTransparency;
Eff.Material.FrontProperties.Diffuse.Alpha:= 0;
with GetOrCreateSourcePFX(Eff) do
begin
Manager:= FManager;
EffectScale:= 0.2;
InitialVelocity.Y:= 20;
InitialPosition.Y:= -3.2;
ParticleInterval:= 0.01;
PositionDispersion:= 2;
PositionDispersionRange.SetPoint(0.5,0,0);
VelocityDispersion:= 1;
RotationDispersion:= 0;
Enabled:= True;
end;
Eff.Scale.Y:= 5;
Eff.Scale.X:= 0.5;
Eff.Position.SetPoint(x,y + 2.5,0);
CollisionsList.Add(Eff);
Result:= Eff;
end;
end.