Forums > Jitter

jit.phys.hinge (hinge position)


Oct 29 2011 | 1:34 am

Hi ,

Is there any command for getting the hinge position ?
i don’t understand the relaxation function ?
——
even more, it would be cool if jit.phys.body had a plane shape mode (there is no error when i write @shape plane on the object, but the scale doesn’t work….)

thanks

mathie


-- Pasted Max Patch, click to expand. --

Oct 29 2011 | 7:09 pm

hi mathie.
thanks for the patch, comments and questions.

positions for hinges (and all constraints) varies depending on the context.
if a hinge is connected to a single body, the @position2 attribute will give the world space position of the hinge.

if two bodies are connected, a single hinge position is not defined, but rather two positions that are relative to the position of the attached bodies. the hinge’s "job" in this case is to keep those two positions joined.

i could add extra attributes that would be the worldspace position and orientation of a constraint, calculated from body1 position and hinge position1 attributes. that sounds like it would be useful, so thanks for the suggestion.

the @relaxation only affects when limits are applied to the hinge, and help determine the strength of the limits.

phys.body plane shape is simply a cube shape with a single dimension collapsed to close to 0, as you’ve done in your patch.

Oct 31 2011 | 1:05 pm

Thanks for the info

yes, getting the hinge position and orientation could be very usefull, like mapping the hinges positions to nurbs….

Max6 is great !

Jun 10 2014 | 9:15 am

Hello,
I am actually playing with hinges. I have encountered 2 problems
1. the hinge angle does not update in real time is an input, even though controlling it does not set the hinge angle (I would have suspected it to be an output).
2. when using motor strenght with motor target to set a hinge angle I get an aquard movement when my object reaches the desired angle.

Has anyone experienced those problems. How can I simply program an object to be set at a givent angular position from an other one?

Bests

Here is my patch:


-- Pasted Max Patch, click to expand. --

  • This reply was modified 1 year by  vincentrieuf.
  • This reply was modified 1 year by  vincentrieuf.
  • This reply was modified 1 year by  vincentrieuf.
  • This reply was modified 1 year by  Rob Ramirez. Reason: please use copy-compressed
Jun 12 2014 | 7:24 am

1. the hinge angle does not update in real time is an input, even though controlling it does not set the hinge angle (I would have suspected it to be an output).

to retrieve the current hinge angle, send the message "gethingeangle" to the phys.hinge, and connect a "route hingeangle" to the dumpout.

2. when using motor strenght with motor target to set a hinge angle I get an aquard movement when my object reaches the desired angle.

sorry, i’m not sure what you are saying.

Jun 13 2014 | 1:10 am

Thx for the answer.

I found a work around calculating the polar coordinates of my rotating object and ticking the kinetic box of the jit.body.

Giving an angle thus sets my X, Y coordinates and the angle (xyzrotation) of this object.

Simple and keeps the physics properties of the object while supressing the forces to which it is submitted.

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > Jitter