Closed qsrahman closed 9 years ago
Although I have tested the change but still there may be some side effects. also the hitTestRectangle in plugins.js will need to be changed to: ``javascript if(global) { vx = (r1.worldX + r1.halfWidth) - (r2.worldX + r2.halfWidth); vy = (r1.worldY + r1.halfHeight) - (r2.worldY + r2.halfHeight); vx = (r1.worldX + (r1._width * r1.pivotX) + (1 - 2 * r1.pivotX) * r1.halfWidth) - (r2.worldX + (r2._width * r2.pivotX) + (1 - 2 * r2.pivotX) * r2.halfWidth); vy = (r1.worldY + (r1._height * r1.pivotY) + (1 - 2 * r1.pivotY) * r1.halfHeight) - (r2.worldY + (r2._height * r2.pivotY) + (1 - 2 * r2.pivotY) * r2.halfHeight); } else { vx = r1.centerX - r2.centerX; vy = r1.centerY - r2.centerY; }
Thanks! I will run some test on this and get back to you! :)
Although I have tested the change but still there may be some side effects. also the hitTestRectangle in plugins.js will need to be changed to: ``javascript if(global) { vx = (r1.worldX + r1.halfWidth) - (r2.worldX + r2.halfWidth); vy = (r1.worldY + r1.halfHeight) - (r2.worldY + r2.halfHeight); vx = (r1.worldX + (r1._width * r1.pivotX) + (1 - 2 * r1.pivotX) * r1.halfWidth) - (r2.worldX + (r2._width * r2.pivotX) + (1 - 2 * r2.pivotX) * r2.halfWidth); vy = (r1.worldY + (r1._height * r1.pivotY) + (1 - 2 * r1.pivotY) * r1.halfHeight) - (r2.worldY + (r2._height * r2.pivotY) + (1 - 2 * r2.pivotY) * r2.halfHeight); } else { vx = r1.centerX - r2.centerX; vy = r1.centerY - r2.centerY; }