Browse Source

VR Laser color change

sebavan 6 years ago
parent
commit
13ca613447
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/Cameras/VR/vrExperienceHelper.ts

+ 8 - 0
src/Cameras/VR/vrExperienceHelper.ts

@@ -522,6 +522,10 @@ export class VRExperienceHelper {
      * If the gaze trackers color should be updated when selecting meshes
      * If the gaze trackers color should be updated when selecting meshes
      */
      */
     public updateGazeTrackerColor = true;
     public updateGazeTrackerColor = true;
+    /**
+     * If the controller laser color should be updated when selecting meshes
+     */
+    public updateControllerLaserColor = true;
 
 
     /**
     /**
      * The gaze tracking mesh corresponding to the left controller
      * The gaze tracking mesh corresponding to the left controller
@@ -2014,6 +2018,10 @@ export class VRExperienceHelper {
      * @param color new color for the ray.
      * @param color new color for the ray.
      */
      */
     public changeLaserColor(color: Color3) {
     public changeLaserColor(color: Color3) {
+        if (!this.updateControllerLaserColor) {
+            return;
+        }
+
         if (this._leftController) {
         if (this._leftController) {
             this._leftController._setLaserPointerColor(color);
             this._leftController._setLaserPointerColor(color);