Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Derkai

Pages: [1]
Support / NullPointerException when cloning Object3D
« on: March 05, 2011, 04:49:50 pm »
Hello all,

I have a little problem when cloning objects. I hope someone can help me, before I go crazy.  :-X

I create my base object:

Code: [Select]
float[] positions = ...
float[] uvs = ...
int[] indices = ...
_base = new Object3D(positions, uvs, indices, -1);

In my render/update loop i create a clone and add it to the world:

Code: [Select]
_clone1 = _base.cloneObject();

Some frames later, I remove the first clone from the world:

Code: [Select]
The same frame I want to add another clone, wich gives me a NullPointerException:

Code: [Select]
_clone2 = _base.cloneObject(); // NullPointerException in GLSurfaceView$ line: 1120

(Well there is a litte more code the this, but posting all would be to much for this one post. I hope this is enough.)

I tried everything now to find out why and how, but cant find any solution. What am I doing wrong or dont I understand here?

Pages: [1]