Skip to content

Commit

Permalink
add 'enable*' methods - needed for VR 'enableTeleportation'.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianzinn committed Sep 30, 2020
1 parent 6237499 commit fad7492
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/generatedCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { FadeInOutBehavior as BabylonjsCoreFadeInOutBehavior } from "@babylonjs/
import { MultiPointerScaleBehavior as BabylonjsCoreMultiPointerScaleBehavior } from "@babylonjs/core/Behaviors/Meshes/multiPointerScaleBehavior";
import { PointerDragBehavior as BabylonjsCorePointerDragBehavior } from "@babylonjs/core/Behaviors/Meshes/pointerDragBehavior";
import { SixDofDragBehavior as BabylonjsCoreSixDofDragBehavior } from "@babylonjs/core/Behaviors/Meshes/sixDofDragBehavior";
import { VRExperienceHelper as BabylonjsCoreVRExperienceHelper, OnAfterEnteringVRObservableEvent as BabylonjsCoreOnAfterEnteringVRObservableEvent, VRExperienceHelperOptions as BabylonjsCoreVRExperienceHelperOptions } from "@babylonjs/core/Cameras/VR/vrExperienceHelper";
import { VRExperienceHelper as BabylonjsCoreVRExperienceHelper, OnAfterEnteringVRObservableEvent as BabylonjsCoreOnAfterEnteringVRObservableEvent, VRExperienceHelperOptions as BabylonjsCoreVRExperienceHelperOptions, VRTeleportationOptions as BabylonjsCoreVRTeleportationOptions } from "@babylonjs/core/Cameras/VR/vrExperienceHelper";
import { PoseEnabledControllerType as BabylonjsCorePoseEnabledControllerType } from "@babylonjs/core/Gamepads/Controllers/poseEnabledController";
import { CascadedShadowGenerator as BabylonjsCoreCascadedShadowGenerator } from "@babylonjs/core/Lights/Shadows/cascadedShadowGenerator";
import { ShadowGenerator as BabylonjsCoreShadowGenerator, ICustomShaderOptions as BabylonjsCoreICustomShaderOptions } from "@babylonjs/core/Lights/Shadows/shadowGenerator";
Expand Down Expand Up @@ -433,6 +433,7 @@ export class FiberAbstractMeshPropsHandler implements PropsHandler<FiberAbstract
checkPrimitiveDiff(oldProps.useVertexColors, newProps.useVertexColors, 'useVertexColors', changedProps)
checkPrimitiveDiff(oldProps.visibility, newProps.visibility, 'visibility', changedProps)
checkMethodDiff(oldProps.addChild, newProps.addChild, 'addChild', changedProps)
checkMethodDiff(oldProps.enableEdgesRendering, newProps.enableEdgesRendering, 'enableEdgesRendering', changedProps)
checkMethodDiff(oldProps.setBoundingInfo, newProps.setBoundingInfo, 'setBoundingInfo', changedProps)
checkMethodDiff(oldProps.setIndices, newProps.setIndices, 'setIndices', changedProps)
checkMethodDiff(oldProps.setVerticesData, newProps.setVerticesData, 'setVerticesData', changedProps)
Expand Down Expand Up @@ -1685,6 +1686,7 @@ export class FiberDeviceOrientationCameraPropsHandler implements PropsHandler<Fi
getPropertyUpdates(oldProps: FiberDeviceOrientationCameraProps, newProps: FiberDeviceOrientationCameraProps): PropertyUpdate[] | null {
const changedProps: PropertyUpdate[] = []
checkPrimitiveDiff(oldProps.disablePointerInputWhenUsingDeviceOrientation, newProps.disablePointerInputWhenUsingDeviceOrientation, 'disablePointerInputWhenUsingDeviceOrientation', changedProps)
checkMethodDiff(oldProps.enableHorizontalDragging, newProps.enableHorizontalDragging, 'enableHorizontalDragging', changedProps)
return changedProps.length === 0 ? null : changedProps;
}
}
Expand Down Expand Up @@ -12033,6 +12035,7 @@ export class FiberVRExperienceHelperPropsHandler implements PropsHandler<FiberVR
// type: 'BabylonjsCoreWebXRDefaultExperience' property (not coded) BabylonjsCoreVRExperienceHelper.xr.
checkPrimitiveDiff(oldProps.xrTestDone, newProps.xrTestDone, 'xrTestDone', changedProps)
checkMethodDiff(oldProps.addFloorMesh, newProps.addFloorMesh, 'addFloorMesh', changedProps)
checkMethodDiff(oldProps.enableTeleportation, newProps.enableTeleportation, 'enableTeleportation', changedProps)
checkMethodDiff(oldProps.setGazeColor, newProps.setGazeColor, 'setGazeColor', changedProps)
checkMethodDiff(oldProps.setLaserColor, newProps.setLaserColor, 'setLaserColor', changedProps)
checkMethodDiff(oldProps.setLaserLightingState, newProps.setLaserLightingState, 'setLaserLightingState', changedProps)
Expand Down
5 changes: 4 additions & 1 deletion src/generatedProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { FadeInOutBehavior as BabylonjsCoreFadeInOutBehavior } from "@babylonjs/
import { MultiPointerScaleBehavior as BabylonjsCoreMultiPointerScaleBehavior } from "@babylonjs/core/Behaviors/Meshes/multiPointerScaleBehavior";
import { PointerDragBehavior as BabylonjsCorePointerDragBehavior } from "@babylonjs/core/Behaviors/Meshes/pointerDragBehavior";
import { SixDofDragBehavior as BabylonjsCoreSixDofDragBehavior } from "@babylonjs/core/Behaviors/Meshes/sixDofDragBehavior";
import { VRExperienceHelper as BabylonjsCoreVRExperienceHelper, OnAfterEnteringVRObservableEvent as BabylonjsCoreOnAfterEnteringVRObservableEvent, VRExperienceHelperOptions as BabylonjsCoreVRExperienceHelperOptions } from "@babylonjs/core/Cameras/VR/vrExperienceHelper";
import { VRExperienceHelper as BabylonjsCoreVRExperienceHelper, OnAfterEnteringVRObservableEvent as BabylonjsCoreOnAfterEnteringVRObservableEvent, VRExperienceHelperOptions as BabylonjsCoreVRExperienceHelperOptions, VRTeleportationOptions as BabylonjsCoreVRTeleportationOptions } from "@babylonjs/core/Cameras/VR/vrExperienceHelper";
import { PoseEnabledControllerType as BabylonjsCorePoseEnabledControllerType } from "@babylonjs/core/Gamepads/Controllers/poseEnabledController";
import { CascadedShadowGenerator as BabylonjsCoreCascadedShadowGenerator } from "@babylonjs/core/Lights/Shadows/cascadedShadowGenerator";
import { ShadowGenerator as BabylonjsCoreShadowGenerator, ICustomShaderOptions as BabylonjsCoreICustomShaderOptions } from "@babylonjs/core/Lights/Shadows/shadowGenerator";
Expand Down Expand Up @@ -466,6 +466,7 @@ export type FiberAbstractMeshProps = {
'ellipsoidOffset-x'?: number;
'ellipsoidOffset-y'?: number;
'ellipsoidOffset-z'?: number;
enableEdgesRendering?: any;
enablePointerMoveEvents?: boolean;
facetDepthSortFrom?: BabylonjsCoreVector3;
'facetDepthSortFrom-x'?: number;
Expand Down Expand Up @@ -723,6 +724,7 @@ export type FiberStereoscopicUniversalCameraPropsCtor = {
};
export type FiberDeviceOrientationCameraProps = {
disablePointerInputWhenUsingDeviceOrientation?: boolean;
enableHorizontalDragging?: any;
} & FiberFreeCameraProps;
export type FiberDeviceOrientationCameraPropsCtor = {
name: string;
Expand Down Expand Up @@ -2785,6 +2787,7 @@ export type FiberVRExperienceHelperProps = {
displayLaserPointer?: boolean;
displayVRButton?: any;
enableGazeEvenWhenNoPointerLock?: boolean;
enableTeleportation?: any;
exitVROnDoubleTap?: boolean;
gazeTrackerMesh?: BabylonjsCoreMesh;
meshSelectionPredicate?: (mesh: BabylonjsCoreAbstractMesh) => boolean;
Expand Down
2 changes: 1 addition & 1 deletion tools/generate-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ const getInstanceSetMethods = (classDeclaration: ClassDeclaration): MethodDeclar
classDeclaration.getInstanceMethods().forEach((methodDeclaration: MethodDeclaration) => {
const methodName = methodDeclaration.getName();
// TODO: add ?
if (methodName.startsWith('set') || methodName.startsWith('add') || methodName === 'translate') {
if (methodName.startsWith('set') || methodName.startsWith('add') || methodName.startsWith('enable') || methodName === 'translate') {
instanceSetMethods.push(methodDeclaration)
}
})
Expand Down

0 comments on commit fad7492

Please sign in to comment.