You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a single float value, applying to both x and y (uniform scaling)
With a Vector2, to change both x and y (independent scaling)
The advantage of solution 2 is that you could simulate the rotation of a bullet around an axis with a behaviour. (for instance scaling down X or Y to zero to make it look like it's rotating around the X or Y axis).
The text was updated successfully, but these errors were encountered:
I agree scaling a collider could be expensive, and also inaccurate for option 2.
AABB and OOB should actually scale pretty nicely (although AABB could become very big).
Circle won't scale well at all in case 2 (r = min(X,Y) will be inaccurate, and ellipse collision is terrible).
Maybe this should rather be defined by an empiric jobified behaviour depending on the pattern ? Thus, something to leave to the user to implement.
Under the hood, we use a two pass collision algorithm: an initial AABB check against colliders, and then call Physics2D.CircleCastNonAlloc to do fine grain collision detection.
While computing AABBs for scaled offset circles is trivial, it does significantly complicate the code for this section of the algorithm.
The second part is the worrying one: Physics2D.CircleCast* calls do not support arbitrary non-uniform scaling.
For the time being, it should be possible to add at least uniform scaling without any major roadblocks.
Potentially 2 types :
The advantage of solution 2 is that you could simulate the rotation of a bullet around an axis with a behaviour. (for instance scaling down X or Y to zero to make it look like it's rotating around the X or Y axis).
The text was updated successfully, but these errors were encountered: