aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.02k stars 539 forks source link

Only update PhysX editor colliders if transform has actually changed #515

Open yuriy0 opened 3 years ago

yuriy0 commented 3 years ago

In the editor, PhysX colliders cannot be moved and are instead destroyed and re-created in the physical world every time the transform changes. This update is a relatively expensive operation which adds up quickly if the transform is updated very frequently e.g. every tick, and you have many colliders in your level.

This change adds a check in OnTransformChanged to see if the transform is actually different.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

AMZN-puvvadar commented 3 years ago

Hi @yuriy0 ,

Thanks for submitting this optimization, we'll evaluate it and update when complete.

oyongzhi commented 3 years ago

Hello yuriy0! We've reviewed your pull request and wanted to let you know we will be incorporating your proposed changes into our next version of the Lumberyard engine. Thank you kindly for contributing to Lumberyard!