Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Direct rotation (not "smooth" and prettier 359 -> 0)
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
david476

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

By david476, September 29, 2014 in Modder Support

  • Start new topic

Recommended Posts

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted September 29, 2014

Is there a way to render exactly the rotation value without the "nice" smooth rotation or the weird turning that happens when you go from 359 degrees to 0?

Share this post


Link to post
Share on other sites

Busti    72

Busti

Busti    72

  • Dragon Slayer
  • Busti
  • Forge Modder
  • 72
  • 624 posts
Posted September 29, 2014

Are you talking about GL.glRotated(x, y, z, rot)?


PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted September 29, 2014

I use rotatef, but whatever causes the problem (setting the yaw does seem to do it too, but could be happening in client syncing)

Share this post


Link to post
Share on other sites

TheGreyGhost    819

TheGreyGhost

TheGreyGhost    819

  • Reality Controller
  • TheGreyGhost
  • Members
  • 819
  • 3280 posts
Posted September 29, 2014

Hi

 

To be honest I have no idea what you're talking about, could you post a video perhaps?

 

-TGG

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted October 1, 2014

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).

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted October 1, 2014

Note: rotations are being set to a entityRiding's (a player's in my case) yaw.

Share this post


Link to post
Share on other sites

Busti    72

Busti

Busti    72

  • Dragon Slayer
  • Busti
  • Forge Modder
  • 72
  • 624 posts
Posted October 1, 2014

Shouldn't that be just a mathematical problem using the PartialTickTime and the update tick?

 


PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted October 1, 2014

New terms to me! Want to expand on them?

Share this post


Link to post
Share on other sites

jabelar    594

jabelar

jabelar    594

  • Reality Controller
  • jabelar
  • Members
  • 594
  • 3266 posts
Posted October 1, 2014

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/

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted October 2, 2014

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.

Share this post


Link to post
Share on other sites

jabelar    594

jabelar

jabelar    594

  • Reality Controller
  • jabelar
  • Members
  • 594
  • 3266 posts
Posted October 2, 2014

I'm not really sure why that code would cause any problem with rotating past 360.  You're just setting the rotationYaw of your ship to match your player that is riding it.  Where is the "smooth" rotation happening that is causing the problem?


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

Share this post


Link to post
Share on other sites

TheGreyGhost    819

TheGreyGhost

TheGreyGhost    819

  • Reality Controller
  • TheGreyGhost
  • Members
  • 819
  • 3280 posts
Posted October 2, 2014

Hi

 

I still don't understand your question, but a random idea: try setting prevRotationYaw as well as rotationYaw.

 

-TGG

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted October 3, 2014

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...

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted October 3, 2014

Update: It looks like this still happens when I just add to the rotation, so not a problem with using an entityPlayer's yaw.

Share this post


Link to post
Share on other sites

jabelar    594

jabelar

jabelar    594

  • Reality Controller
  • jabelar
  • Members
  • 594
  • 3266 posts
Posted October 3, 2014

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/

Share this post


Link to post
Share on other sites

TLHPoE    39

TLHPoE

TLHPoE    39

  • Dragon Slayer
  • TLHPoE
  • Members
  • 39
  • 638 posts
Posted October 3, 2014

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

Share this post


Link to post
Share on other sites

david476    10

david476

david476    10

  • Creeper Killer
  • david476
  • Members
  • 10
  • 238 posts
Posted November 15, 2014

Haven't been modding in a while but went back in and just using my own variable seems to work fine. Still has the smooth/ lagginess but I think that is just the actual rotation of the player...

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • NovaMachina
      [1.16] Block texture resonds to sky light not block light

      By NovaMachina · Posted 12 minutes ago

      I received a bug report where the texture of a block is only responding to the sky light, but not any block lights (such as torches). Here is the link to the renderer that I believe to be the culprit. Any suggestions? https://github.com/NovaMachina-Mods/ExNihiloSequentia/blob/1.16/src/main/java/novamachina/exnihilosequentia/client/render/SieveRender.java Here is an image that shows the issue: https://repo.jacob-williams.me/repository/raw/exnihilosequentia/issues/images/Lighting%20Bug.png
    • brok4d
      OBJ MODELS

      By brok4d · Posted 2 hours ago

      Hello, this mod is the source, you have to get boredhttps://gitlab.com/Lycanite/LycanitesMobs
    • JayNeedsHelp
      Logger not working

      By JayNeedsHelp · Posted 2 hours ago

      So I'm currently creating a forge mod and I'm having an issue where the console stops logging after some errors. It seems to be connected to the access transformers that I'm using as before I added at's my console was working fine.   Here is my at file:  public-f net.minecraft.client.Minecraft session public net.minecraft.client.Minecraft timer public net.minecraft.client.gui.GuiScreen buttonList public net.minecraft.util.Timer tickLength public net.minecraft.network.play.client.CPacketPlayer onGround public net.minecraft.network.play.server.SPacketEntityVelocity motionX public net.minecraft.network.play.server.SPacketEntityVelocity motionY public net.minecraft.network.play.server.SPacketEntityVelocity motionZ public net.minecraft.network.play.server.SPacketExplosion motionX public net.minecraft.network.play.server.SPacketExplosion motionY public net.minecraft.network.play.server.SPacketExplosion motionZ public net.minecraft.client.renderer.entity.RenderManager renderPosX public net.minecraft.client.renderer.entity.RenderManager renderPosY public net.minecraft.client.renderer.entity.RenderManager renderPosZ   Any help is greatly appreciated thank you!
    • cadbane86140
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140 · Posted 3 hours ago

      Hello There! Today we are back on Hunger Games after a little break but we are finally back! In this episode we are on the good ol' map Survival Games 4 and it ACTUALLY went well for once. Also we have so many great battles on rooftops, small rooms and just out in the open! We also use shears to fight at one point and that was pretty crazy! There are so many hilarious moments in this episode that I know you guys are gonna love! I hope you all enjoy this video and if you did don't forget to like and sub for more Hunger Games in the future!  
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 4 hours ago

      latest.log
  • Topics

    • NovaMachina
      0
      [1.16] Block texture resonds to sky light not block light

      By NovaMachina
      Started 12 minutes ago

    • Milk_Shak3s
      1
      OBJ MODELS

      By Milk_Shak3s
      Started 17 hours ago

    • JayNeedsHelp
      0
      Logger not working

      By JayNeedsHelp
      Started 2 hours ago

    • cadbane86140
      0
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140
      Started 3 hours ago

    • Sad Whale
      6
      Game crashes whenever I try to increase the RAM

      By Sad Whale
      Started 5 hours ago

  • Who's Online (See full list)

    • MizonSky
    • HappyAndJust
    • Shiroroku
    • HexaGoat49
    • NovaMachina
    • FREyebeans2506
    • Microcellule
    • lupicus
    • Jeldrik
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Direct rotation (not "smooth" and prettier 359 -> 0)
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community