72 impact.
x = tmp *
Vec3(xform(0,0), xform(0,1), xform(0,2));
73 impact.
y = tmp * Vec3(xform(1,0), xform(1,1), xform(1,2));
74 impact.
z = tmp * Vec3(xform(2,0), xform(2,1), xform(2,2));
82 if (
hits[i].shot == shot) {
90 if (
hits[i].damage <= 0) {
95 if (
hits[i].age > age) {
102 if (slot >= 0 && slot < MAX_SHIELD_HITS) {
109 if (
nhits < MAX_SHIELD_HITS)
121 if (
nhits < 1)
return;
126 if (
hits[i].damage > 0) {
132 if (
hits[i].damage < 10) {
162 int nverts = vset->
nverts;
164 for (
int i = 0; i < nverts; i++) {
169 double all_damage = 0;
171 if (
nhits < 1)
return;
174 if (
hits[i].damage > 0) {
187 for (
int v = 0; v < nverts; v++) {
188 double dist = (vset->
loc[v] - hitloc).length();
194 dist = pow(dist, 2.7);
196 double pert =
Random(0.1, 1.5);
197 double intensity = pert*hitdam/dist;
199 if (intensity > 0.003)
208 double shield_gain = 1;
210 if (all_damage < 1000) {
211 shield_gain = all_damage / 1000;
214 for (
int i = 0; i < nverts; i++) {
218 Vec3 V = vloc * -1.0f;
221 double intensity = 1 - V*vnrm;
224 intensity *= intensity;
226 if (intensity > 1) intensity = 1;
228 intensity *= (shield_gain *
Random(0.75, 1.0));