MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / emit

Method emit

src/SB/Core/x/xLaserBolt.cpp:90–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void 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
127void xLaserBoltEmitter::update(F32 dt)
128{

Callers 2

emit_decalMethod · 0.45
emit_decal_distMethod · 0.45

Calls 3

push_frontMethod · 0.80
fullMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected