vertex = target.getWorldCoords(null);
vertex = target.parentGeom.getWorldCoords(null);
    public void createGeometry(LightState lightState) {        if (target.getTriangleCount() != maxIndex) {            System.err.println(maxIndex + "  "+target.getTriangleCount());            recreateFaces();        }        // Holds a copy of the batch vertices transformed to world coordinates        FloatBuffer vertex = null;        // Ensure that we have some potential lights to cast shadows!        if (lightState.getQuantity() != 0) {            LightState lights = lightState;            // Update the cache of lights - if still sane, return            if (updateCache(lights))                return;            // Now scan through each light and create the shadow volume            for (int l = 0; l < lights.getQuantity(); l++) {                Light light = lights.get(l);                // Make sure we can (or want to) handle this light                if (!light.isShadowCaster()                        || (!(light.getType() == Light.LT_DIRECTIONAL) && !(light                                .getType() == Light.LT_POINT)))                    continue;                // Get the volume assoicated with this light                ShadowVolume lv = getShadowVolume(light);                // See if this light has been seen before!                if (lv == null) {                    // Create a new light volume                    lv = new ShadowVolume(light);                    if (lv.getBatchCount() < 1)                        lv.addBatch(new TriangleBatch());                    volumes.add(lv);                    lv.setUpdate(true);                }                // See if the volume requires updating                if (lv.isUpdate()) {                    lv.setUpdate(false);                    if (!target.isEnabled() || !target.isCastsShadows()) {                        lv.getBatch(0).setEnabled(false);                        continue;                    } else                        lv.getBatch(0).setEnabled(true);                                        // Translate the vertex information from the mesh to                    // world                    // coordinates if                    // we are going to do any work                    if (vertex == null) {                        vertex = target.getWorldCoords(null);                    }                    // Find out which triangles are facing the light                    // triangle will be set true for faces towards the light                    processFaces(vertex, light, target);                    // Get the edges that are in shadow                    ShadowEdge[] edges = getShadowEdges();                    // Now we need to develop a mesh based on projecting                    // these                    // edges                    // to infinity in the direction of the light                    int length = edges.length;                    // Create arrays to hold the shadow mesh                    FloatBuffer shadowVertex = lv.getBatch(0)                            .getVertexBuffer();                    if (shadowVertex == null                            || shadowVertex.capacity() < length * 12)                        shadowVertex = BufferUtils                                .createVector3Buffer(length * 4);                    FloatBuffer shadowNormal = lv.getBatch(0)                            .getNormalBuffer();                    if (shadowNormal == null                            || shadowNormal.capacity() < length * 12)                        shadowNormal = BufferUtils                                .createVector3Buffer(length * 4);                    IntBuffer shadowIndex = lv.getBatch(0)                            .getIndexBuffer();                    if (shadowIndex == null                            || shadowIndex.capacity() < length * 6)                        shadowIndex = BufferUtils                                .createIntBuffer(length * 6);                    shadowVertex.limit(length * 12);                    shadowNormal.limit(length * 12);                    shadowIndex.limit(length * 6);                    // Create quads out of the edge vertices                    createShadowQuads(vertex, edges, shadowVertex,                            shadowNormal, shadowIndex, light);                    // Rebuild the TriMesh                    lv.reconstruct(shadowVertex, shadowNormal, null, null,                            shadowIndex, 0);                    shadowVertex.rewind();                    lv.getBatch(0).setVertexCount(                            shadowVertex.remaining() / 3);                    shadowIndex.rewind();                    lv.getBatch(0).setTriangleQuantity(                            shadowIndex.remaining() / 3);                    if ((target.getLocks() & Spatial.LOCKED_SHADOWS) != 0)                        lv.lock();                    lv.updateModelBound();                }            }        } else {            // There are no volumes            volumes.clear();        }    }