# Pendulum / hanging node

I'm working on a crane simulator, and for that I was planning using jME Physics 2. I have made some attempts but not sucseeded in simulating a hanging node.

Attempt #1 (based on the hanging sphere in tutorial 7)

crated a DynamicPhysicsNode ("hook") and added it to the root_node of jME

crated a Joint

created a RotationalJointAxis with the degree of fredom rotate around x based on the Joint

attached the DynamicPhysicsNode to the RotationalJointAxis

in each update() do a Joint.setAnchor(cranetip.getWorldTranslation())

==Strange things happen==

Attempt #2

same as #1 but added two more degree of fredom to the "wire"

-two more joints and a RotationalJointAxis and a TransationalJointAxis connected together by dummy DynamicPhysicsNodes

==Even more strange things happen==

Attempt #3 (based on the connected boxes in tutorial 7)

crated a StaticPhysicsNode ("cranetip") and added it to the cranetip_node of jME

(cranetip is a node that is always level)

crated a DynamicPhysicsNode ("wire_start") and added it to the root_node of jME

crated a DynamicPhysicsNode ("hook") and added it to the root_node of jME

crated a Joint

created a TransationalJointAxis with the degree of fredom -y based on the Joint

set the minDistance on TransationalJointAxis to -10 and maxDistance to 0

put the "wire_start" on top of "cranetip"

put the "hook" below "cranetip"

==wire_start slides off==

Attempt #4

same as #3 but creating a closed box out of 6 StaticPhysicsNodes at the cranetip

==wire start jumps out of the closed box

Any suggestions for my next attempts, or is there a best practics?

after som more attempts I have endet up with the following

The basics:

-A closed box put together by 6 StaticPhysicsNodes

-A DynamicPhysicsNode sphere inside of the closed box

-A DynamicPhysicsNode box as a hook

-The two DynamicPhysicsNodes connected by a Joint and a TranslationalJointAxis

In a more advanced setup I’ve added several Joints using both TranslationalJointAxis and RotationalJointAxis for each joint.

The best aproach would have been if I could connect one end of the Joint to a StaticDynamicNode. Why I cannot do that is a mystery to me.

Also it should be possible to set a friction in each RotationalJointAxis

I never used Joints much yet, does a FrictionCallback not help ?

The best aproach would have been if I could connect one end of the Joint to a StaticDynamicNode. Why I cannot do that is a mystery to me.

Since a StaticPhysicsNode doesn't move, you can just keep the joint locked in space.
Since a StaticPhysicsNode doesn't move, you can just keep the joint locked in space.

I could have connected a StaticPhysicsNode to the crane tip and make it move since the crane is a part of the scene graph that moves in relation to the world coordinates.

Now I am trying to make a DynamicPhysicsNode not fall to the ground, but hold steady in the crane tip
Core-Dump said:

I never used Joints much yet, does a FrictionCallback not help ?

I will try that!