RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
995 stars 175 forks source link

Any node now activates script event boxes #3007

Closed ohlidalp closed 1 year ago

ohlidalp commented 1 year ago

Previously only the main camera node activated eventboxes. This was a bad fit for i.e. races vs. the finishing line.

The process of invoking the event boxes was inverted - instead of searching an event box for the camera node, all event boxes close to the actor are searched for a hit with any node. Hits are recorded and next time the recorded colliding node is checked first.

I checked performance impact on Auriga race under Debug. There seems to be no noticeable FPS drop.

Code changes:

ohlidalp commented 1 year ago

Performance seems to be OK: