Skip to content

Commit 607dd9f

Browse files
committed
- fix
1 parent 695c544 commit 607dd9f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/particle_system_rb.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ <h3>4. Time integration</h3>
140140
this.timeStepSize = 0.05;
141141
this.time = 0;
142142
this.maxLifeTime = 3;
143-
this.bodyEmission = 5;
143+
this.rbEmission = 5;
144144
this.emitter_x = 0.0;
145145
this.emitter_y = 0.0;
146146
}
147147

148148
emitRigidBodies()
149149
{
150150
// emit new rigid bodies
151-
for (let i = 0; i < this.bodyEmission; i++)
151+
for (let i = 0; i < this.rbEmission; i++)
152152
{
153153
// use random variation of velocity
154154
let vx = -5 + Math.random()*10.0;
@@ -287,8 +287,9 @@ <h3>4. Time integration</h3>
287287

288288
this.c.save();
289289
this.c.beginPath();
290-
this.c.translate(px-s2, py-s2);
290+
this.c.translate(px, py);
291291
this.c.rotate(rb.rotation);
292+
this.c.translate(-s2, -s2);
292293
this.c.rect(0, 0, s, s);
293294
this.c.closePath();
294295
this.c.fill();

0 commit comments

Comments
 (0)