i have a method:
[java] public void removeObject(ObjectNode objNode) {
try {
objNode.moveThread.threadDone = true;
Iterator<ExtNode> i = objNode.objectList.iterator();
while (i.hasNext()) {
ExtNode extNode = i.next();
extNode.node.setShadowMode(ShadowMode.Off);
extNode.node.removeFromParent();
i.remove();
}
} catch (Exception err) {
Debug.reportInfo(Debug.PRIORITY_ZERO, "removeObject Exception err: " + err);
}
}[/java]
when i just remove object with ShadowMode Cast, shadows are not removed.
How to properly remove shadowRendering for the Spatial. Here i tried to change ShadowMode to off and then remove node, but it don’t work. It remove spatial but not it’s shadow
Or maybe i can have error in diffrent place?
Well it should work. Could you perhaps post a test case showing this issue?
here:
testcase2.zip
sorry for very “chaotic” code, but it should work and show the problem(or not, if problem is again with my graphic card/chipset)
this should show terrain and tree and stick(with their shadows), and after 5 seconds geometry should disappear but shadows not.
Thread is just for a test so don’t worry about it
output:
after 5 seconds deleting objects:
http://i.imgur.com/6DHay.png
so, what i do wrong? :>
Can you make a real test case? A one-class application that uses the jme3 test assets like the jme3 tests?