Null when Object3D.CheckForCollision

Started by Melssj5, July 01, 2007, 07:26:22 AM

Previous topic - Next topic

Melssj5

Hi, I am getting a NullPointerException when calling to any of the checkForCollision methods on an Object3D.

the exception is:

java.lang.NullPointerException
        at com.threed.jpct.Object3D.checkForCollision(Unknown Source)
        at Auto.RenderThread.hacerMovimientos(RenderThread.java:262)
        at Auto.RenderThread.run(RenderThread.java:221)


both objects has the collision modes:

carro.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS | Object3D.COLLISION_CHECK_SELF);
mapa.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS | Object3D.COLLISION_CHECK_SELF);

I am using the beta version with the env forced to the second stage.
Nada por ahora

EgonOlsen

Are you by any chance calling the checkCollision-method before adding the object to the world?

Melssj5

No.  >:(

1.- load the models

2.- the object3D carro has as childs all the main parts loaded

3.- set the collision modes of carro!

4.- buildAllObjects

5.- render

6.- check the collision


Should I set the collision modes for all the parts of the car and not only to the parent of all of them?

Nada por ahora

EgonOlsen

I can't verify this problem. Whatever i do, it works fine. Can you create a minimal test case that shows this problem?

Melssj5

Nada por ahora

Melssj5

FOrget it, solved, I was adding the childs to the world but not the parent. This was the problem.
Nada por ahora