fixed bug when rotate and move object, just need to implement a global class to use it as a global variable