Abuse Posted December 16, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Token Posted December 16, 2016 Share Posted December 16, 2016 Maybe Position#getTileHeight() and Entity#getHeight() 1 Quote Link to comment Share on other sites More sharing options...
Abuse Posted December 16, 2016 Author Share Posted December 16, 2016 Maybe Position#getTileHeight() and Entity#getHeight() Unfortunately getTileHeight always returns 0, and getHeight returns the model height Quote Link to comment Share on other sites More sharing options...
Token Posted December 16, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Abuse Posted December 16, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...