Hi and happy new year
There is an issue here I do not understand. If I remove the getHierarchyBoundingVectors() the setAbsolutePosition does not behave correctly ?
Anyone can explain this for me ?
Look at this piece of code:
this.mgp_occupiedstands = new BABYLON.TransformNode("occupiedstands");
this.mgp_occupiedstands.parent = this.mgp_rootmesh;
this.mgp_rootmesh.getHierarchyBoundingVectors(); //Why is this required for the position to behave correctly ?
blocks.forEach(t => {
let bstand = stand.createInstance("stand");
bstand.parent = this.mgp_occupiedstands;
let _x = ((t[0]) * mgp_ocobj.mgp_gridsquaresize);
let _y = ((t[1]) * mgp_ocobj.mgp_gridsquaresize / 4) + 0.15;
let _z = ((t[2]) * mgp_ocobj.mgp_gridsquaresize);
_x += mgp_ocobj.mgp_gridhalfsquaresize;
_z += mgp_ocobj.mgp_gridhalfsquaresize;
bstand.setAbsolutePosition(new BABYLON.Vector3(_x, _y, _z));
});
//Olav