Refer to the link below, for billboard enabled meshes, I added mouse pick event so the camera will target to the mesh which being clicked.
However, after several clicks on different meshes, I got the following error. I'd be really appreciated if anyone can fix this issue. Thanks.
https://www.babylonjs-playground.com/#9XBPW4
Quote38babylon.js:1 Uncaught RangeError: Maximum call stack size exceeded
at m.h.computeWorldMatrix (babylon.js:1)
at m.h.getAbsolutePosition (babylon.js:1)
at n._getTargetPosition (babylon.js:1)
at n._isSynchronizedViewMatrix (babylon.js:1)
at n.c.getViewMatrix (babylon.js:1)
at m.h.computeWorldMatrix (babylon.js:1)
at m.h.getAbsolutePosition (babylon.js:1)
at n._getTargetPosition (babylon.js:1)
at n._isSynchronizedViewMatrix (babylon.js:1)
at n.c.getViewMatrix (babylon.js:1)
if (!m.actionManager){
m.actionManager = new BABYLON.ActionManager(scene);
}
var act = new BABYLON.ExecuteCodeAction( BABYLON.ActionManager.OnPickTrigger, pick );
m.actionManager.registerAction(act);
function pick(evt){
var mesh = evt.meshUnderPointer;
camera.setTarget(mesh);
}