Geometry not removed from collision tree

I removed some objects form my scene using both removefromparent and rootnode.detachallchildern. However the geometry from these objects still remains in the collision data. Anyway to manually removes these and is this a bug ? This doesn’t seem like intended behavior.

You remove them from the physics space just like you added them.

@normen said: You remove them from the physics space just like you added them.

I never added them to a physics space. I created three spatials. I added them to the root node. Then I was using the mouse pointer to detect what spatial the mouse was over using ray collision. Once the correct object was clicked I wanted to remove all the spatials from the root. so I used.

[java] @Override
public void cleanup() {
super.cleanup();
// unregister all my listeners, detach all my nodes, etc…
StartBox.removeFromParent();
ExitBox.removeFromParent();
BloodyRoom.removeFromParent();
Click.removeFromParent();
ScaryBreathe.removeFromParent();
rootNode.detachAllChildren();
// inputManager.clearMappings();

}[/java]

The screen goes black and I can no longer see my mouse. However the audio node keeps looping and when I move the mouse I can still hear the click sound when I hover over where the object used to be. It’s like the spatial is removed from the render process but the geometry remains.

@jojoofu said: I never added them to a physics space. I created three spatials. I added them to the root node. Then I was using the mouse pointer to detect what spatial the mouse was over using ray collision. Once the correct object was clicked I wanted to remove all the spatials from the root. so I used.

[java] @Override
public void cleanup() {
super.cleanup();
// unregister all my listeners, detach all my nodes, etc…
StartBox.removeFromParent();
ExitBox.removeFromParent();
BloodyRoom.removeFromParent();
Click.removeFromParent();
ScaryBreathe.removeFromParent();
rootNode.detachAllChildren();
// inputManager.clearMappings();

}[/java]

The screen goes black and I can no longer see my mouse. However the audio node keeps looping and when I move the mouse I can still hear the click sound when I hover over where the object used to be. It’s like the spatial is removed from the render process but the geometry remains.

Nope. There is no such thing. You are somehow mistaken about what you are seeing. When the geometry is removed, it is no longer rendered. The picking routine traverses the same scene graph you removed it from. So your explanation of what’s happening is just not possible.

Audio can keep looping… that has nothing to do with the scene graph at all.

The scene graph stuff is pretty easy to sort out with basic debugging skills. For example, just dump the tree to the console or examine it in the debugger. It either wasn’t removed and is still there or was removed and you are seeing something else.

Is it possible to test rays against spatials that haven’t been added to the root or have been detached. I was using the two spatials directly in the ray collision instead of referring to them from the root. I can send you the project file. There is no possible way the click sound occurs without the ray colliding with either block.

I’m sort of new to Java. Been using C++ for like 15 years. I’m taking a crash course in net beans as I go.

Well, if you call collideWith() directly on a node then it effective is the root. It doesn’t matter if it’s attached or not.

This stuff isn’t magic. The code is easily viewable with only a couple clicks. Nearly everything to do with the scene graph follows basic traversal and the root has no more meaning than any other spatial except “that’s where you start”.