Page 1 of 1

Some queries about Prismatic joint

Posted: Mon Dec 07, 2015 1:51 am
by maheshkurmi
1. In dyn4j prismatic joint axis is defined in frame of body 1

Code: Select all

   // get the axis in local coordinates
      this.xAxis = body2.getLocalVector(n);
      // get the perpendicular axis

while in box2D it is in frame of body 2
The joint axis is the line along which the bodies can move relative to each other. It is specified in bodyA's local coordinates, so you could think of it as the direction bodyB can move from bodyA's point of view.

Is it intentional?

2. in dyn4j prismatic joint there is single local anchor point (actually in only defined constructor, same world point is used to create two local anchor points), while in box2D there are 2 local points, why it is so?

Re: Some queries about Prismatic joint

Posted: Mon Dec 07, 2015 11:00 am
by William
  1. It wasn't intentional to make the axis fixed in body A or B's space. Instead, it was arbitrarily chosen when I did my own derivation of the joint here.
  2. They look the same to me, am I missing the question? Both dyn4j & box2d (b2PrismaticJointDef::Initialize) accept one world space anchor point and then create, internally, two local space anchor points.

William

Re: Some queries about Prismatic joint

Posted: Tue Dec 08, 2015 11:35 am
by maheshkurmi
Ok got it...
Actually dyn4j does't allow to change local anchor point while box2d does so. What if we want to define local anchor points of both bodies separately, without bringing desired local point to common point.

Meanwhile I have created separate eclipse test project for dyn4j library using graphicsRenderer2D with support for mouse drag zoom etc. Just add dyn4j.jar to its build path.
If you like it , you may make it available publically.
regards..

Re: Some queries about Prismatic joint

Posted: Wed Dec 09, 2015 7:17 am
by William
maheshkurmi wrote:What if we want to define local anchor points of both bodies separately, without bringing desired local point to common point.

What would be the goal for being able to change these?

maheshkurmi wrote:Meanwhile I have created separate eclipse test project for dyn4j library using graphicsRenderer2D with support for mouse drag zoom etc. Just add dyn4j.jar to its build path.
If you like it , you may make it available publically.
regards..

Cool, did you use the new samples framework classes? I really like the ragdolls in the Cyclist sample.

William

Re: Some queries about Prismatic joint

Posted: Wed Dec 09, 2015 12:46 pm
by maheshkurmi
I just created the samples using code exporter in physics simulator I am working on . i will submit few more soon.