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

Awkward whirligig animation #159

Open
Da-Technomancer opened this issue Oct 4, 2021 · 0 comments
Open

Awkward whirligig animation #159

Da-Technomancer opened this issue Oct 4, 2021 · 0 comments
Labels
bug Low Priority If this is on a bug, it means that it is difficult to fix, and not urgent

Comments

@Da-Technomancer
Copy link
Member

The current animation for the rotating blades on the whirligig doesn't look very good. It starts to look a bit strange the longer it goes on or at high wind levels.

ItemModelsProperties.register(whirligig, new ResourceLocation("angle"), (ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity) -> {
if(entity == null || entity.getUseItem() != stack){
return 0;
}
//The following gets the angle in degrees of the blades based on:
//Ticks since started rotating
//Speed (wind level) at current time
//Assumption that speed decreased since start at -WIND_USE_RATE/tick
//Assumption that angle started at 0
//TODO re-work this formula, make it more reliable, cap at wind = 0
int useTime = entity.getTicksUsingItem();//Method is poorly MCP mapped- actually gives number of ticks since started using
float currSpeed = (float) whirligig.getWindLevel(stack) / 20F;//Converted to rad/t
float deaccel = (float) Whirligig.WIND_USE_RATE / 20F;//Converted to rad/t/t
float angle = (currSpeed * useTime + deaccel * useTime * useTime / 2F) % (2F * (float) Math.PI);
angle = (float) Math.toDegrees(angle);
return angle;
});

@Da-Technomancer Da-Technomancer added bug Low Priority If this is on a bug, it means that it is difficult to fix, and not urgent labels Oct 4, 2021
Da-Technomancer added a commit that referenced this issue Mar 11, 2022
*Increased maximum whirligig elevation to account for increased world height
*Adjusted how the whirligig propellor animation works, hopefully improving it; working towards #159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Low Priority If this is on a bug, it means that it is difficult to fix, and not urgent
Projects
None yet
Development

No branches or pull requests

1 participant