| 88 | } |
| 89 | |
| 90 | void xLaserBoltEmitter::emit(const xVec3& loc, const xVec3& dir) |
| 91 | { |
| 92 | if (this->bolts.full()) |
| 93 | { |
| 94 | this->bolts.pop_back(); |
| 95 | } |
| 96 | |
| 97 | bolt& b = this->bolts.push_front(); |
| 98 | b.origin = b.loc = loc; |
| 99 | b.dir = dir; |
| 100 | b.dist = b.prev_dist = b.prev_check_dist = 0.0f; |
| 101 | b.hit_dist = cfg.kill_dist; |
| 102 | b.hit_ent = NULL; |
| 103 | b.emitted = 0.0f; |
| 104 | b.context = NULL; |
| 105 | |
| 106 | if (cfg.rand_ang > 0.0f) |
| 107 | { |
| 108 | perturb_dir(b.dir, cfg.rand_ang); |
| 109 | } |
| 110 | |
| 111 | if (cfg.hit_interval > 0) |
| 112 | { |
| 113 | pre_collide(b); |
| 114 | } |
| 115 | |
| 116 | start_collide++; |
| 117 | |
| 118 | effect_data* fx = this->fx[0]; |
| 119 | effect_data* fx_end = fx + this->fxsize[0]; |
| 120 | while (fx != fx_end) |
| 121 | { |
| 122 | emit_fx(*fx, b, 0.0f, 0.0f, (1.0f / 60.0f)); |
| 123 | fx++; |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | void xLaserBoltEmitter::update(F32 dt) |
| 128 | { |
no test coverage detected