Thats all fair and square…however
try adding a tower which is 15 blocks high and each “level” has 3 blocks going horizontally across the x axis and another going in the direction (either z or y, whichever…).
Heck, il even supply you the code:
private void initFacingBlocks() {
for (int i = 0; i < NUM_OF_ROWS; i++) {
for (int j = 0; j < 3; j++) {
TextureState boxTS = TextureLoader.loadTexture("jmetest/data/texture/crate.png");
Box box = new Box("Facing Box " + i + ", " + j, new Vector3f(),
6, 2, 2);
box.setModelBound(new OrientedBoundingBox());
box.updateModelBound();
box.getLocalTranslation().x = 0;
box.getLocalTranslation().y = i * 10f;
box.getLocalTranslation().z = j * 4.2f - 4.2f;
box.setRenderState(boxTS);
towerNode.attachChild(box);
SimplePhysicsObject obj = new SimplePhysicsObject(box, 20f);
}
}
}
private void initLeftBlocks() {
for (int i = 0; i < NUM_OF_ROWS; i++) {
for (int j = 0; j < 3; j++) {
TextureState boxTS = TextureLoader.loadTexture("jmetest/data/texture/crate.png");
Box box = new Box("Left Box " + i + ", " + j, new Vector3f(),
2, 2, 6);
box.setModelBound(new OrientedBoundingBox());
box.updateModelBound();
box.getLocalTranslation().x = j * 4.2f - 4.2f;
box.getLocalTranslation().y = 5f + (i * 10f);
box.getLocalTranslation().z = 0;
box.setRenderState(boxTS);
towerNode.attachChild(box);
SimplePhysicsObject obj = new SimplePhysicsObject(box, 20f);
}
}
}
Set the NUM_OF_ROWS to 8, it works fine…10, works fine…however, when u go wild and put 15, it works…as long as they dont all have contact!
As soon as the top most blocks start touching…kabooom:
Thats all ODEJava says…It seems to be its nothing to do with the java stack, but rather with an internal limit somehow…
Ofcourse increasing the stack size doesn’t help. It would only help on adding objects, not contact…
Is there a set number of contacts that can occur at any one given time?
DP