Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public void addRotation(RenderPlayerEvent.Pre event)
- {
- EntityPlayer p = event.getEntityPlayer();
- if(this.isPassenger(p))
- {
- double visualPitch = this.capab.getRotPitch() * 180 / Math.PI;
- double visualYaw = this.capab.getRotYaw() * 180 / Math.PI;
- GlStateManager.pushMatrix();
- GlStateManager.rotate((float) (180.0F - visualYaw) / 2, 0.0F, 1.0F, 0.0F);
- GlStateManager.rotate((float) (visualPitch - 90.0F) / 2, -1.0F, 0.0F, 0.0F);
- }
- }
- @SubscribeEvent
- public void removeRotation(RenderPlayerEvent.Post event)
- {
- if(this.isPassenger(event.getEntityPlayer()))
- {
- GlStateManager.popMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement