extended Object3D in world

Started by Sloothword, July 19, 2006, 08:35:56 PM

Previous topic - Next topic

Sloothword

Hi

I  extended Object3D with:
public class GameObject3D extends Object3D {

my Constructor is the following:
public GameObject3D(Object3D arg0){
super(arg0);
}


Now the problem:

I add this Object to the world using
myWorld.addObject(myGameObject3D);
When calling myWorld.getObject(2) with an GameObject3D on position 2 I get the Error: can't retrieve object #2

Thx for all Help
Sloothword

EgonOlsen

This has nothing to do with your class extending Object3D. That's fine. The getObject()-method in World needs the ID of the object, not the position. You can obtain this ID either from the Object3D itself or you use the int-value returned by World.addObject().

Sloothword

I use the Object3D.getID();
Sorry position is the wrong word.
Its ahrd to Debug because I edit the World in two threads which you should never do. So I first have to change my Structure and then I can test this problem again.
Thanks for your quick help.
jPCT is just great