Jump to content

Direct rotation (not "smooth" and prettier 359 -> 0)


david476

Recommended Posts

I'll try, but just for a better explanation...

ย 

Rotations for my entity are "smooth", they do not seem to get perfectly set exactly to the variable's value (renders are made into a consistent > 20 fps rotation). As a part of this, when the rotation variable I set goes from 359 to 0, the model rotates 359 degrees backwards instead of 1 in the right direction to get to 0(in a fraction of a second).

Link to comment
Share on other sites

I'll try, but just for a better explanation...

ย 

Rotations for my entity are "smooth", they do not seem to get perfectly set exactly to the variable's value (renders are made into a consistent > 20 fps rotation). As a part of this, when the rotation variable I set goes from 359 to 0, the model rotates 359 degrees backwards instead of 1 in the right direction to get to 0(in a fraction of a second).

ย 

Can you post your code?ย  You're probably just not handling that case (of going past 360) properly.

Check out my tutorials here:ย http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

using:

ย 

if (ShipCSeat != null && ShipCSeat.riddenByEntity instanceof EntityPlayer) {

EntityPlayer player = (EntityPlayer) this.ShipCSeat.riddenByEntity;

this.setRotation(player.rotationYaw, 0);

}

ย 

in an onUpdate class that calls super. ShipCSeat is the entity that the player actually rides retrieved from server on server using UUID.

Link to comment
Share on other sites

Shouldn't that be happening on the Entity class's onEntityUpdate that I call at the beginning of onUpdate with super.onUpdate();? Maybe that needs to be sent client side? Seemed to me like onUpdate wasn't being called on both sides...

Link to comment
Share on other sites

I'm still not sure of your problem.ย  You're saying that if you change the rotation, that it will slowly go towards that rotation and in case where it is near 360 it will go the wrong way around?

ย 

I thought setting the rotation would immediately rotate it.ย  I'm not sure where it is doing the "smooth rotation" code.ย  But you need to find that because that is where it would have to handle the case of going past the full circle.

Check out my tutorials here:ย http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Is your ship very wide/long? If so, I think you're talking about how the end of your ship is rotated very rigidly.

ย 

This is to be expected due to the fact that the farther away an object is from the center of rotation, the more space it will travel to fulfill the rotation.

Kain

Link to comment
Share on other sites

  • 1 month later...
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • https://pastebin.com/VwpAW6PX My game crashes upon launch when trying to implement the Oculus mod to this mod compilation, above is the crash report, I do not know where to begin to attempt to fix this issue and require assistance.
    • https://youtube.com/shorts/gqLTSMymgUg?si=5QOeSvA4TTs-bL46
    • CubeHaven is a SMP server with unique features that can't be found on the majority of other servers! Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132 3 different stores: - CubeHaven Store: Our store to purchase using real money. - Bitcoin Store: Store for Bitcoin. Bitcoin can be earned from playing the server. Giving options for players if they want to spend real money or grind to obtain exclusive packages. - Black Market: A hidden store for trading that operates outside our traditional stores, like custom enchantments, exclusive items and more. Some of our features include: Rank Up: Progress through different ranks to unlock new privileges and perks. ๐Ÿ“ˆ Skills: RPG-style skill system that enhances your gaming experience! ๐ŸŽฎ Leaderboards: Compete and shine! Top players are rewarded weekly! ๐Ÿ† Random Teleporter: Travel instantly across different worlds with a click! ๐ŸŒ Custom World Generation: Beautifully generated world. ๐ŸŒ Dungeons: Explore challenging and rewarding dungeons filled with treasures and monsters. ๐Ÿฐ Kits: Unlock ranks and gain access to various kits. ๐Ÿ› ๏ธ Fishing Tournament: Compete in a friendly fishing tournament! ๐ŸŽฃ Chat Games: Enjoy games right within the chat! ๐ŸŽฒ Minions: Get some help from your loyal minions. ๐Ÿ‘ฅ Piรฑata Party: Enjoy a festive party with Piรฑatas! ๐ŸŽ‰ Quests: Over 1000 quests that you can complete! ๐Ÿ“œ Bounty Hunter: Set a bounty on a player's head. ๐Ÿ’ฐ Tags: Displayed on nametags, in the tab list, and in chat. ๐Ÿท๏ธ Coinflip: Bet with other players on coin toss outcomes, victory, or defeat! ๐ŸŸข Invisible & Glowing Frames: Hide your frames for a cleaner look or apply a glow to it for a beautiful look. ๐Ÿ”ฒโœจ[ Player Warp: Set your own warp points for other players to teleport to. ๐ŸŒŸ Display Shop: Create your own shop and sell to other players! ๐Ÿ›’ Item Skins: Customize your items with unique skins. ๐ŸŽจ Pets: Your cute loyal companion to follow you wherever you go! ๐Ÿพ Cosmetics: Enhance the look of your character with beautiful cosmetics! ๐Ÿ’„ XP-Bottle: Store your exp safely in a bottle for later use! ๐Ÿถ Chest & Inventory Sorting: Keep your items neatly sorted in your inventory or chest! ๐Ÿ“ฆ Glowing: Stand out from other players with a colorful glow! โœจ Player Particles: Over 100 unique particle effects to show off. ๐ŸŽ‡ Portable Inventories: Over virtual inventories with ease. ๐Ÿงณ And a lot more! Become part of our growing community today! Discord:ย https://cubehaven.net/discord Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132
    • # Problematic frame: # C [libopenal.so+0x9fb4d] It is always the same issue - this refers to the Linux OS - so your system may prevent Java from working ย  I am not familiar with Linux - check for similar/related issues ย 
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.