PatHightree / SpaceNavigator

SpaceNavigator driver for Unity3D
MIT License
170 stars 55 forks source link

Camera-Speed adjustment relative to target distance #22

Open RobertMengerBMW opened 4 years ago

RobertMengerBMW commented 4 years ago

Hi,

as the Unity scene view does not offer an appropriate camera-movement speed when beeing further away from objects, Ive added a small modification to the SpaceNav plugin, to do so.

It is just a simple exponential function, relativ to the distance of the selected object (or world center if none is selected)

PatHightree commented 4 years ago

Interesting addition, I thought I covered the problem of sensitivity and scale with the huge/human/miniscule presets. What was missing that made you add this ? Continuity ?

RobertMengerBMW commented 4 years ago

Continuity is exactly what I was missing. And the ease of not having to care about the scale at all.

Im used to the way Maxon has implemented the SpaceNavigator into Cinema 4D, there is no need to adjust the scale, as it is automatically adjusted as you move. I have some projects, where i need to go from huge to minuscle in one move (like from a huge mountain down to a grain of sand).

But my implementation is far from perfect. Its a first start, what I can use to work with. For very large distances a logarithmic slow-down of the acceleration function could be implemented (currently it just stops at a 1000 units scale-factor)

RobertMengerBMW commented 4 years ago

I have moved the whole function into a generic function body to access it from orbit and flymode, as well as a way to manage this function over the settings. but I didnt find the suitable positions how to integrate it into the settings menu ?

What do you think, were you able to test it out?