if(child instanceof Node) {
clodNode.attachChild(getClodNodeFromParent((Node)child));
}
else if ( child instanceof TriMesh ) {
// Create an AreaClodMesh for that mesh. Let it compute records automatically
AreaClodMesh acm = new AreaClodMesh("part"+i,(TriMesh)child, null);
acm.setModelBound(new BoundingSphere());
acm.updateModelBound();
// Allow 1/2 of a triangle in every pixel on the screen in the bounds.
acm.setTrisPerPixel(.5f);
// Force a move of 2 units before updating the mesh geometry
acm.setDistanceTolerance(2);
// Give the clodMesh node the material state that the original had.
acm.setRenderState(child.getRenderState(RenderState.RS_MATERIAL));
// Attach clod node.
clodNode.attachChild(acm);
}
else