-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
Camera can move inside 3D terrain #1542
Comments
I think i will not have time to look onto this in near future. Also I think before start implementing this, all possible scenarios should be played through. What should happen if, for example:
|
My company would be happy to hire someone to fix this issue |
@767160 thanks for sharing. You can ping me on slack and I can maybe put you in touch with people who are interested... https://osmus-slack.herokuapp.com/ |
@wipfli Sorry, I do not use slack. Anyone interested, please send me an email at 061767@protonmail.com |
Assigned L bounty. |
I already have a basic working prototype for this, may in near future i find the time to create a PR. |
I'd be interested in working on this if you're open to passing the baton @prozessor13. |
I've increased the bounty as I think L bounty isn't enough. |
This is the basic working code, based on old versions of transform.ts and painter.ts, but i think the patch should work in the current classes as well. Regards. Max.
|
This approach works great when changing bearing! But there are some issues:
|
For 1) please try:
|
Yes, this make sense. Would you like to change constant 100 by zoom level when assign |
Yes, may 100 is to much! Feel free to make a proposal/change. This is only a quick and not very well tested solution! |
Sure, I am willing to work on this. Since I am new to frontend. This issue seems the perfect one to help me realize map rendering workflow. But @SnailBones has already leave the comment before,let @HarelM decide the assignee. @prozessor13 I notice this naming may related to constrain camera when terrain collision happens. But it seems |
Yes, this is the dilemma, that the Transform instance does nothing know about terrain. To be honest, my implementation was really a quick one, i did not go into detail. So it is really only a proposal! Feel free to change the code! |
Well @SnailBones was the first one to request, so it's up to him to decide if he would like to push this forward or leave it to @typebrook. |
All yours @typebrook! Feel free to tag me for review. |
Thank you @SnailBones, I'll make a PR with tests in these days. |
@SnailBones @prozessor13 @HarelM Sorry for the late reply. A new draft PR is made. Since I am still not confident about realizing map rendering flow, if you guys find my approach is too naive, feel free to correct me or change the assignee. |
@HarelM could you please assign this to me? |
Sure! |
Yes, I've talked to Oliver. |
I'm reopening this bug as it looks like the fix did not fully solve it. |
It think it just looks as it is inside the terrain, because I removed the buffer in the last steps. The camera sits right on top of the terrain, which I think leads to this visual glitches. I would suggest to readd the buffers, that looks better. The crash should be the one in #4235 and less related to this issue. |
So let try and add the buffer back and see if we don't get these issues anymore. |
I think you can't prevent visual glitches completely, but adding the buffer would prevent the more common ones. For example, if a terrain on the left side of your view is really close and steep you might have to prevent the camera sitting next to it. But what if on the right side, there is also a steep hill very close? Should the camera be prevented to be in such a valley? But it might be ok if the field of view is narrow (the camera "fits" into the valley). But maybe the user resizes the canvas (and such the camera doesn't fit any more). There are so many factors to consider. I think that would make the solution way to complicated. So yeah, the buffer should prevent most, but will not prevent all visual glitches if you don't want to restrict camera movement too much. As said, the crashes are something different, they must not occur. I would really suggest to handle them in a less catastrophic way. They should not lead the map to stop rendering. As the transformCamera implementiation depends on other code not directly manipulating the map's transform, there still might be places where this does happen and possibly will happen again with new code. I think it will take some time to harden this, and until then, problems with this should not lead to crashes. Maybe some form of linting that detects direct manipulation of the transform would be nice. Or really setting the transform private and only allow manipulation through the methods. |
We are doing a big refactoring of the trasform as part of the globe branch, so I hope it will be better afterwards. |
Done in #4551 |
This is a follow-on ticket from #1241. It's possible to move the camera to within terrain when it's extruded from the 2D map surface.
@zdila said:
@prozessor13 replied:
Expected behaviour
When the camera "bumps up" against 3D terrain, it should not be possible to move the camera to within the 3D surface.
Actual behaviour
When you move the camera towards 3D terrain, nothing stops you when you "hit" the surface. You can keep moving through the surface.
The text was updated successfully, but these errors were encountered: