DarkflameUniverse / DarkflameServer

The main repository for the Darkflame Universe Server Emulator project.
https://www.darkflameuniverse.org/
GNU Affero General Public License v3.0
639 stars 172 forks source link

ENH: Remove usage of dpEntity objects being used for collision checks #1522

Closed EmosewaMC closed 5 months ago

EmosewaMC commented 5 months ago

Is your feature request related to a problem?

The only thing the pointer is used for is its ID, as such the dpEntity itself does not need to track the pointer, but rather just the objectID, adding safety to the containers and simplicity to them as well.

Describe the solution you'd like

https://github.com/DarkflameUniverse/DarkflameServer/blob/main/dPhysics/dpEntity.h#L83-L85 These three lines should be updated to replace the dpEntity with an ObjectID, with the map being changed to a set of objectIDs. i.e. std::vector<LWOOBJID> is all that is necessary for collision checks.

Repository breaking implications

Could break physics collisions.

Describe alternatives you've considered

asking jeff bezos for an open source copy of Havok

Additional context

No response

DarwinAnim8or commented 5 months ago

This is a fair improvement, if this were a more fully-featured physics engine it may have been benefitial but for our purposes it could definitely be replaced with just the IDs

PS: bezos pls

EmosewaMC commented 5 months ago

What are some things having access to the ptr would be useful for?

jadebenn commented 5 months ago

been working on this on and off