Quaternion - Stuck at rotating past 180 - Use: Pendulum that rotates with user input


I'm trying to write a pendulum that rotates with user input.

The pendulum is a child of another object. I use the parent to place the pendulum in World Space and set it's direction. The base of the pendulum is thus placed at the same point as the parent object, and is 10m long.

I have a working code with rotational gravity. It works fine. Except that the pendulum doesn't rotate a full loop, instead, it stops at 180.

Analogy: 180 = 12:00: coming from 11:55, it doesn't rotate to 12:05. Instead it stops at 12:00, even with it's angular acceleration pushing it forward. Same goes rotation counter-clockwise.

Here's the code I have working: (I attached a picture because I don't know how to paste formatted code) alt text

1: Uploaded with ImageShack.us

Any help is greatly appreciated. I'm cracking my head over this for the past week... @_@


Are you including the term: speed by time (wot)? I see that's missing. Acceleration for 180 is 0, and the pendullum remains if no speed.

I’ve been trying to implement the speed by time component for this and I’m having a hard time knowing where to start. Any help would be appreciated.