Skip to content
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

Decouple FollowModes #254

Open
Flynsarmy opened this issue Apr 19, 2024 · 2 comments
Open

Decouple FollowModes #254

Flynsarmy opened this issue Apr 19, 2024 · 2 comments

Comments

@Flynsarmy
Copy link

Flynsarmy commented Apr 19, 2024

Project Type

3D

Feature Description

Separate out the FollowMode code and allow for custom FollowModes to be registered.

Use Cases

I'm finding myself wanting a custom FollowMode but the current system isn't extensible. Here's an example:

2024-04-19.13-27-38.mp4

I'm using the Framed FollowMode and it's working exactly how I want except I'd like the camera to have a min/max bounding so that it doesn't pan too far to the right/left/up/down and see far outside of the room in the video above. I tried using invisible StaticBodies to restrict camera movement but the camera flies right through them regardless in this mode.

For this reason I wanted to create a BoundFramed FollowMode that is the same as Framed but accepts an AABB property clamping how far the camera is able to move in each direction.

Importance

Medium - the feature would unlock new possibilities, but it's not a showstopper

Usage

Rarely - just a handful of projects can likely benefit from this

(Optional) Proposed Solution

Pull the FollowMode code out of Constants, Properties and 2D/3D classes and move them into their own classes to be called from the previously mentioned as required. Provide a register_follow_mode() function to register new FollowModes.

@ramokz
Copy link
Owner

ramokz commented Apr 19, 2024

I don't think the solution here is a custom Follow Mode, but rather a 3D version of the Limit Node system that the 2D version already supports. The Follow Mode itself shouldn't be what dictates where the camera can or cannot go within a scene. Instead, it ought to be an external source that clamps it, as the behaviour can be desirable from all follow modes — including Framed Follow.

Have been tinkering with the idea of making a similar system for it for 3D scenes, but got a few things planned out before digging into that — in particular #161 as I suspect they would end up sharing a lot of logic.

@ZenithStar
Copy link
Contributor

I like the idea of eventually decoupling logic into their own component Nodes in an eventual version of this add-on, but that's probably several versions off. That's how I write my own custom logic.
imageimage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants