FlexSim Knowledge Base
Announcements, articles, and guides to help you take your simulations to the next level.

Collision Detection of Bounding Boxes

collisiondetection.gif

Attached is an example model and user library comprising commands to return an array of objects whose bounding boxes intersect, and a Collision Detection object to drop into your model.

The Collision Detection has a ticker interval label to adjust the frequency of checks and will switch the colliding objects to selected. It looks for two groups - "Obstacles" containing static objects in the scene (which may be overlapping and not recorded as collisions) and "Colliders" which are the objects navigating the scene and should be checked for intersecting bounding boxes.

1741087337785.png

In the example model I'm adding the flowitem when it is created using

Group("Colliders").addMember(item)

The detector code is on its FlexScript label, 'analyseScene', which is first scheduled to run by the object's reset trigger.

collisionDetection3.fsm

BBCollisionDetection2.fsl

Attachments
Comments

Super Useful !!!!!

After 180 time units, the red highlights on the colliders doesn't happen sometimes.

Thanks Arun I'll investigate

@Arun Kr I've uploaded new versions which I hope will fix the issue.

This is so helpful, Jason! Thank you for POCing this. Looking forward to more awesome contributions

It's great!!!!

Great job, @jason_lightfootVL7B4 !