-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support (vertical) camera target limitation #16125
base: master
Are you sure you want to change the base?
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16125/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/16125/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/16125/merge#BCU1XR#0 |
Visualization tests for WebGPU |
WebGL2 visualization test reporter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM I ll let @deltakosh having a quick look :-)
@@ -1129,6 +1137,9 @@ export class ArcRotateCamera extends TargetCamera { | |||
this.radius = this.upperRadiusLimit; | |||
this.inertialRadiusOffset = 0; | |||
} | |||
if (this.lowerTargetYLimit !== null && this.target.y < this.lowerTargetYLimit) { | |||
this.target.y = this.lowerTargetYLimit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it basically not a this.target.y = Math.max(this.target.y, this.lowerTargetYLimit) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my initial though as well, but the TS compiler blames because null
is not a valid input for Math.max
.
I guess that's why are lowerAlphaLimit
and upperAlphaLimit
are solved with this if
pattern as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should initialize at -infinity so we prevent different objects maps and simplify the code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, as it would solve the inspector issue as well.
Should I also change lowerAlphaLimit
and upperAlphaLimit
to -Infinity
/ Infinity
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides Seb comment I'm good to go
from forum entry
Inspector
Not too happy with the default behaviour of the inspector, as
null
is shown as0
.The user would now expect that there is a limit on y=0, whereas there is none.
Also you have to switch to a different value and back to 0, to make the y limit on 0 work.
I didn't investigated further on that, since it's a common inspector behaviour, the alpha limits are affected as well.
Maybe just show
null
as empty value in the numfield? 🤔