How to define this simulation/collision example?

I am somehow not able to define this - but I think it should be easily possible:

I have a cylinder (grey in the attached screenshot) connected to another cylinder (the hinge, red).
When the (red) hinge moves to a new position, the connected cylinder moves with it. Through the movement the grey cylinder hits an obstacle (the cube), and the collision forces it to rotate around the hinge. (Now I want to read the new cylinder position/rotation).

Many thanks for your help!
Screenshot and .blend attached.

/uploads/default/original/4X/3/c/8/3c87124947e68a8f6d1806980d2cf9bf7a171942.pngstc=1
simul_coll_example.blend (513 KB)

Attachments


You have no physics set up at all right now and you aren’t in the BGE.

How are you planning to move the cylinders? If they’re going to interact with the cube, you need the cube to be static but the cylinders should be set to rigid body or dynamic in order for them to be affected by the cube (or the other way around). You also need to take into consideration that non-static objects will succumb to gravity, so you have to attach them to something so they don’t just drop out of the scene.

If you Join the grey cylinder to the red one so the red’s origin is maintained, you can use it’s rotation values.