Abuse Posted December 16, 2016 Posted December 16, 2016 (edited) Hey, I am working on a middle mouse button camera rotation class, I have been able to calculate the required camera yaw angle to get the entity into the gameview however I am having troubles calculating the pitch angle. I need a function that can return me the local 'grid' Z position of an entity, just like getCamera().getZ() does. I've noticed that entities have getGridX() and getGridY() functionality, but I couldn't find anything that returns the Z value (Unless its always the same as position.getZ() Best case scenario would be finding Z position relative to my player (or camera) Edited December 16, 2016 by Abuse
Token Posted December 16, 2016 Posted December 16, 2016 Maybe Position#getTileHeight() and Entity#getHeight() 1
Abuse Posted December 16, 2016 Author Posted December 16, 2016 Maybe Position#getTileHeight() and Entity#getHeight() Unfortunately getTileHeight always returns 0, and getHeight returns the model height
Token Posted December 16, 2016 Posted December 16, 2016 Unfortunately getTileHeight always returns 0, and getHeight returns the model height Try the getTileHeight() in GraphicUtilities class, that one should not return 0. Add the model height to that and you got the top of the entity. 1
Abuse Posted December 16, 2016 Author Posted December 16, 2016 Try the getTileHeight() in GraphicUtilities class, that one should not return 0. Add the model height to that and you got the top of the entity. Awesome, exactly what I was looking for