I'm actually having the same problem though the object has been added to the world. I'm trying to add collision detection to the Ninja from the Bones demo, this function is called in the initialization bit:
private void addNinja() {
AnimatedGroup ninja = masterNinja.clone(AnimatedGroup.MESH_DONT_REUSE);
ninja.getRoot().translate(0,0,-20);
ninja.getRoot().setCollisionMode(Object3D.COLLISION_CHECK_SELF);
ninja.addToWorld(world);
ninjas.add(ninja);
}
And upon pressing a button I try to check for collisions before applying the translations
directionVector = new SimpleVector(0,0,2);
.....
directionVector = ninjas.get(0).getRoot().checkForCollisionEllipsoid(directionVector, ellipsoid, 2);
ninjas.get(0).getRoot().translate(directionVector);
But I keep getting a Null error for the checkForCollision line?
EDIT:
Raft just helped me out with this. For an AnimatedGroup the set and check need to be done on the Animated3D object, not on the Object3D. In the Ninja demo ninjas.get(0) returns the animated group, ninjas.get(0).get(0) returns the Animated3D object:
ninjas.get(0).get(0).setCollisionMode(Object3D.COLLISION_CHECK_SELF);
directionVector = ninjas.get(0).get(0).checkForCollisionEllipsoid(directionVector, ellipsoid, 1);