t3 icon indicating copy to clipboard operation
t3 copied to clipboard

[OrbitCamera] doesn't render after setting radius 0

Open pixtur opened this issue 1 year ago • 6 comments
trafficstars

Please complete the following information):

  • OS:
  • Version: 3.9.3

pixtur avatar Jan 26 '24 00:01 pixtur

This issue looks very similar to #340.

ylmrx avatar Jan 28 '24 14:01 ylmrx

var radius = Radius.GetValue(context) == 0.0f ? .0001f : Radius.GetValue(context);

this logic avoids this div/0 (im guessing this is the underlying issue), still display fine (in the value field), fail to render (a 0-radius, makes no geometrical sense) when it's = 0 (actually = .0001)

But the module still works just fine when we move this value again.

Other solution would be to clamp the radius parameter between a close_to_but_not-0 value and infty, but this might break current setups where radius < 0 .

wdyt ?

ylmrx avatar Jan 28 '24 15:01 ylmrx

I was about to suggest to clamp the Radius minimum value to .0001, then I saw @ylmrx idea and tried it as well. I prefer this idea, because it feels better than being stuck at 0 with the clamp, it allows to go from a positive radius to a negative radius.

newemka avatar Jan 28 '24 15:01 newemka

I prefer how it works without clamping the radius value.

https://github.com/tooll3/t3/assets/3755089/a4e67c11-8aea-4d5c-8b1a-b1aa7150a045

newemka avatar Jan 28 '24 16:01 newemka

Look good to me!

pixtur avatar Jan 28 '24 20:01 pixtur

Thanks @ylmrx !

newemka avatar Jan 29 '24 11:01 newemka