|
@@ -12,6 +12,7 @@ import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
|
|
|
import { StandardMaterial } from "../Materials/standardMaterial";
|
|
|
import { RotationGizmo } from "./rotationGizmo";
|
|
|
import { Angle } from '../Maths/math.path';
|
|
|
+import { LinesMesh } from 'Meshes/linesMesh';
|
|
|
|
|
|
/**
|
|
|
* Single plane rotation gizmo
|
|
@@ -221,19 +222,22 @@ export class PlaneRotationGizmo extends Gizmo {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
|
|
|
- // if (this._customMeshSet) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this._isHovered = !!(pointerInfo.pickInfo && (this._rootMesh.getChildMeshes().indexOf(<Mesh>pointerInfo.pickInfo.pickedMesh) != -1));
|
|
|
- // var material = this._isHovered ? hoverMaterial : coloredMaterial;
|
|
|
- // this._rootMesh.getChildMeshes().forEach((m) => {
|
|
|
- // m.material = material;
|
|
|
- // if ((<LinesMesh>m).color) {
|
|
|
- // (<LinesMesh>m).color = material.diffuseColor;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // });
|
|
|
+ this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
|
|
|
+ if (this._customMeshSet) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._isHovered = !!(pointerInfo.pickInfo && (this._rootMesh.getChildMeshes().indexOf(<Mesh>pointerInfo.pickInfo.pickedMesh) != -1));
|
|
|
+ if (!this._parent) {
|
|
|
+ // Enable Hover Events for AxisViewer use-case
|
|
|
+ var material = this._isHovered ? this._hoverMaterial : this._coloredMaterial;
|
|
|
+ this._rootMesh.getChildMeshes().forEach((m) => {
|
|
|
+ m.material = material;
|
|
|
+ if ((<LinesMesh>m).color) {
|
|
|
+ (<LinesMesh>m).color = material.diffuseColor;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
var light = gizmoLayer._getSharedGizmoLight();
|
|
|
light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(false));
|