jit.phys.hinge (hinge position)

matmat's icon

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

Max Patch
Copy patch and select New From Clipboard in Max.

mathie

Rob Ramirez's icon

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.

matmat's icon

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 !

vincentrieuf's icon

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

Max Patch
Copy patch and select New From Clipboard in Max.

Here is my patch:

Rob Ramirez's icon

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.

vincentrieuf's icon

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.