# \[resolved\]How to detect if two objects overlap？

**URL:** https://discourse.threejs.org/t/resolved-how-to-detect-if-two-objects-overlap/3789
**Category:** Questions
**Tags:** raycasting
**Created:** [August 15, 2018, 1:43am UTC](https://discourse.threejs.org/t/resolved-how-to-detect-if-two-objects-overlap/3789 "2018-08-15T01:43:38Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![calrk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/calrk/32/2746_2.png) [@calrk](https://discourse.threejs.org/u/calrk)
#### Post date: [August 16, 2018, 1:41am UTC](https://discourse.threejs.org/t/resolved-how-to-detect-if-two-objects-overlap/3789/4 "2018-08-16T01:41:13Z")

</div>

If you want to do simple intersection detection without use of a physics engine, you can use the mesh’s bounding boxes to detect intersection with each other:

> <https://github.com/mrdoob/three.js/blob/dev/src/math/Box3.js#L319>

In order to accurately collide, you will need to apply the mesh’s matrix transform to the bounding box.

```auto
box1.updateMatrixWorld();
box2.updateMatrixWorld();
var bounding1 = box1.geometry.boundingBox.clone();
bounding1.applyMatrix4(box1.matrixWorld);
var bounding2 = box2.geometry.boundingBox.clone();
bounding2.applyMatrix4(box2.matrixWorld);

if(bounding1.intersectsBox(bounding2)){
//collision, reject placement
}

```

I have just written this from memory, I have a working example that I can post later if you like?

---

_[View the full topic](https://discourse.threejs.org/t/resolved-how-to-detect-if-two-objects-overlap/3789)._
