mesh.parentGeom.updateWorldVectors(); worldRotation = mesh.parentGeom.getWorldRotation(); worldScale = mesh.parentGeom.getWorldScale(); worldTranslation = mesh.parentGeom.getWorldTranslation();
mesh.getParentGeom().updateWorldVectors(); worldRotation = mesh.getParentGeom().getWorldRotation(); worldScale = mesh.getParentGeom().getWorldScale(); worldTranslation = mesh.getParentGeom().getWorldTranslation();
    protected float calculateDistance() {        ArrayList tris = getTargetTris();        if ( tris.isEmpty() ) {            return Float.POSITIVE_INFINITY;        }        TriangleBatch mesh = (TriangleBatch) getTargetMesh();        mesh.parentGeom.updateWorldVectors();        worldRotation = mesh.parentGeom.getWorldRotation();        worldScale = mesh.parentGeom.getWorldScale();        worldTranslation = mesh.parentGeom.getWorldTranslation();        worldTriangle = new Vector3f[3];        int i;        for ( i = 0; i < 3; i++ ) {            worldTriangle[i] = new Vector3f();        }        intersectionPoint = new Vector3f();        Vector3f[] vertices = new Vector3f[3];        float distance = Float.MAX_VALUE;        for ( i = 0; i < tris.size(); i++ ) {            int triIndex = ( (Integer) tris.get( i ) ).intValue();            mesh.getTriangle( triIndex, vertices );            float triDistance = getDistanceToTriangle( vertices );            if ( triDistance > 0 && triDistance < distance ) {                distance = triDistance;            }        }        if ( distance == Float.MAX_VALUE ) {            LoggingSystem.getLogger().warning( "Couldn't detect nearest triangle intersection!" );        } else distance = FastMath.sqrt(distance);        return distance;    }