David Catuhe 5 年之前
父节点
当前提交
324eca6790

+ 2 - 0
nodeEditor/src/diagram/graphCanvas.tsx

@@ -588,6 +588,8 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
 
 
             this._frameCandidate.parentElement!.removeChild(this._frameCandidate);
             this._frameCandidate.parentElement!.removeChild(this._frameCandidate);
             this._frameCandidate = null;
             this._frameCandidate = null;
+
+            this.props.globalState.onSelectionChangedObservable.notifyObservers(newFrame);
          }
          }
     }
     }
 
 

+ 5 - 5
src/Behaviors/Meshes/pointerDragBehavior.ts

@@ -95,7 +95,7 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
     /**
     /**
      * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
      * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
      */
      */
-    public useObjectOrienationForDragging = true;
+    public useObjectOrientationForDragging = true;
 
 
     private _options: { dragAxis?: Vector3, dragPlaneNormal?: Vector3 };
     private _options: { dragAxis?: Vector3, dragPlaneNormal?: Vector3 };
 
 
@@ -330,8 +330,8 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
             var dragLength = 0;
             var dragLength = 0;
             // depending on the drag mode option drag accordingly
             // depending on the drag mode option drag accordingly
             if (this._options.dragAxis) {
             if (this._options.dragAxis) {
-                // Convert local drag axis to world if useObjectOrienationForDragging
-                this.useObjectOrienationForDragging ? Vector3.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis) : this._worldDragAxis.copyFrom(this._options.dragAxis);
+                // Convert local drag axis to world if useObjectOrientationForDragging
+                this.useObjectOrientationForDragging ? Vector3.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis) : this._worldDragAxis.copyFrom(this._options.dragAxis);
 
 
                 // Project delta drag from the drag plane onto the drag axis
                 // Project delta drag from the drag plane onto the drag axis
                 pickedPoint.subtractToRef(this.lastDragPosition, this._tmpVector);
                 pickedPoint.subtractToRef(this.lastDragPosition, this._tmpVector);
@@ -400,7 +400,7 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
     private _updateDragPlanePosition(ray: Ray, dragPlanePosition: Vector3) {
     private _updateDragPlanePosition(ray: Ray, dragPlanePosition: Vector3) {
         this._pointA.copyFrom(dragPlanePosition);
         this._pointA.copyFrom(dragPlanePosition);
         if (this._options.dragAxis) {
         if (this._options.dragAxis) {
-            this.useObjectOrienationForDragging ? Vector3.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis);
+            this.useObjectOrientationForDragging ? Vector3.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis);
 
 
             // Calculate plane normal in direction of camera but perpendicular to drag axis
             // Calculate plane normal in direction of camera but perpendicular to drag axis
             this._pointA.addToRef(this._localAxis, this._pointB); // towards drag axis
             this._pointA.addToRef(this._localAxis, this._pointB); // towards drag axis
@@ -418,7 +418,7 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
             this._pointA.addToRef(this._lookAt, this._lookAt);
             this._pointA.addToRef(this._lookAt, this._lookAt);
             this._dragPlane.lookAt(this._lookAt);
             this._dragPlane.lookAt(this._lookAt);
         } else if (this._options.dragPlaneNormal) {
         } else if (this._options.dragPlaneNormal) {
-            this.useObjectOrienationForDragging ? Vector3.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal);
+            this.useObjectOrientationForDragging ? Vector3.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal);
             this._dragPlane.position.copyFrom(this._pointA);
             this._dragPlane.position.copyFrom(this._pointA);
             this._pointA.addToRef(this._localAxis, this._lookAt);
             this._pointA.addToRef(this._localAxis, this._lookAt);
             this._dragPlane.lookAt(this._lookAt);
             this._dragPlane.lookAt(this._lookAt);

+ 1 - 1
src/Gizmos/boundingBoxGizmo.ts

@@ -549,7 +549,7 @@ export class BoundingBoxGizmo extends Gizmo {
         this._dragMesh = Mesh.CreateBox("dummy", 1, this.gizmoLayer.utilityLayerScene);
         this._dragMesh = Mesh.CreateBox("dummy", 1, this.gizmoLayer.utilityLayerScene);
         this._dragMesh.visibility = 0;
         this._dragMesh.visibility = 0;
         this._dragMesh.rotationQuaternion = new Quaternion();
         this._dragMesh.rotationQuaternion = new Quaternion();
-        this.pointerDragBehavior.useObjectOrienationForDragging = false;
+        this.pointerDragBehavior.useObjectOrientationForDragging = false;
         this._dragMesh.addBehavior(this.pointerDragBehavior);
         this._dragMesh.addBehavior(this.pointerDragBehavior);
     }
     }
 
 

+ 3 - 0
src/Meshes/instancedMesh.ts

@@ -332,7 +332,10 @@ export class InstancedMesh extends AbstractMesh {
         if (this._currentLOD && this._currentLOD.billboardMode !== TransformNode.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {
         if (this._currentLOD && this._currentLOD.billboardMode !== TransformNode.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {
             let tempMaster = this._currentLOD._masterMesh;
             let tempMaster = this._currentLOD._masterMesh;
             this._currentLOD._masterMesh = this;
             this._currentLOD._masterMesh = this;
+            TmpVectors.Vector3[7].copyFrom(this._currentLOD.position);
+            this._currentLOD.position.set(0, 0, 0);
             TmpVectors.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(true));
             TmpVectors.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(true));
+            this._currentLOD.position.copyFrom(TmpVectors.Vector3[7]);
             this._currentLOD._masterMesh = tempMaster;
             this._currentLOD._masterMesh = tempMaster;
             return TmpVectors.Matrix[0];
             return TmpVectors.Matrix[0];
         }
         }