Figura Compatibility: Camera movement
https://modrinth.com/mod/figura (Using Figura 0.1.5 for 1.21.1 on Fabric)
Relevant avatar that demonstrates problem: https://github.com/TotalTakeover/FiguraEeveelutionTaurAvatars
Figura scripting carries the ability to move the position the camera renders with respect to, and moving where the crosshair originates from. The model above has an option to use both features. Non-VR gameplay below.
https://github.com/user-attachments/assets/c4bc8197-a82b-494f-9998-e4a3d3196d47
While in VR, this functionality is not reflected by the camera location.
https://github.com/user-attachments/assets/0b6c9a7e-f3f6-4195-9a69-39ed315df4c9
(Might relate to #304 on account of both being camera issues. #225 is another Figura issue, though the Complete option for Model Arms somewhat fixed it for me.)
I don't quite get what the issue is exactly. does the crosshair not come from your arm? the first person model doesn't really work with non vanilla models, they would need to add special compatibility. iirc someone made a vivecraft plugin for figura.
The problem is that Figura can move the camera; Vivecraft doesn't reflect it when it does. What I intended to show there is that, when I look straight down, I'm looking at the center of the taur part (=> the camera is forced to be based on vanilla), not the front (=> Figura's camera changes would be reflected). The crosshair is irrelevant right now.
Moving the camera was how I was planning on adding compatibility to a separate avatar, but it not working like that indirectly mandates using a model with roughly vanilla head position, which is not ideal.
To my knowledge, that add-on only has builds for 1.20.1, and due to servers I tend to use 1.21.1.
where is the hitbox of the model? the camera is at the hitbox, at least supposed to be
also does that camera offset do anything in first person?
where is the hitbox of the model? the camera is at the hitbox, at least supposed to be
Neither the model shown here nor the model I want to make compatible change the hitbox. (I'm pretty sure Figura doesn't let you do that without external mods, don't quote me on that)
also does that camera offset do anything in first person?
Yes, this is what the first video demonstrates. The hitbox isn't moved (see the shadow), but the camera is. I can get a video with hitboxes in non-VR if it helps
sorry, the first video doesn't really show the change in first person, only third apart from that, not sure if we can even easily add compat for that
sorry, the first video doesn't really show the change in first person, only third
0:13. The movement shown isn't caused by any buttons. I can get a better video if needed though, I will admit it wasn't the best at showing first person
apart from that, not sure if we can even easily add compat for that
Is it possible to find where the camera is without considering the hitbox? (See also the vanilla crawling transition - the hitbox changes are instantaneous, while the camera moves over a few frames.) If you can do that after Figura does its thing, that probably fixes it, assuming no worse compatibility issues.
okay so I checked out that model, and you are right aboutthe first person thing.
as for the hitbox thing, I simplified that a bit. what we actually do is
- get the headset position in the room
- set the entity position to the head pivot (roughly 10 cm behind the headset)
- then during rendering we just ignore the entity alltogether, and render from the headset position
to fix this , I would need to change step 2 and add some offset to the entity position, which might not even work all the time. Since rotating in the room would now rapidly move the entity around, which could put it into walls (which might be blocked by the server so may be fine), but during rendering the entity position wouldn't align anymore again.
to fix this , I would need to change step 2 and add some offset to the entity position, which might not even work all the time.
That offset would just be the difference between the camera position and expected camera position, right? Though then you'd need to know what that expected camera position is, which might vary with all kinds of circumstances.
I definitely understand that this would be really complicated for not much gain. Figura is probably the nichest of the cosmetic mods for this game; a restructure this huge for something this small is probably not worth it. Would be cool for sure if it was made to work, but I can figure out porting to the Unity format for something like Beat Saber if I have to.
which could put it into walls (which might be blocked by the server so may be fine)
Screwing with the camera in Figura and just using Vivecraft are already prone to setting anticheats off, (heck it's already impossible to use Vivecraft on MCC Island because its anticheat kicks for non-keyboard movement) so I wouldn't worry about it. I'd worry most about it not working in singleplayer.
it could also throw you off a cliff though
also not sure what you mean with this
but I can figure out porting to the Unity format for something like Beat Saber if I have to.
it could also throw you off a cliff though
Ok that's fair lol
I'm obviously biased in saying it would be nice as an option (probably force crouch logic to avoid falling), but I also know VR control is not easy to grasp outside of it and it might just suck. The alternative would be setting position as normal and moving the camera afterward, but in more extreme cases this might be very disorienting.
also not sure what you mean with this <...>
Unrelated to Vivecraft
Ultimately, I think this would make most sense like so:
- Camera Offset Behavior option
- None: Current behavior (default)
- Move Hitbox: Camera position always matches up with non-VR; the mod moves the hitbox to match up based on the difference between true and expected camera positions. (Original idea. Using the linked avatar, theoretically turning would cause the animal taur part, and thus hitbox, to shift to be behind the camera at all times, while the camera remains stationary. To avoid falling, crouch logic would also be applied to every edge while not moving - I think this will probably be fine.)
- Move Camera: Standard hitbox behavior, with the camera offset being applied afterward. (Using the linked avatar, looking downward and turning around might make it look like you're additionally turning in a circle. More disorienting, but might feel better mechanically and be more stable for avatars that use more subtle head changes.)
- Always warn that these might be disorienting
Figura avatars will almost certainly need to make changes too - namely, making the camera position more constant would feel much better in VR - but this would probably set a good framework for them to work from.
I guess I could also add an offset just for rendering the model, need to check if figura has an api to get those settings though, I don't really want to rely on figura internals for that
That would break on models taller or shorter than a normal player.
need to check if figura has an api to get those settings though
I did a little bit of digging and found this. Not sure how much it helps; it's probably wiser to not hard-code exceptions to normal behavior based on the presence of another mod. I think their only API is in Lua, and that's intended for avatars anyway, not other mods.
I'm definitely assuming there is a way to get the camera location and that Figura modifies that position in a conventional way. Might be worth talking to someone who works on it directly, as I'm not nearly knowledgeable enough to be in that position.
From what i remember yapping with the devs, iirc they just mixin to the camera itself and offset it. Tho that may have changed as that was like a few years ago (like only a year after rewrite)