In the following code along with my mouse cursor i can drag the components and place but i cannot zoom the components how can i do that ? i use to write this code inside a normal camera
let grabbedActor = null;
let grabDistance = 0;
let grabOffset = null;
let rm = STU.RenderManager.getInstance();
beScript.execute = function (context) {
if (grabbedActor != null) {
let newPos = rm.getMousePositionIn3D(grabDistance);
grabbedActor.setPosition(newPos.sub(grabOffset));
}
};
beScript.grab = function (iActor) {
grabbedActor = iActor;
let actorPos = grabbedActor.getPosition();
grabDistance = rm.getCurrentCamera().getPosition().sub(actorPos).norm();
grabOffset = rm.getMousePositionIn3D(grabDistance).sub(actorPos);
};
beScript.ungrab = function () {
grabbedActor = null;
};
beScript.onAllClickablePress = function (e) {
this.grab(e.getActor());
};
beScript.onAllClickableRelease = function (e) {
this.ungrab();
};