engine icon indicating copy to clipboard operation
engine copied to clipboard

Refactor of Frustum.containsSphere

Open mvaligursky opened this issue 3 years ago • 6 comments

Refactor of Frustum.containsSphere was returning values 0,1,2 but the result was only tested as if bool. Also, MeshInstance culling that is using it was then returning false, 0, 1, 2 values, which are different types. Element custom culling functions also return boolean.

mvaligursky avatar Dec 10 '21 15:12 mvaligursky

Is this a potentially breaking change to a public API?

Maksims avatar Dec 10 '21 22:12 Maksims

Being able to differentiate between in and intersection can help speed up hierarchical traversal (in means all children are also in). Even though this isn't currently used, it could be helpful in future?

slimbuck avatar Dec 11 '21 11:12 slimbuck

Yes it changes the API .. but I very much doubt anybody uses the distinction between fully in and partially in. Even the engine does not use it .. I never did in my life.

If we in the future need this, which I doubt, we can always add it in in a consistent way.

Other option is - we keep the public API as is, but create new internal function. But I'm pretty sure this is not necessary.

mvaligursky avatar Dec 11 '21 13:12 mvaligursky

Yes it changes the API .. but I very much doubt anybody uses the distinction between fully in and partially in. Even the engine does not use it .. I never did in my life.

If we in the future need this, which I doubt, we can always add it in in a consistent way.

Other option is - we keep the public API as is, but create new internal function. But I'm pretty sure this is not necessary.

Well, previously there was always backwards compatibility guaranteed if API is public. Unless it was no other way (like Scripting 2.0, Sound API, etc.) Some power user could be using that method, and there is no simple way to say: "nobody uses it".

Maksims avatar Dec 11 '21 14:12 Maksims

What advantage do see changing this API @mvaligursky? Not sure I see it right now.

slimbuck avatar Dec 13 '21 09:12 slimbuck

Seems there is some resistance to merging this, @mvaligursky. Perhaps it's worth closing it for now.

willeastcott avatar Jul 13 '22 17:07 willeastcott