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

Smooth Rotation with set_yaw for lua entities #14599

Open
tenplus1 opened this issue Apr 28, 2024 · 3 comments
Open

Smooth Rotation with set_yaw for lua entities #14599

tenplus1 opened this issue Apr 28, 2024 · 3 comments
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API

Comments

@tenplus1
Copy link
Contributor

Problem

When using ' automatic_face_movement_dir' and 'automatic_face_movement_max_rotation_per_sec' we see smooth rotation in effect, but as soon as we use set_yaw on an entity it flips directly to that rotation instead of rotating smoothly.

Solutions

Have a toggle on set_yaw so that we can make use of smooth rotation in mods that doesn't break the existing api, e.g.

entity:set_yaw(yaw, [true for smooth rotation, false or nil to act normally])

Alternatives

We are already using an alternative in mobs redo api which is to manually rotate in steps to mimic smooth rotation, which works but isn't without it's glitches and lags.

Additional context

No response

@tenplus1 tenplus1 added the Feature request Issues that request the addition or enhancement of a feature label Apr 28, 2024
@sfan5 sfan5 changed the title Smooth Rotation with set_yaw Smooth Rotation with set_yaw for lua entities Apr 28, 2024
@appgurueu
Copy link
Contributor

appgurueu commented Apr 28, 2024

A bool alone would be insufficient. For properly configurable interpolation, you would want a number.

If you have a "root" bone, it should be possible to use that to interpolate the effective rotation of the model smoothly given the new bone override API: Do a relative, interpolated override on the root bone's rotation (assuming this feature works correctly, which it should, but which I'll look into since #14570 claims otherwise).

@jordan4ibanez
Copy link
Contributor

I just joined in to say hello

@appgurueu
Copy link
Contributor

Perhaps something worth noting: set_rotation is already interpolated, it's just (1) slightly flawed (2) probably quicker than expected, modders would likely want this to be configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API
Projects
None yet
Development

No branches or pull requests

4 participants