article

Jason Lightfoot avatar image
7 Likes"
Jason Lightfoot posted David Seo commented

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

bounding boxcollision detection
· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Arun Kr avatar image Arun Kr commented ·

Super Useful !!!!!

0 Likes 0 ·
Arun Kr avatar image Arun Kr Arun Kr commented ·

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

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Arun Kr commented ·

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

1 Like 1 ·
Show more comments
Sana avatar image Sana commented ·

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

0 Likes 0 ·
David Seo avatar image David Seo commented ·

It's great!!!!

0 Likes 0 ·

Article

Contributors

jason.lightfoot contributed to this article

Related Articles