Mercurial > projects > chipmunkd
comparison trunk/tests/ChipmunkDemos/samples/MagnetsElectric.d @ 25:5497d518b428
fixed memory corruption bug
author | Extrawurst |
---|---|
date | Mon, 13 Dec 2010 02:31:53 +0100 |
parents | af2f61a96318 |
children |
comparison
equal
deleted
inserted
replaced
24:ee7fa417266b | 25:5497d518b428 |
---|---|
354 | 354 |
355 // The position and angle could be different form the one of the body | 355 // The position and angle could be different form the one of the body |
356 charge.position[0]=cpvzero; | 356 charge.position[0]=cpvzero; |
357 charge.Gpos[0]=cpvadd(p,charge.position[0]); | 357 charge.Gpos[0]=cpvadd(p,charge.position[0]); |
358 charge.Gangle[0]=0; | 358 charge.Gangle[0]=0; |
359 charge.angle[0]=0.0f; | |
359 | 360 |
360 charge.force_func[0]=&CoulombForce; | 361 charge.force_func[0]=&CoulombForce; |
361 charge.torque_func[0]=null; | 362 charge.torque_func[0]=null; |
362 | 363 |
363 _body.data=charge; | 364 _body.data=charge; |
401 mix.Gpos[0]=cpvadd(p,mix.position[0]); | 402 mix.Gpos[0]=cpvadd(p,mix.position[0]); |
402 mix.position[1]=cpvzero; | 403 mix.position[1]=cpvzero; |
403 mix.Gpos[1]=cpvadd(p,mix.position[1]); | 404 mix.Gpos[1]=cpvadd(p,mix.position[1]); |
404 mix.Gangle[0]=ang; | 405 mix.Gangle[0]=ang; |
405 mix.Gangle[1]=ang; | 406 mix.Gangle[1]=ang; |
407 mix.angle[0]=0.0f; | |
408 mix.angle[1]=0.0f; | |
406 | 409 |
407 mix.force_func[0]=&MagDipoleForce; | 410 mix.force_func[0]=&MagDipoleForce; |
408 mix.force_func[1]=&CoulombForce; | 411 mix.force_func[1]=&CoulombForce; |
409 mix.torque_func[0]=&MagDipoleTorque; | 412 mix.torque_func[0]=&MagDipoleTorque; |
410 mix.torque_func[1]=null; | 413 mix.torque_func[1]=null; |