mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-04-06 17:31:09 +08:00
Fix three.js element selecting
This commit is contained in:
parent
7fbd13c6db
commit
3865b1389f
@ -114,8 +114,8 @@ export const Canvas = {
|
||||
// Main Blockbench 3D scene
|
||||
scene,
|
||||
// Pivot marker
|
||||
pivot_marker: rot_origin,
|
||||
gizmos: [rot_origin],
|
||||
pivot_marker: new THREE.Object3D(),
|
||||
gizmos: [],
|
||||
ground_animation: false,
|
||||
outlineMaterial: new THREE.LineBasicMaterial({
|
||||
linewidth: 2,
|
||||
@ -1409,11 +1409,12 @@ export const Canvas = {
|
||||
return visible_box;
|
||||
}
|
||||
}
|
||||
var buildGrid = Canvas.buildGrid;
|
||||
Canvas.gizmos.push(Canvas.pivot_marker);
|
||||
|
||||
Object.assign(window, {
|
||||
getRescalingFactor,
|
||||
Reusable,
|
||||
SolidMaterialShaders,
|
||||
Canvas,
|
||||
buildGrid: Canvas.buildGrid
|
||||
});
|
||||
|
@ -12,7 +12,6 @@ var framespersecond = 0;
|
||||
var display_mode = false;
|
||||
const canvas_scenes = {};
|
||||
export const three_grid = new THREE.Object3D();
|
||||
export const rot_origin = new THREE.Object3D();
|
||||
export const gizmo_colors = {
|
||||
r: new THREE.Color(),
|
||||
g: new THREE.Color(),
|
||||
@ -399,7 +398,7 @@ export class Preview {
|
||||
}
|
||||
})
|
||||
}
|
||||
let intersects = this.raycaster.intersectObjects( objects );
|
||||
let intersects = this.raycaster.intersectObjects(objects, false);
|
||||
if (intersects.length == 0) return false;
|
||||
|
||||
let depth_offset = Preview.selected.calculateControlScale(intersects[0].point);
|
||||
@ -2488,7 +2487,6 @@ Object.assign(window, {
|
||||
display_area,
|
||||
display_base,
|
||||
three_grid,
|
||||
rot_origin,
|
||||
gizmo_colors,
|
||||
DefaultCameraPresets,
|
||||
Preview,
|
||||
|
Loading…
x
Reference in New Issue
Block a user