mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-02-01 16:08:17 +00:00
当Mesh.useSelectionBox === false时,不使用包围盒。
This commit is contained in:
parent
1552d87b41
commit
11c43dd6c6
@ -62,7 +62,7 @@ function Editor(app) {
|
||||
this.grid = new THREE.GridHelper(60, 60);
|
||||
this.sceneHelpers.add(this.grid);
|
||||
|
||||
// 选中包围盒
|
||||
// 选中包围盒(当mesh.useSelectionBox === false时,不使用包围盒)
|
||||
this.selectionBox = new THREE.BoxHelper();
|
||||
this.selectionBox.material.depthTest = false;
|
||||
this.selectionBox.material.transparent = true;
|
||||
|
||||
@ -46,6 +46,7 @@ AddFireEvent.prototype.onAddFire = function () {
|
||||
);
|
||||
|
||||
fire.mesh.name = 'Fire ' + ID++;
|
||||
fire.mesh.useSelectionBox = false;
|
||||
fire.mesh.geometry.boundingBox = new THREE.Box3(
|
||||
new THREE.Vector3(-fireWidth, -fireHeight, -fireDepth),
|
||||
new THREE.Vector3(fireWidth, fireHeight, fireDepth)
|
||||
|
||||
@ -25,7 +25,7 @@ GeometryEvent.prototype.stop = function () {
|
||||
GeometryEvent.prototype.onGeometryChanged = function (object) {
|
||||
var selectionBox = this.app.editor.selectionBox;
|
||||
|
||||
if (object !== undefined) {
|
||||
if (object !== undefined && object.useSelectionBox !== false) {
|
||||
selectionBox.setFromObject(object);
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ ObjectEvent.prototype.onObjectChanged = function (object) {
|
||||
var selectionBox = editor.selectionBox;
|
||||
var transformControls = editor.transformControls;
|
||||
|
||||
if (editor.selected === object) {
|
||||
if (editor.selected === object && object.useSelectionBox !== false) {
|
||||
selectionBox.setFromObject(object);
|
||||
transformControls.update();
|
||||
}
|
||||
@ -88,7 +88,7 @@ ObjectEvent.prototype.onObjectSelected = function (object) {
|
||||
|
||||
if (object !== null && object !== scene) {
|
||||
box.setFromObject(object);
|
||||
if (box.isEmpty() === false) {
|
||||
if (box.isEmpty() === false && object.useSelectionBox !== false) {
|
||||
selectionBox.setFromObject(object);
|
||||
selectionBox.visible = true;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ TransformControlsEvent.prototype.onChange = function () {
|
||||
|
||||
var object = transformControls.object;
|
||||
|
||||
if (object !== undefined) {
|
||||
if (object !== undefined && object.useSelectionBox !== false) {
|
||||
selectionBox.setFromObject(object);
|
||||
|
||||
if (editor.helpers[object.id] !== undefined) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user