Hello everyone.
I use cam.attachControl(canvas, true)
to move my camera with the mouse or fingers and it’s very convenient.
When I click on a mesh from my scene, I disables the camera control and I would like a similar control to be made to rotate and move my mesh.
This is my actual code :
myMesh.actionManager.registerAction(
new BABYLON.ExecuteCodeAction({
trigger: BABYLON.ActionManager.OnPickTrigger,
},
function (event) {
const pickedMesh = event.meshUnderPointer
app.$data.opened.scene._activeCamera.inputs.clear()
console.log(pickedMesh.getPositionExpressedInLocalSpace())
// how move my mesh with fingers or mouse here ?
}
)
)
Is there a simple way to do this ?
I’m starting with Babylon.js and if my code can be simplified, I’d like to know how.
Thank you