修复ArcadeRigidbody不触发OnEntityTransform事件

This commit is contained in:
yhh
2021-05-28 08:41:38 +08:00
parent 561a44b26b
commit 88f9779dd0
7 changed files with 55 additions and 52 deletions

View File

@@ -100,7 +100,7 @@ module es {
* @param layerMask
*/
public static boxcastBroadphaseExcludingSelfNonRect(collider: Collider, layerMask = this.allLayers) {
let bounds = collider.bounds.clone();
let bounds = collider.bounds;
return this._spatialHash.aabbBroadphase(bounds, collider, layerMask);
}
@@ -112,7 +112,7 @@ module es {
* @param layerMask
*/
public static boxcastBroadphaseExcludingSelfDelta(collider: Collider, deltaX: number, deltaY: number, layerMask: number = Physics.allLayers) {
let colliderBounds = collider.bounds.clone();
let colliderBounds = collider.bounds;
let sweptBounds = colliderBounds.getSweptBroadphaseBounds(deltaX, deltaY);
return this._spatialHash.aabbBroadphase(sweptBounds, collider, layerMask);
}

View File

@@ -225,7 +225,7 @@ module es {
*/
public overlapRectangle(rect: Rectangle, results: Collider[], layerMask: number) {
this._overlapTestBox.updateBox(rect.width, rect.height);
this._overlapTestBox.position = rect.location;
this._overlapTestBox.position = rect.location.clone();
let resultCounter = 0;
let potentials = this.aabbBroadphase(rect, null, layerMask);
@@ -265,7 +265,7 @@ module es {
let bounds = new Rectangle(circleCenter.x - radius, circleCenter.y - radius, radius * 2, radius * 2);
this._overlapTestCircle.radius = radius;
this._overlapTestCircle.position = circleCenter;
this._overlapTestCircle.position = circleCenter.clone();
let resultCounter = 0;
let potentials = this.aabbBroadphase(bounds, null, layerMask);