|
@@ -78,19 +78,19 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature implem
|
|
/**
|
|
/**
|
|
* This color will be set to the laser pointer when selection is triggered
|
|
* This color will be set to the laser pointer when selection is triggered
|
|
*/
|
|
*/
|
|
- public laserPointerPickedColor: Color3 = new Color3(0.7, 0.7, 0.7);
|
|
|
|
|
|
+ public laserPointerPickedColor: Color3 = new Color3(0.9, 0.9, 0.9);
|
|
/**
|
|
/**
|
|
* This color will be applied to the selection ring when selection is triggered
|
|
* This color will be applied to the selection ring when selection is triggered
|
|
*/
|
|
*/
|
|
- public selectionMeshPickedColor: Color3 = new Color3(0.7, 0.7, 0.7);
|
|
|
|
|
|
+ public selectionMeshPickedColor: Color3 = new Color3(0.3, 0.3, 1.0);
|
|
/**
|
|
/**
|
|
* default color of the selection ring
|
|
* default color of the selection ring
|
|
*/
|
|
*/
|
|
- public selectionMeshDefaultColor: Color3 = new Color3(0.5, 0.5, 0.5);
|
|
|
|
|
|
+ public selectionMeshDefaultColor: Color3 = new Color3(0.8, 0.8, 0.8);
|
|
/**
|
|
/**
|
|
* Default color of the laser pointer
|
|
* Default color of the laser pointer
|
|
*/
|
|
*/
|
|
- public lasterPointerDefaultColor: Color3 = new Color3(0.5, 0.5, 0.5);
|
|
|
|
|
|
+ public lasterPointerDefaultColor: Color3 = new Color3(0.7, 0.7, 0.7);
|
|
|
|
|
|
/**
|
|
/**
|
|
* Should the laser pointer be displayed
|
|
* Should the laser pointer be displayed
|
|
@@ -101,6 +101,16 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature implem
|
|
*/
|
|
*/
|
|
public displaySelectionMesh: boolean = true;
|
|
public displaySelectionMesh: boolean = true;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Disable lighting on the laser pointer (so it will always be visible)
|
|
|
|
+ */
|
|
|
|
+ public disablePointerLighting: boolean = true;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Disable lighting on the selection mesh (so it will always be visible)
|
|
|
|
+ */
|
|
|
|
+ public disableSelectionMeshLighting: boolean = true;
|
|
|
|
+
|
|
private static _idCounter = 0;
|
|
private static _idCounter = 0;
|
|
|
|
|
|
private _tmpRay = new Ray(new Vector3(), new Vector3());
|
|
private _tmpRay = new Ray(new Vector3(), new Vector3());
|
|
@@ -376,6 +386,8 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature implem
|
|
}
|
|
}
|
|
|
|
|
|
controllerData.laserPointer.isVisible = this.displayLaserPointer;
|
|
controllerData.laserPointer.isVisible = this.displayLaserPointer;
|
|
|
|
+ (<StandardMaterial>controllerData.laserPointer.material).disableLighting = this.disablePointerLighting;
|
|
|
|
+ (<StandardMaterial>controllerData.selectionMesh.material).disableLighting = this.disableSelectionMeshLighting;
|
|
|
|
|
|
if (controllerData.pick) {
|
|
if (controllerData.pick) {
|
|
this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
|
|
this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
|
|
@@ -424,7 +436,7 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature implem
|
|
laserPointer.parent = xrController.pointer;
|
|
laserPointer.parent = xrController.pointer;
|
|
let laserPointerMaterial = new StandardMaterial("laserPointerMat", this._scene);
|
|
let laserPointerMaterial = new StandardMaterial("laserPointerMat", this._scene);
|
|
laserPointerMaterial.emissiveColor = this.lasterPointerDefaultColor;
|
|
laserPointerMaterial.emissiveColor = this.lasterPointerDefaultColor;
|
|
- laserPointerMaterial.alpha = 0.6;
|
|
|
|
|
|
+ laserPointerMaterial.alpha = 0.7;
|
|
laserPointer.material = laserPointerMaterial;
|
|
laserPointer.material = laserPointerMaterial;
|
|
laserPointer.rotation.x = Math.PI / 2;
|
|
laserPointer.rotation.x = Math.PI / 2;
|
|
this._updatePointerDistance(laserPointer, 1);
|
|
this._updatePointerDistance(laserPointer, 1);
|