@Override public void renderTileEntityAt( T te, double x, double y, double z, float partialTicks, int destroyStage ) { Pair<ItemStack, Matrix4f> pair = this.f.apply( te ); if( pair != null && pair.getLeft() != null ) { GlStateManager.pushMatrix(); if( pair.getRight() != null ) { FloatBuffer matrix = BufferUtils.createFloatBuffer( 16 ); pair.getRight().store( matrix ); matrix.flip(); GlStateManager.multMatrix( matrix ); } Minecraft.getMinecraft().getRenderItem().renderItem( pair.getLeft(), TransformType.GROUND ); GlStateManager.popMatrix(); } }
public static synchronized void loadMatrix(Matrix4f transform) { transform.store(matrixBuffer); matrixBuffer.flip(); GL11.glMultMatrix(matrixBuffer); }
public Transformation(Orientation orientation) { final javax.vecmath.Matrix4f originalMatrix = new javax.vecmath.Matrix4f(); originalMatrix.set(orientation.getLocalToWorldMatrix()); asMatrix = TRSRTransformation.toLwjgl(originalMatrix); asBuffer = BufferUtils.createFloatBuffer(16); asMatrix.store(asBuffer); asBuffer.rewind(); asInverseMatrix = new Matrix4f(); Matrix4f.invert(asMatrix, asInverseMatrix); asInverseBuffer = BufferUtils.createFloatBuffer(16); asInverseMatrix.store(asInverseBuffer); asInverseBuffer.rewind(); } }