-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathparticles-define.bb
115 lines (97 loc) · 3.87 KB
/
particles-define.bb
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
; ********************************************
;
; Single Surface Particle System Definitions
;
; ********************************************
; Two types of particles: 1- for in game coordinates, 2- bound to camera
Global ParticleMesh, ParticleSurface, ParticleMesh2, ParticleSurface2, ParticleTexture
Type Particle
Field Texture ; what cell # in the texture (e.g. 0-63 in an 8x8)
Field x# ; x/y/z position of center
Field y#
Field z#
Field angle# ; angle (0-359 degrees), rotated clockwise
Field size# ; size in units (i.e. diameter)
Field dx# ; dx/dy/dz velocity
Field dy#
Field dz#
Field dangle# ; rotation speed (in degrees, clockwise)
Field dsize# ; change in size
Field ddx# ; ddx/ddy/ddz acceleration
Field ddy#
Field ddz#
Field LifeSpan ; how many cycles does it stick around. Zero = infinite life
Field Timer ; generated from Lifespan: counts down to zero
Field Change ; internal use - optimize what things need to be change in udpate
Field Orient ; 0- point particle to camera,
; 1- vary only horizontally toward camera,
; 2- no change (simply in x/y plane),
; 3- point in direction of camera, but using a single transformation
; based on the straight forward direction of the particle (i.e. all particles
; will point the same way)
End Type
Global NofParticles=0
; 11500 is the estimated max number of particles that my machine allowed before a MAV.
; ~ MNIK
; Upon further inspection, this number seems to differ between machines.
Const MaxNofParticles=10000
Type Particle2
Field Texture ; what cell # in the texture (e.g. 0-63 in an 8x8)
Field x# ; x/y/z position of center
Field y#
Field z#
Field angle# ; angle (0-359 degrees), rotated clockwise
Field size# ; size in units (i.e. diameter)
Field dx# ; dx/dy/dz velocity
Field dy#
Field dz#
Field dangle# ; rotation speed (in degrees, clockwise)
Field dsize# ; change in size
Field ddx# ; ddx/ddy/ddz acceleration
Field ddy#
Field ddz#
Field LifeSpan ; how many cycles does it stick around. Zero = infinite life
Field Timer ; generated from Lifespan: counts down to zero
Field Change ; internal use - optimize what things need to be change in udpate
Field Orient ; 0- point particle to camera,
; 1- vary only horizontally toward camera,
; 2- no change (simply in x/y plane),
; 3- point in direction of camera, but using a single transformation
; based on the straight forward direction of the particle (i.e. all particles
; will point the same way)
End Type
Global NofParticles2=0
; The System pre-calculated transformations (for orient-mode=3, which really should be the default)
; based on the current camera orientation, and 360 rotations of particles (more detail can be easily
; implemented, but should hardly be necessary)
; If the camera angle changes, then these 360 sets are re-calculated
Dim SavedTFormedX1#(360),SavedTFormedY1#(360),SavedTFormedZ1#(360)
Dim SavedTFormedX2#(360),SavedTFormedY2#(360),SavedTFormedZ2#(360)
Global SavedTFormedPitch#,SavedTFormedYaw#,SavedTFormedRoll#
; ***************************
; Text System
; ***************************
; Text is a separate single surface.
Global TextMesh, TextSurface, TextTexture
Type Letter
Field Texture ; what cell # in the texture (e.g. 0-63 in an 8x8)
Field x# ; x/y/z position of center
Field y#
Field z#
Field angle# ; angle (0-359 degrees), rotated clockwise
Field size# ; size in units (i.e. diameter)
Field dx# ; dx/dy/dz velocity
Field dy#
Field dz#
Field dangle# ; rotation speed (in degrees, clockwise)
Field dsize# ; change in size
Field ddx# ; ddx/ddy/ddz acceleration
Field ddy#
Field ddz#
Field LifeSpan ; how many cycles does it stick around. Zero = infinite life
Field Timer ; generated from Lifespan: counts down to zero
Field Change ; internal use - optimize what things need to be change in udpate
Field Red
Field Green
Field Blue
End Type