How to rotate an object toward mouse cursor?
so far i tried this code, but the object not rotate correctly
update:function{
var mousePos = me.input.globalToLocal(me.input.pointer.clientX,me.input.pointer.clientY);
var angle = this.angleToPoint(new me.Vector2d(mousePos.x, mousePos.y));
this.renderable.currentTransform.rotate(angle - this.PrevAngle);
this.PrevAngle = angle;
}
Thanks