I import model houses from 3ds max
but my player can walk through them.
How to set to block house ? I don't understand about collision :?
public void buildHouse(String name,String file) {
Node model = null;
try {
MaxToJme C1 = new MaxToJme();
ByteArrayOutputStream BO = new ByteArrayOutputStream();
URL maxFile = Level3.class.getClassLoader().getResource(file);
C1.convert(new BufferedInputStream(maxFile.openStream()),BO);
model = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
model.setModelBound(new BoundingBox());
model.updateModelBound();
} catch (IOException e) {
logger
.throwing(this.getClass().toString(), "buildPlayer()",
e);
}
this.attachChild(model);
}
private void buildVillage() {
//Create house
n2 = new Node("Node 2 for collision");
Village village1 = new Village();
village1.buildHouse("house1","Model/modelhouse.3ds");
village1.setLocalScale(1f);
village1.setLocalTranslation(new Vector3f(70,-1.83f,70));
scene.attachChild(village1);
}
my output