Open nigec opened 1 year ago
scifi3.zip here is the file
orbit.zip maybe like this? works if the object is in a group, it's not detected as the camera orbits:
` var orbit = program.getObjectByName("orbit"); var box = program.getObjectByName("box"); let curCamX; let preCamX; var turning; function initialize() { }
function update() {
curCamX = orbit.position.x;
if(preCamX == curCamX ){
turning = true
} else{
turning = false
}
preCamX = curCamX;
var intersects = scene.raycaster.intersectObjects(scene.children,turning);
for(var i = 0; i < intersects.length; i++)
{
if(Mouse.buttonPressed(Mouse.LEFT) && intersects[i].object.name =="box")
{
console.log("hit");
}
return scene;
}
}
`
Prevent raycaster detecting buttonpress while orbiting
Description
-How would I prevent raycasting while orbiting, I'm using orbiting to replicate a panoramic scene, my problem is while the mouse button is down to orbit, the raycaster detects the objects and fires the action
As the scene panes with the mouse button down if I pass over the doors and buttons on the keypad, they will trigger, I want the orbit to work with left click n hold