From 40329d27aa0b8fd0fed643348c7278e001da3aa0 Mon Sep 17 00:00:00 2001 From: Steven Yau Date: Thu, 27 May 2021 15:11:41 +0100 Subject: [PATCH] fix computeAABB orientation mult #433 https://github.com/schteppe/cannon.js/pull/433/files --- src/collision/Ray.js | 2 ++ src/objects/Body.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/collision/Ray.js b/src/collision/Ray.js index 4cbaf353b..d0a235108 100644 --- a/src/collision/Ray.js +++ b/src/collision/Ray.js @@ -109,6 +109,8 @@ Ray.prototype.intersectWorld = function (world, options) { this.skipBackfaces = !!options.skipBackfaces; this.collisionFilterMask = typeof(options.collisionFilterMask) !== 'undefined' ? options.collisionFilterMask : -1; this.collisionFilterGroup = typeof(options.collisionFilterGroup) !== 'undefined' ? options.collisionFilterGroup : -1; + this.checkCollisionResponse = typeof(options.checkCollisionResponse) !== 'undefined' ? options.checkCollisionResponse : true; + if(options.from){ this.from.copy(options.from); } diff --git a/src/objects/Body.js b/src/objects/Body.js index 671905db3..6f2bf75ec 100644 --- a/src/objects/Body.js +++ b/src/objects/Body.js @@ -664,7 +664,7 @@ Body.prototype.computeAABB = function(){ offset.vadd(this.position, offset); // Get shape world quaternion - shapeOrientations[i].mult(bodyQuat, orientation); + bodyQuat.mult(shapeOrientations[i], orientation); // Get shape AABB shape.calculateWorldAABB(offset, orientation, shapeAABB.lowerBound, shapeAABB.upperBound);