kinsi55 / CS_BeatSaber_Camera2

Adds a lot of options / tools for creating more advanced desktop viewing experiences with multiple camera angles and much more in Beat Saber
MIT License
118 stars 13 forks source link

[feature request] positionable tracking cam #105

Open 9cxndy opened 10 months ago

9cxndy commented 10 months ago

a camera at a fixed location that always faces the player. similar to the "TurnToHead" option of CameraPlus

ideally the exact position tracked by the camera should be configurable (e.g. an offset from player's position)

kinsi55 commented 10 months ago

I tried this before but unfortunately with how camera2's structured this isnt possible in a good way

9cxndy commented 10 months ago

can you elaborate? doesn't smooth follow also changes camera transformation per frame? isn't this similar to that?

kinsi55 commented 10 months ago

The final Position of a Camera2 camera is "added up" from various different components (Middlewares as they're called). The Map-movement with Noodle maps is seperate, the 360 map rotation is seperate, etc. A middleware in itself cannot strictly "make it point to this world location" unless I was to fundamentally change how Cam2 functioned

9cxndy commented 10 months ago

Are middlewares applied in a specific order? Is it possible to have the tracking middleware applied last, and let it query the current world position when it's called?

kinsi55 commented 10 months ago

They are but thats kinda hacky because while they are applied in a specific order they are not necessarily processed in that one (And dont really have access to others)

9cxndy commented 10 months ago

:thinking:

so we just need a special type of middlewares that's guaranteed to be applied last? so it's like

transforms = run normal middlewares;
apply transforms;
run special middleware;

so that the special middleware can query the final position after other middlewares are applied.

code might not be as pristine as it was but I think tracking cam is a useful feature so it's justified.