Hi guys i have this pice of code that does not working ,and its only on jmonkey soo i wanted to ask if any 1 know anything about it
now here is a huge pice of code and that part that does not work is betwin huge ////
[java]
public String myStringa3D;
public void setStringa3D(String Stringa3D) {
this.myStringa3D = Stringa3D;
}
//2Dinterface
interface A2DInterface{
public void execute();
}
/
class Test implements A2DInterface{
public void execute(){
myStringa3D = "next class";
}
}
/** Defining the "Shoot" action: Determine what was hit and how to respond. */
private ActionListener actionListener = new ActionListener() {
public void onAction(String name, boolean keyPressed, float tpf) {
if (name.equals("Shoot") && !keyPressed) {
//My Click Start
if(inputManager.getCursorPosition().getX()<(settings.getWidth()/100*5)){
try {
//2D ray
Vector3f myVector2D = new Vector3f(inputManager.getCursorPosition().getX(),
inputManager.getCursorPosition().getY(),0);
Vector3f myVector2Df = new Vector3f(0,0,1);
Ray myRay = new Ray(myVector2D, myVector2Df);
CollisionResults myResults = new CollisionResults();
guiNode.collideWith(myRay, myResults);
MyGeometry gk=(MyGeometry) myResults.getClosestCollision().getGeometry();
//////////////////////////////////////////////////////////
///////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
Class<?> MyClass = Class.forName(gk.getClassName());
A2DInterface firstStep = ((Class<A2DInterface>)MyClass).newInstance();
firstStep.execute();
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
System.out.println("2D try WORKED OUT "+myStringa3D);
} catch (Exception e) {
System.out.println("2D try Collapsed");
}
//System.out.println("Crashed?");
System.out.println("fine 2D");
}
else{
}
[/java]
//may be missing some } below