Is there a way to detect a collision between a geometry and a Node? Sorry if that is a stupid question but didn’t find anything on it.
Thanks
With the bounding volume of the node, yeah.
But i have a x number of colliding able nodes and one geom, and i want to know if that geom is colliding with any of the nodes.
I am trying to do a spell, that will freeze any object in the “selectable” node that is in a certain radius.
Like, my geometry checks if he has a collision, if he has one he get the user Data of it to get to the class of it and then do something.
So how can i make the geometry “listen” for collision with a node>?
Ok nvm, i just found out how stupid i am xD a node is a parent of a geometry.
aniway i have this weird error :
[java]com.jme3.collision.UnsupportedCollisionException
at com.jme3.collision.bih.BIHTree.collideWith(BIHTree.java:461)
at com.jme3.scene.Mesh.collideWith(Mesh.java:856)
at com.jme3.scene.Geometry.collideWith(Geometry.java:454)
at Objects.Spell.IceSpells.FFSpell_02.<init>(FFSpell_02.java:62)
at Objects.Spells.checkCreate(Spells.java:82)
at Objects.Spells.update(Spells.java:67)
at Objects.Players.Player2D.update(Player2D.java:87)
at Objects.Objects.objectsUpdate(Objects.java:69)
at Rooms.MainLand.update(MainLand.java:181)
at Engine.Main.simpleUpdate(Main.java:57)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:241)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:722)
[/java]
that say this code does it :
[java]// Calculate detection results
CollisionResults results = new CollisionResults();
geom.collideWith(room.getRmNode(), results); // THIS PART IS THE ERROR
System.out.println("Number of Collisions between" +
geom.getName()+ " and " + room.getRmNode().getName() + ": " + results.size());[/java]
Any suggestion on fixing it?