hi cyrille, I was playing around with some collisions and found a strange behaviour which looks buggy to me. I was shooting a sqare against a circle and at some points the rebound went to strange directions. I tried to make a debug patch to show this behaviour (circle_testpmp.pd) you will also need the other abstraction to run it. If someone else wants to look at it, please do! thanks for any help, or corrections. (btw. I also found this strange behaviour with rebounds from lines, so maybe it is not a bug, but I am just doin something wrong). marius.
marius schebella a écrit :
hi cyrille, I was playing around with some collisions and found a strange behaviour which looks buggy to me.
that look buggy to me. but the bug is not in pmpd, neither in your patch, it's just the pmpd physics that is an aproximation of reality. but this can be tix easilly. in fact some parametters are not well adjusted.
I was shooting a sqare against a circle and at some points the rebound went to strange directions.
it's not square : the masses have no size. better to see them as small sphere.
I tried to make a debug patch to show this behaviour (circle_testpmp.pd) you will also need the other abstraction to run it. If someone else wants to look at it, please do! thanks for any help, or corrections. (btw. I also found this strange behaviour with rebounds from lines, so maybe it is not a bug, but I am just doin something wrong).
in fact, you send a big force to the masses when it interact with the green circle. and you also have a very big rigidity of the same green circle. this made the small masse to interact with the circle for only 1 iteration, but somtime 2. it receive lot's more force when interacting 2 time better than 1 time. so the movement was diferents. the problem comme from the time discretitation that is only an aproximation.
i remove the normal force, and reduce normal rigidity in order to allow a "better" interaction.
look like working great now.
cyrille
marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 36 46 810 814 10; #X msg 199 747 0 , destroy; #X msg 71 615 bang; #X obj 65 639 s mari; #X msg 98 511 bang; #X obj 64 547 loadbang; #X obj 141 660 loadbang; #X msg 141 685 dimen 600 600 , create , 1; #X msg 204 517 bang; #X obj 388 671 color 0 1 0; #X obj 388 644 gemhead 49; #X msg 67 511 0; #X obj 588 573 s $0-l; #X obj 223 545 r $0-l; #X obj 388 735 circle 1; #X msg 588 543 setY $1; #X obj 141 709 gemwin 25; #X obj 588 515 line; #X floatatom 498 488 5 0 0 0 - - -; #X obj 498 276 vsl 15 201 -1 1 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 6300 1; #N canvas 0 0 459 428 blur 0; #X obj 73 31 gemhead -1; #X obj 76 108 t b a; #X obj 87 145 pix_snap2tex; #X obj 189 109 loadbang; #X obj 189 133 t b b; #X msg 189 158 0 0; #X msg 219 158 600 600; #X obj 89 181 alpha; #X obj 89 219 colorRGB 1 1 1 0.888; #X obj 93 261 square 4; #X floatatom 242 202 5 0 0 0 - - -; #X obj 76 79 spigot 1; #X obj 192 28 inlet; #X connect 0 0 11 0; #X connect 1 0 2 0; #X connect 1 1 2 0; #X connect 2 0 7 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 5 0 2 1; #X connect 6 0 2 2; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 10 0 8 4; #X connect 11 0 1 0; #X connect 12 0 11 1; #X restore 60 700 pd blur; #X obj 388 703 translateXYZ 1 0.5 0; #X msg 563 243 0.5; #X obj 563 216 loadbang; #X obj 471 271 cnv 15 20 210 empty empty MOVE_HERE! -80 -12 0 14 -24198 -66577 0; #X text 373 72 testpatch:; #X text 374 90 schiess1 shoots a square against the green circle; #X text 374 160 why???; #X obj 60 674 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X floatatom 668 544 5 0 0 0 - - -; #X msg 588 492 $1 300; #X text 374 110 when you move the circle you will get some inconsistency in the reflexion , at some values , for example between 0.7 and 0.75 , but also at some other values.; #X obj 65 592 t b b; #X obj 223 576 iCircle2D mari 1 0.5 0 1 0 0 1; #X obj 65 571 metro 5; #X obj 195 369 schiess1 -3 0 2300; #X obj 54 39 schiess1 -3 0 0; #X obj 54 69 schiess1 -3 0 200; #X obj 55 98 schiess1 -3 0 400; #X obj 54 129 schiess1 -3 0 600; #X obj 55 158 schiess1 -3 0 800; #X obj 55 189 schiess1 -3 0 1000; #X obj 56 218 schiess1 -3 0 1200; #X obj 55 249 schiess1 -3 0 1400; #X obj 56 278 schiess1 -3 0 1600; #X obj 55 308 schiess1 -3 0 1800; #X obj 55 339 schiess1 -3 0 2000; #X obj 55 369 schiess1 -3 0 2200; #X obj 193 39 schiess1 -3 0 100; #X obj 194 69 schiess1 -3 0 300; #X obj 195 98 schiess1 -3 0 500; #X obj 194 129 schiess1 -3 0 700; #X obj 195 158 schiess1 -3 0 900; #X obj 195 189 schiess1 -3 0 1100; #X obj 196 218 schiess1 -3 0 1300; #X obj 195 249 schiess1 -3 0 1500; #X obj 196 278 schiess1 -3 0 1700; #X obj 195 308 schiess1 -3 0 1900; #X obj 195 339 schiess1 -3 0 2100; #X connect 0 0 15 0; #X connect 1 0 2 0; #X connect 3 0 33 0; #X connect 4 0 33 0; #X connect 5 0 6 0; #X connect 6 0 15 0; #X connect 7 0 32 0; #X connect 8 0 20 0; #X connect 9 0 8 0; #X connect 10 0 33 0; #X connect 12 0 32 0; #X connect 14 0 11 0; #X connect 16 0 14 0; #X connect 16 0 20 2; #X connect 16 0 28 0; #X connect 18 0 17 0; #X connect 18 0 29 0; #X connect 20 0 13 0; #X connect 21 0 18 0; #X connect 22 0 21 0; #X connect 27 0 19 0; #X connect 29 0 16 0; #X connect 31 0 2 0; #X connect 31 1 32 0; #X connect 33 0 31 0;