1
/*jslint indent: 4, maxlen: 120, maxerr: 50, white: true, es5: true, undef: true, bitwise: true, regexp: true,
3
/*jshint es5: true, undef: true, bitwise: true, eqnull: true, noempty: true, eqeqeq: true, boss: true, loopfunc: true,
4
laxbreak: true, strict: true, curly: true */
5
/*global oolite, Timer, addFrameCallback, removeFrameCallback, isValidFrameCallback */
1
/*jslint indent: 4, maxlen: 120, maxerr: 50, white: true, es5: true, undef: true, regexp: true, newcap: true */
2
/*jshint es5: true, undef: true, eqnull: true, noempty: true, eqeqeq: true, boss: true, loopfunc: true, laxbreak: true,
3
strict: true, curly: true */
4
/*global Timer, addFrameCallback, removeFrameCallback, isValidFrameCallback */
7
6
/* Jaguar Company Tracker
226
225
/* Vector pointing towards the target. */
227
226
vector = cps.position.subtract(PS.position).direction();
229
if (vector.dot(PS.heading) >= 0 && !p_tracker.material) {
228
if (vector.dot(PS.heading) >= 0) {
229
p_tracker.material = 0;
231
p_tracker.material = 1;
234
if (!p_tracker.material) {
230
235
/* Change the tracker colour to be green. */
231
236
tracker.setMaterials({
232
237
jaguar_company_tracker : {
237
242
specular_color : ["0", "0.2", "0", "1"]
240
p_tracker.material = 1;
241
} else if (vector.dot(PS.heading) < 0 && p_tracker.material) {
245
} else if (p_tracker.material) {
242
246
/* Change the tracker colour to be red. */
243
247
tracker.setMaterials({
244
248
jaguar_company_tracker : {