Skip to content

Commit

Permalink
Merge pull request #5790 from TrevorDev/vrDistortMetrics
Browse files Browse the repository at this point in the history
expose distortion metric param
  • Loading branch information
sebavan committed Jan 17, 2019
2 parents 6bb81c0 + dc86f37 commit f595d70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions dist/preview release/what's new.md
Expand Up @@ -96,6 +96,7 @@
- Added per solid particle culling possibility : `solidParticle.isInFrustum()` ([jerome](https://github.com/jbousquie))
- Added transparency support to `GlowLayer` ([Sebavan](https://github.com/Sebavan))
- Added option `forceDisposeChildren` to multiMaterial.dispose ([danjpar](https://github.com/danjpar))
- Expose fallback camera distortion metrics option in vrExperienceHelper ([TrevorDev](https://github.com/TrevorDev))

### OBJ Loader
- Add color vertex support (not part of standard) ([brianzinn](https://github.com/brianzinn))
Expand Down
7 changes: 6 additions & 1 deletion src/Cameras/VR/vrExperienceHelper.ts
Expand Up @@ -26,6 +26,7 @@ import { DynamicTexture } from "../../Materials/Textures/dynamicTexture";
import { ImageProcessingPostProcess } from "../../PostProcesses/imageProcessingPostProcess";
import { SineEase, EasingFunction, CircleEase } from "../../Animations/easing";
import { Animation } from "../../Animations/animation";
import { VRCameraMetrics } from '../../Cameras/VR/vrCameraMetrics';

import "../../Meshes/Builders/groundBuilder";
import "../../Meshes/Builders/torusBuilder";
Expand Down Expand Up @@ -65,6 +66,10 @@ export interface VRExperienceHelperOptions extends WebVROptions {
* A list of meshes to be used as the teleportation floor. If specified, teleportation will be enabled (default: undefined)
*/
floorMeshes?: Mesh[];
/**
* Distortion metrics for the fallback vrDeviceOrientationCamera (default: VRCameraMetrics.Default)
*/
vrDeviceOrientationCameraMetrics?: VRCameraMetrics;
}

class VRExperienceHelperGazer implements IDisposable {
Expand Down Expand Up @@ -678,7 +683,7 @@ export class VRExperienceHelper {

// Create VR cameras
if (webVROptions.createFallbackVRDeviceOrientationFreeCamera) {
this._vrDeviceOrientationCamera = new VRDeviceOrientationFreeCamera("VRDeviceOrientationVRHelper", this._position, this._scene);
this._vrDeviceOrientationCamera = new VRDeviceOrientationFreeCamera("VRDeviceOrientationVRHelper", this._position, this._scene, true, webVROptions.vrDeviceOrientationCameraMetrics);
this._vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE;
}
this._webVRCamera = new WebVRFreeCamera("WebVRHelper", this._position, this._scene, webVROptions);
Expand Down

0 comments on commit f595d70

Please sign in to comment.