From 310bb1d0267c7af775eeed5611369984bd67a3bb Mon Sep 17 00:00:00 2001 From: Brian Zinn Date: Tue, 4 Feb 2020 09:14:28 -0800 Subject: [PATCH] Fix Model typings. Add Shadow Caster Exclude list. Release 2.0.3 --- README.md | 2 +- package.json | 2 +- src/CreatedInstance.ts | 4 ++++ src/customComponents/EnvironmentHelperLifecycleListener.ts | 1 + src/customHosts/index.ts | 1 - src/model/index.ts | 2 +- src/react-babylonjs.ts | 2 +- stories/babylonjs/2-withVR/withVr.stories.js | 4 ++-- stories/babylonjs/ScaledModelWithProgress.js | 2 +- 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index af70d978..38b53e5b 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ class WithVR extends React.Component /> ... - + ) diff --git a/package.json b/package.json index bc642935..e08168d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-babylonjs", - "version": "2.0.2", + "version": "2.0.3", "description": "React for BabylonJS", "homepage": "https://brianzinn.github.io/react-babylonjs/", "keywords": [ diff --git a/src/CreatedInstance.ts b/src/CreatedInstance.ts index b8124521..bc17b8ad 100644 --- a/src/CreatedInstance.ts +++ b/src/CreatedInstance.ts @@ -47,6 +47,10 @@ export type CustomProps = { * List of mesh names to search for, which will be added as shadow casters. */ shadowCasters?: string[] + /** + * List of mesh names to exclude from casting shadows (all other meshes by name will cast shadows) + */ + shadowCastersExcluding?: string[] /** * For attaching the same material multiple meshes (by mesh name) */ diff --git a/src/customComponents/EnvironmentHelperLifecycleListener.ts b/src/customComponents/EnvironmentHelperLifecycleListener.ts index 679681d2..12639dff 100644 --- a/src/customComponents/EnvironmentHelperLifecycleListener.ts +++ b/src/customComponents/EnvironmentHelperLifecycleListener.ts @@ -21,6 +21,7 @@ export default class EnvironmentHelperLifecycleListener implements LifecycleList return; } + // for TypeScript people use <... setMainColor={[mainColor]} /> if (this.props.mainColor) { instance.hostInstance.setMainColor(this.props.mainColor) } diff --git a/src/customHosts/index.ts b/src/customHosts/index.ts index 6cdf2464..1b311374 100644 --- a/src/customHosts/index.ts +++ b/src/customHosts/index.ts @@ -3,4 +3,3 @@ export { default as HostWithEventsFiber } from "./hostWithEventsFiber" export const HostWithEvents: string = "HostWithEvents" -export const Model: string = "Model" diff --git a/src/model/index.ts b/src/model/index.ts index c4ee2fb3..de24864c 100644 --- a/src/model/index.ts +++ b/src/model/index.ts @@ -1,2 +1,2 @@ export { LoaderStatus, LoadedModel } from "./Model" -export { FiberModel, ModelPropsHandler } from "./ModelProps" +export { ModelProps, FiberModel, ModelPropsHandler } from "./ModelProps" diff --git a/src/react-babylonjs.ts b/src/react-babylonjs.ts index c7a36d9f..65de0723 100644 --- a/src/react-babylonjs.ts +++ b/src/react-babylonjs.ts @@ -6,4 +6,4 @@ export * from "./customComponents" // TODO: Except for Skybox - these should not export { default as Engine, withBabylonJS, BabylonJSContext, useBabylonEngine, useBabylonCanvas } from "./Engine" export { default as Scene, withScene, WithSceneContext, SceneContext, SceneEventArgs, useBabylonScene } from "./Scene" -export { HostWithEvents, Model } from "./customHosts" +export { HostWithEvents } from "./customHosts" diff --git a/stories/babylonjs/2-withVR/withVr.stories.js b/stories/babylonjs/2-withVR/withVr.stories.js index ac5b83da..c5d84f6e 100644 --- a/stories/babylonjs/2-withVR/withVr.stories.js +++ b/stories/babylonjs/2-withVR/withVr.stories.js @@ -57,7 +57,7 @@ export class WithVR extends Component { radius={2} minZ={0.001} wheelPrecision={50} /> - + @@ -79,7 +79,7 @@ export class WithVR extends Component { - + ) diff --git a/stories/babylonjs/ScaledModelWithProgress.js b/stories/babylonjs/ScaledModelWithProgress.js index d74fc892..97c7f290 100644 --- a/stories/babylonjs/ScaledModelWithProgress.js +++ b/stories/babylonjs/ScaledModelWithProgress.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' -import { withScene, Model } from '../../dist/react-babylonjs.es5' +import { withScene } from '../../dist/react-babylonjs.es5' import { Vector3, Matrix, Color3 } from '@babylonjs/core/Maths/math' // try with later versions of RHL to get hooks working here: