# How to do simple collision detection of two objects without complex simulation?

**URL:** <https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365>\
**Category:** Isaac Sim\
**Tags:** collision\
**Created:** [September 2, 2024, 6:54am UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365 "2024-09-02T06:54:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![2368137811](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@2368137811](https://forums.developer.nvidia.com/u/2368137811)\
**Post date:** [September 2, 2024, 6:54am UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365/1 "2024-09-02T06:54:44Z")

</div>

How to do simple collision detection of two objects without complex simulation? Let’s say I have object A and object B, and they both have colliders, and now I just want to detect whether object A and object B are colliding without simulating them.

---

<div class="post-metadata">

**Author:** ![AlesBorovicka](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/alesborovicka/32/21824_2.png) [@AlesBorovicka](https://forums.developer.nvidia.com/u/AlesBorovicka)\
**Post date:** [September 2, 2024, 3:21pm UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365/2 "2024-09-02T15:21:51Z")

</div>

You should be able to use the scene query interface, please check the scene query demos.  
Objects have to be parsed into PhysX, so you need to call something like:

```auto
from omni.physx import get_physx_scene_query_interface, get_physx_simulation_interface

# load stuff into PhysX (if you dont want to press play)
cache = UsdUtils.StageCache.Get()
stage_id = cache.GetId(stage).ToLongInt()
get_physx_simulation_interface().attach_stage(stage_id)

# see the overlap demo python script for the usage
path_tuple = PhysicsSchemaTools.encodeSdfPath(Sdf.Path(self._mesh_path))
_ = get_physx_scene_query_interface().overlap_shape(path_tuple[0], path_tuple[1], self.report_hit, False)

get_physx_simulation_interface().detach_stage()

```

Regards,  
Ales

---

<div class="post-metadata">

**Author:** ![2368137811](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@2368137811](https://forums.developer.nvidia.com/u/2368137811)\
**Post date:** [September 4, 2024, 8:24am UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365/3 "2024-09-04T08:24:41Z")

</div>

I don’t quite understand what you mean. The effect I want is similar to the collision matrix in unity. Can I set it using UI interface?

---

<div class="post-metadata">

**Author:** ![AlesBorovicka](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/alesborovicka/32/21824_2.png) [@AlesBorovicka](https://forums.developer.nvidia.com/u/AlesBorovicka)\
**Post date:** [September 4, 2024, 8:48am UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365/4 "2024-09-04T08:48:46Z")

</div>

No, I am afraid there is no UI interface for this. Sorry.

---

<div class="post-metadata">

**Author:** ![2368137811](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@2368137811](https://forums.developer.nvidia.com/u/2368137811)\
**Post date:** [September 4, 2024, 9:10am UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365/5 "2024-09-04T09:10:10Z")

</div>

I don’t understand your code, can you give me more details? Let’s say I have object A and object B, and I just need to check if they collide. I don’t need to have a collision in the simulation.

---

<div class="post-metadata">

**Author:** ![AlesBorovicka](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/alesborovicka/32/21824_2.png) [@AlesBorovicka](https://forums.developer.nvidia.com/u/AlesBorovicka)\
**Post date:** [September 4, 2024, 9:17am UTC](https://forums.developer.nvidia.com/t/how-to-do-simple-collision-detection-of-two-objects-without-complex-simulation/305365/6 "2024-09-04T09:17:30Z")

</div>

There are no standalone scene queries without simulation out of the box to be used. There are a couple of options you can use:  
a) The code above does load data into PhysX, then you can perform scene queries like overlap to ask if things do overlap or not.  
b) If you are interested in overlapping only you can also you clash detection for that. Please see this repository: [GitHub - NVIDIA-Omniverse/clash-detection-samples: clash-detection-samples](https://github.com/NVIDIA-Omniverse/clash-detection-samples)

But there is no standalone function that you can call to ask if object A does collide with Object B. Either you load things into PhysX, you dont have to simulate but the objects have to be created inside PhysX in order to perform the queries.  
Or you can try to see if the clash detection which is a triangle mesh based collision detection works for your usecase.

Regards,  
Ales
