|
@@ -429,6 +429,11 @@ export class VRExperienceHelper {
|
|
private _leftController: Nullable<VRExperienceHelperControllerGazer> = null;
|
|
private _leftController: Nullable<VRExperienceHelperControllerGazer> = null;
|
|
private _rightController: Nullable<VRExperienceHelperControllerGazer> = null;
|
|
private _rightController: Nullable<VRExperienceHelperControllerGazer> = null;
|
|
|
|
|
|
|
|
+ private _gazeColor: Color3 = new Color3(0.7, 0.7, 0.7);
|
|
|
|
+ private _laserColor: Color3 = new Color3(0.7, 0.7, 0.7);
|
|
|
|
+ private _pickedLaserColor: Color3 = new Color3(0.2, 0.2, 1);
|
|
|
|
+ private _pickedGazeColor: Color3 = new Color3(0, 0, 1);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Observable raised when a new mesh is selected based on meshSelectionPredicate
|
|
* Observable raised when a new mesh is selected based on meshSelectionPredicate
|
|
*/
|
|
*/
|
|
@@ -2193,13 +2198,13 @@ export class VRExperienceHelper {
|
|
this.onNewMeshPicked.notifyObservers(hit);
|
|
this.onNewMeshPicked.notifyObservers(hit);
|
|
gazer._currentMeshSelected = hit.pickedMesh;
|
|
gazer._currentMeshSelected = hit.pickedMesh;
|
|
if (hit.pickedMesh.isPickable && hit.pickedMesh.actionManager) {
|
|
if (hit.pickedMesh.isPickable && hit.pickedMesh.actionManager) {
|
|
- this.changeGazeColor(new Color3(0, 0, 1));
|
|
|
|
- this.changeLaserColor(new Color3(0.2, 0.2, 1));
|
|
|
|
|
|
+ this.changeGazeColor(this._pickedGazeColor);
|
|
|
|
+ this.changeLaserColor(this._pickedLaserColor);
|
|
gazer._isActionableMesh = true;
|
|
gazer._isActionableMesh = true;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- this.changeGazeColor(new Color3(0.7, 0.7, 0.7));
|
|
|
|
- this.changeLaserColor(new Color3(0.7, 0.7, 0.7));
|
|
|
|
|
|
+ this.changeGazeColor(this._gazeColor);
|
|
|
|
+ this.changeLaserColor(this._laserColor);
|
|
gazer._isActionableMesh = false;
|
|
gazer._isActionableMesh = false;
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
@@ -2216,8 +2221,8 @@ export class VRExperienceHelper {
|
|
else {
|
|
else {
|
|
this._notifySelectedMeshUnselected(gazer._currentMeshSelected);
|
|
this._notifySelectedMeshUnselected(gazer._currentMeshSelected);
|
|
gazer._currentMeshSelected = null;
|
|
gazer._currentMeshSelected = null;
|
|
- this.changeGazeColor(new Color3(0.7, 0.7, 0.7));
|
|
|
|
- this.changeLaserColor(new Color3(0.7, 0.7, 0.7));
|
|
|
|
|
|
+ this.changeGazeColor(this._gazeColor);
|
|
|
|
+ this.changeLaserColor(this._laserColor);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2225,8 +2230,8 @@ export class VRExperienceHelper {
|
|
this._notifySelectedMeshUnselected(gazer._currentMeshSelected);
|
|
this._notifySelectedMeshUnselected(gazer._currentMeshSelected);
|
|
gazer._currentMeshSelected = null;
|
|
gazer._currentMeshSelected = null;
|
|
//this._teleportationAllowed = false;
|
|
//this._teleportationAllowed = false;
|
|
- this.changeGazeColor(new Color3(0.7, 0.7, 0.7));
|
|
|
|
- this.changeLaserColor(new Color3(0.7, 0.7, 0.7));
|
|
|
|
|
|
+ this.changeGazeColor(this._gazeColor);
|
|
|
|
+ this.changeLaserColor(this._laserColor);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2237,6 +2242,26 @@ export class VRExperienceHelper {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * Permanently set new colors for the laser pointer
|
|
|
|
+ * @param color the new laser color
|
|
|
|
+ * @param pickedColor the new laser color when picked mesh detected
|
|
|
|
+ */
|
|
|
|
+ public setLaserColor(color: Color3, pickedColor: Color3 = this._pickedLaserColor) {
|
|
|
|
+ this._laserColor = color;
|
|
|
|
+ this._pickedLaserColor = pickedColor;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Permanently set new colors for the gaze pointer
|
|
|
|
+ * @param color the new gaze color
|
|
|
|
+ * @param pickedColor the new gaze color when picked mesh detected
|
|
|
|
+ */
|
|
|
|
+ public setGazeColor(color: Color3, pickedColor: Color3 = this._pickedGazeColor) {
|
|
|
|
+ this._gazeColor = color;
|
|
|
|
+ this._pickedGazeColor = pickedColor;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Sets the color of the laser ray from the vr controllers.
|
|
* Sets the color of the laser ray from the vr controllers.
|
|
* @param color new color for the ray.
|
|
* @param color new color for the ray.
|
|
*/
|
|
*/
|