PedrelliLuca / ScalarField

A TopDown RPG Game, where magic works by interacting with the environment.
4 stars 0 forks source link

Associate a Simple and a Complex Collision to `UThermodynamicComponent` #31

Closed PedrelliLuca closed 1 year ago

PedrelliLuca commented 1 year ago

What?

In UThermodynamicComponent:

Change the thermodynamics logic so that two thermodynamics components can exchange heat if and only if:

  1. Their simple collisions overlap
  2. Their most complex collisions also overlap. The most complex collisions are checked only when the simple collisions overlap.

Why?

We want to achieve accuracy while saving performance.
Using complex collisions instead of trivial capsules/boxes for thermodynamics interactions is necessary to have accurate gameplay, but if we just bind to complex collisions for OnBegin and OnEnd overlap events we'll hurt performances badly.
By implementing this system, complex collisions are present but checked only when the interacting actors are close to each other, saving computations when they're not needed.