fixed bug in swapObjects an added setVectorDirAndUp