[Behavior] Box2D+ (asm.js r2.3.0; v2.0)

Post your completed addons to share with the community

Post » Thu Dec 21, 2017 4:29 pm

@Colludium Thanks for the pyramid demo! ;)
B
30
S
12
G
3
Posts: 683
Reputation: 5,108

Post » Sat Dec 30, 2017 12:45 pm

@Colludium
Pls, view capx https://drive.google.com/file/d/1LZ4PB_ ... sp=sharing
Why does the sprite4 in events 1,2,3 not get impulse?
B
44
S
25
G
25
Posts: 85
Reputation: 16,424

Post » Sat Dec 30, 2017 1:31 pm

Hi @gameba. The impulse data is only available after the collision and response have been calculated by the Box2D+ library, and that information is only available at On End-Contact. The Box2D+ World steps many times each tick. The On Begin-Contact indicates when a World step first notes that a collision must be resolved. Each Pre-Solve and Post-Solve then mark the beginning and end of each collision calculation step. Many such calculations will take place for each two colliding objects. Thus, a collision's triggers might look something like:

  • On Begin-Contact
  • On Pre-Solve
  • On Post-Solve
  • On Pre-Solve
  • On Post-Solve
  • On Pre-Solve
  • On Post-Solve
  • On End-Contact

The impulse (momentum change) inside a collision can only be resolved once the final collision velocity is available, and that is at the End-Contact. Hope this explains it?
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,417
Reputation: 57,671

Post » Mon Jan 01, 2018 3:47 am

Please, Help @Colludium
when I press restart button after destroying the link sprite, I received a bug (view video here https://youtu.be/fto53dyGiH4)

CAPX HERE: https://drive.google.com/file/d/0B8g2b8 ... sp=sharing

HAPPY NEW YEAR!
B
44
S
25
G
25
Posts: 85
Reputation: 16,424

Post » Mon Jan 01, 2018 7:24 am

Hi @gameba - Happy New Year to you too!

I took a look at your capx - weird problem caused by the layout restart. I suspect that it was a combination of the Box2D+ library not coping with the destruction and recreation of a large number of recycled objects all at once. You see, when you set an object to Box2D+ Enabled then the body is destroyed and then recreated, including all joint references. The bug was caused after the layout had restarted.

Here's a capx that contains the fix. The link object default is set Box2D+ Disabled, then - in the joint creation loop - there is a check that the links are disabled before they are set enabled. Before, the links were set enabled twice, once by reference through the family and then in the next loop iteration by reference directly by the link object condition.
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,417
Reputation: 57,671

Post » Mon Jan 01, 2018 8:01 am

Colludium wrote:Hi @gameba - Happy New Year to you too!

I took a look at your capx - weird problem caused by the layout restart. I suspect that it was a combination of the Box2D+ library not coping with the destruction and recreation of a large number of recycled objects all at once. You see, when you set an object to Box2D+ Enabled then the body is destroyed and then recreated, including all joint references. The bug was caused after the layout had restarted.

Here's a capx that contains the fix. The link object default is set Box2D+ Disabled, then - in the joint creation loop - there is a check that the links are disabled before they are set enabled. Before, the links were set enabled twice, once by reference through the family and then in the next loop iteration by reference directly by the link object condition.


OK, thank you for your support :D !
B
44
S
25
G
25
Posts: 85
Reputation: 16,424

Post » Mon Jan 01, 2018 12:36 pm

@Colludium
I found a bug in action "Velocity clamp", Its not work, nothing happens after you enable velocity clamp.

p/s:
I think you forgot add uid parameter at line 1683 in runtime.js file.

I added uid param and it is working now
Code: Select all
this.setVelocity(new_vx, new_vy)   ----> this.setVelocity(this.inst.uid, new_vx, new_vy)
B
44
S
25
G
25
Posts: 85
Reputation: 16,424

Post » Mon Jan 01, 2018 1:21 pm

Thanks @gameba - good find!

Update published - bug fix - now v 1.16.
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,417
Reputation: 57,671

Post » Wed Jan 17, 2018 5:00 am

@Colludium
Event "end contact with" doesn't work, pls view capx.
https://drive.google.com/file/d/11Yz_8Z ... sp=sharing
B
44
S
25
G
25
Posts: 85
Reputation: 16,424

Post » Wed Jan 17, 2018 5:54 am

@gameba - thanks for the bug report! I'll take a look and get back to you as soon as I can.

Edit - I have a fix, I should have it all ready later today.
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,417
Reputation: 57,671

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: fbarraza28 and 0 guests