[beh] Box2d+ (2.3.0 emscripten) [update: 2017-11-18]

Post your work in progress addons and get feedback

Post » Tue Oct 03, 2017 4:16 pm

@Colludium - That custom collision box drawing is awesome. Can that be done at runtime? to build / change collision box shapes on the fly?
B
88
S
44
G
16
Posts: 1,009
Reputation: 17,971

Post » Tue Oct 03, 2017 6:04 pm

justifun wrote:@Colludium - That custom collision box drawing is awesome. Can that be done at runtime? to build / change collision box shapes on the fly?


Thanks! Yes it can. I have an example where you can draw shapes - follow this link then click on the button at bottom left ("Draw Shapes") and you can see it in action. The hull is contained in an array of vertices that can be loaded directly into the plugin to form the outline (it loads as array.AsJSON). The plugin will include a capx of the editor and it will also have instructions that explain how to use it.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Fri Oct 06, 2017 9:40 pm

Instructions!

The plugin will be ready in the next couple of days!
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Sat Oct 07, 2017 6:21 am

Is there way to retrieve joint data?
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Sat Oct 07, 2017 8:23 am

Unfortunately, @Prominent, there are no methods in the library I am using to enable access to the emscripten joint reaction force values.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Sat Oct 07, 2017 6:20 pm

This looks fantastic, can't wait to give it a try.
Thank you very much for the great work!
B
4
Posts: 1
Reputation: 202

Post » Sat Oct 07, 2017 6:26 pm

Colludium wrote:Unfortunately, @Prominent, there are no methods in the library I am using to enable access to the emscripten joint reaction force values.

what about joint attachment x,y positions, and joint object uids?
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Sat Oct 07, 2017 6:51 pm

@Prominent. I could add those easily, I think. What would you like to be able to do? Use a joint tag to get the UIDs of those attached by the joint, get UIDs of other objects attached to an object, get joint X and y positions by tag?
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Sun Oct 08, 2017 5:10 am

Might be worth looking at the chipmunk plugin. It has a ton of features for working with joints.
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Sun Oct 08, 2017 2:18 pm

@Prominent - good advice. I've now added the following expressions:

  • Joint anchor X. The anchor x position of the joint on this body.
  • Joint anchor Y. The anchor y position of the joint on this body.
  • Joint Type. The type of joint, using Box2D labelling. 0=unknown, 1=revolute, 2=prismatic, 3=distance, 4=pulley, 6=gear, 7=wheel, 8=weld.
  • Other UID. The UID of the other object connected in this joint.
  • Joint other anchor X. The anchor x position of the joint on the other body.
  • Joint other anchor Y. The anchor y position of the joint on the other body.
  • Joint anchor distance. The distance between the anchor points for each body in this joint.
  • Joint ratio. For gear and pulley joints, returns the joint's ratio.
  • Damping coefficient. For distance and wheel joints, returns the joint's damping coefficient.
  • Spring frequency. For distance and wheel joints, returns the joint's spring frequency.
  • Distance joint length. Returns the natural length of a distance joint.
  • Revolute angle limit. Returns the +/-angle limit, if set. Returns -1 if no limit is set.
  • Joint count. The number of joints on this object.
  • Joint type at Index. The type of joint at Index in the joint list for this object. 0=unknown, 1=revolute, 2=prismatic, 3=distance, 4=pulley, 6=gear, 7=wheel, 8=weld.
  • Tag at Index. The tag of a joint at Index in the joint list for this object.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

PreviousNext

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests