Restrict Direction of rotation in Realtime
<p>have a hand of clock which the player once starts rotating (Dragging) CCW until he completes one full rotation. ( Without lifting drag )</p>

<p>I am trying to lock the rotation to only CCW direction while/once the player starts rotating. I got help from the following links : [Detect Direction][1] by @BobBobson108</p>

<p>Here is gif of what is actually happening: <a href="http://giphy.com/gifs/3o6ozwvQJxLZPCx5Oo" rel="nofollow">Demo</a></p>

<pre><code>void OnMouseDrag()
 {
     //rotation
     Vector3 mousePos = Input.mousePosition;
     mousePos.z = 5.23f;        

     Vector3 objectPos = Camera.main.WorldToScreenPoint(transform.position);        
     mousePos.x = mousePos.x - objectPos.x;
     mousePos.y = mousePos.y - objectPos.y;
     angle = Mathf.Atan2(mousePos.y, mousePos.x) * Mathf.Rad2Deg;
     transform.rotation = Quaternion.Euler(new Vector3(0, 0, angle - 90f));


     hand_vector = transform.up;
     cross_product = Vector3.Cross(ref_vector, hand_vector);
     dot_product = Vector3.Dot(cross_product, transform.forward*-1);
     //Debug.Log("Hand Vector: " + hand_vector);
     //Debug.Log("Ref Vector: " + ref_vector);
     Debug.Log(cross_product);
     Debug.Log(dot_product);
 }
</code></pre>

<p>I tried to debug the values of the cross product, but the direction of resultant vector seems to be same even when when the player starts backward rotation.</p>

<p>Also the cross product vector changes direction only when the player starts rotation in CW direction from the default position i.e. 12 'o clock.</p>

<p>I have very less experience of working with Quaternions and rotations. Any help will be highly helpful. Thanks !!!</p>

<p><a href="http://i.stack.imgur.com/ufbrw.png" rel="nofollow">Desired</a></p>