((Geometry)obj).states[RenderState.RS_ZBUFFER] = oldZState;
batch.states[RenderState.RS_ZBUFFER] = oldZState;
    private void renderTransparentBucket() {        transparentBucket.sort();            for (int i = 0; i < transparentBucket.listSize; i++) {                Spatial obj = transparentBucket.list[i];                 if (twoPassTransparent) {                    RenderState oldCullState = ((Geometry)obj).states[RenderState.RS_CULL];                    ((Geometry)obj).states[RenderState.RS_CULL] = tranCull;                    ZBufferState oldZState = (ZBufferState)((Geometry)obj).states[RenderState.RS_ZBUFFER];                    ((Geometry)obj).states[RenderState.RS_ZBUFFER] = tranZBuff;                    // first render back-facing tris only                    tranCull.setCullMode(CullState.CS_FRONT);                    Renderer.clearCurrentState(RenderState.RS_CULL);                    obj.draw(renderer);                                                            // then render front-facing tris only                    ((Geometry)obj).states[RenderState.RS_ZBUFFER] = oldZState;                    tranCull.setCullMode(CullState.CS_BACK);                    Renderer.clearCurrentState(RenderState.RS_CULL);                    obj.draw(renderer);                    ((Geometry)obj).states[RenderState.RS_CULL] = oldCullState;                } else {                    // draw as usual                    obj.draw(renderer);                }                obj.queueDistance = Float.NEGATIVE_INFINITY;            }        transparentBucket.clear();    }