Hey everyone,
So I’m trying to implement some collision detection without physics. To my current understanding, this is entirely possible (I used the HelloPicking tutorial to help me with a lot of this code).
Anyways, this is what I have.
[java]spatial.updateGeometricState();
CollisionResults results = new CollisionResults();
spatial.collideWith(lrPaddles, results);
if (results.size() > 0)
velocity.setX(-velocity.getX());
spatial.collideWith(tbPaddles, results);
if (results.size() > 0)
velocity.setY(-velocity.getY());[/java]
This resides in the controlUpdate(tpf) method of a custom Control class. When I run the code, it gives me
com.jme3.collision.UnsupportedCollisionException
at com.jme3.collision.bih.BIHTree.collideWith(BIHTree.java:479)
at com.jme3.scene.Mesh.collideWith(Mesh.java:479)
at com.jme3.scene.Geometry.collideWith(Geometry.java:232)
at pong.ControlBall.controlUpdate(ControlBall.java:41)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:88)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:502)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:619)
at com.jme3.scene.Node.updateLogicalState(Node.java:153)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:209)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:141)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:198)
at java.lang.Thread.run(Thread.java:636)
So what am I doing wrong? My best guess is that I can’t pass a Node object to collideWith, but that’s done in HelloPicking.
Thanks for any help,
mtheoryninja