bonsairobo / smooth-bevy-cameras

Bevy camera controllers with buttery, exponential smoothing.
MIT License
283 stars 55 forks source link

Limit where the camera can move #41

Closed musjj closed 11 months ago

musjj commented 11 months ago

Can we limit the camera so that it doesn't move beyond a certain bound? I think this would be pretty useful for 2D games.

bonsairobo commented 11 months ago

Sounds like something that could be implemented outside of this crate. Maybe try it yourself first and see if you can make something satisfactory.

bonsairobo commented 11 months ago

I could imagine having some kind of TransformBounds component and a system that clamps the transform into the bounds defined there.

musjj commented 11 months ago

I decided to just clamp the value of the position, before setting it to target or eye. I guess this is good enough.