Skip to content

Commit

Permalink
generate basic documentation for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
brianzinn committed Jan 14, 2021
1 parent eba7b00 commit 773df92
Show file tree
Hide file tree
Showing 27 changed files with 2,553 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ This project uses code generation, which allows fast reconciliation and excellen

* [hookex](https://github.com/hookex) has made the largest contribution :) Proper texture handling [demo](https://brianzinn.github.io/react-babylonjs/?path=/story/textures--image-texture), Node parenting, [demo](https://brianzinn.github.io/react-babylonjs/?path=/story/babylon-basic--transform-node) Full Screen GUI [demo](https://brianzinn.github.io/react-babylonjs/?path=/story/gui--gui-full-screen), Effect Layers [glow demo](https://brianzinn.github.io/react-babylonjs/?path=/story/special-fx--glow-layer), behaviors [demo](https://brianzinn.github.io/react-babylonjs/?path=/story/behaviors--pointer-drag-behavior), useHover & useClick hooks [demo](https://brianzinn.github.io/react-babylonjs/?path=/story/hooks--use-hover-event) and react-spring integration [demo](https://brianzinn.github.io/react-babylonjs/?path=/story/integrations--react-spring). Author of `react-babylon-spring` - https://github.com/hookex/react-babylon-spring.

* [dennemark](https://github.com/dennemark) added Cascaded Shadow Generator
* [dennemark](https://github.com/dennemark) added Cascaded Shadow Generator and story for NodeMaterial usage with hooks.
* Thanks also to all the people who have contributed with issues and questions.

Made with ♥ by Brian Zinn
8 changes: 8 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Hooks API
The hooks are useful to get access to scene or engine object or get access to render loop or hover/click on meshes, etc. The hooks for SceneLoader and AssetManager require that the component using them be enclosed in `Suspense`.

*(This is just generated for now and needs cleanup + examples)*

[Hooks API documentation](hooks/modules.md)

# Code generated API
Due to using code generation from the Babylon typings, all of these declarative elements will adhere to the same API as you find on [Babylon.js documentation site](https://doc.babylonjs.com/):

If you want to declaratively use something not listed here create an issue :) Some extensions have been added to allow for declarative scene creation (ie: Shadows, Textures, etc.)
Expand Down
185 changes: 185 additions & 0 deletions docs/hooks/classes/index.loadedmodel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
[react-babylonjs](../README.md) / [Exports](../modules.md) / [index](../modules/index.md) / LoadedModel

# Class: LoadedModel

[index](../modules/index.md).LoadedModel

## Hierarchy

* **LoadedModel**

## Implements

* [*ILoadedModel*](../interfaces/loaders/loadedmodel.iloadedmodel.md)

## Table of contents

### Constructors

- [constructor](index.loadedmodel.md#constructor)

### Properties

- [\_scaledToDimension](index.loadedmodel.md#_scaledtodimension)
- [animationGroups](index.loadedmodel.md#animationgroups)
- [errorMessage](index.loadedmodel.md#errormessage)
- [loaderName](index.loadedmodel.md#loadername)
- [meshes](index.loadedmodel.md#meshes)
- [particleSystems](index.loadedmodel.md#particlesystems)
- [rootMesh](index.loadedmodel.md#rootmesh)
- [skeletons](index.loadedmodel.md#skeletons)
- [status](index.loadedmodel.md#status)

### Accessors

- [boundingInfo](index.loadedmodel.md#boundinginfo)
- [scaledToDimension](index.loadedmodel.md#scaledtodimension)

### Methods

- [dispose](index.loadedmodel.md#dispose)
- [scaleTo](index.loadedmodel.md#scaleto)

## Constructors

### constructor

\+ **new LoadedModel**(): [*LoadedModel*](loaders/loadedmodel.loadedmodel.md)

**Returns:** [*LoadedModel*](loaders/loadedmodel.loadedmodel.md)

## Properties

### \_scaledToDimension

`Private` `Optional` **\_scaledToDimension**: *undefined* \| *number*

Defined in: [loaders/loadedModel.ts:44](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L44)

___

### animationGroups

`Optional` **animationGroups**: *undefined* \| *AnimationGroup*[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[animationGroups](../interfaces/loaders/loadedmodel.iloadedmodel.md#animationgroups)

Defined in: [loaders/loadedModel.ts:43](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L43)

___

### errorMessage

`Optional` **errorMessage**: *undefined* \| *string*

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[errorMessage](../interfaces/loaders/loadedmodel.iloadedmodel.md#errormessage)

Defined in: [loaders/loadedModel.ts:38](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L38)

___

### loaderName

`Optional` **loaderName**: *undefined* \| *string*

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[loaderName](../interfaces/loaders/loadedmodel.iloadedmodel.md#loadername)

Defined in: [loaders/loadedModel.ts:39](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L39)

___

### meshes

`Optional` **meshes**: *undefined* \| *AbstractMesh*[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[meshes](../interfaces/loaders/loadedmodel.iloadedmodel.md#meshes)

Defined in: [loaders/loadedModel.ts:40](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L40)

___

### particleSystems

`Optional` **particleSystems**: *undefined* \| IParticleSystem[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[particleSystems](../interfaces/loaders/loadedmodel.iloadedmodel.md#particlesystems)

Defined in: [loaders/loadedModel.ts:41](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L41)

___

### rootMesh

`Optional` **rootMesh**: *undefined* \| *AbstractMesh*

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[rootMesh](../interfaces/loaders/loadedmodel.iloadedmodel.md#rootmesh)

Defined in: [loaders/loadedModel.ts:37](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L37)

___

### skeletons

`Optional` **skeletons**: *undefined* \| *Skeleton*[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[skeletons](../interfaces/loaders/loadedmodel.iloadedmodel.md#skeletons)

Defined in: [loaders/loadedModel.ts:42](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L42)

___

### status

**status**: [*LoaderStatus*](../enums/loaders/loadedmodel.loaderstatus.md)

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[status](../interfaces/loaders/loadedmodel.iloadedmodel.md#status)

Defined in: [loaders/loadedModel.ts:36](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L36)

## Accessors

### boundingInfo

**boundingInfo**(): *Nullable*<*BoundingInfo*\>

**Returns:** *Nullable*<*BoundingInfo*\>

Defined in: [loaders/loadedModel.ts:50](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L50)

___

### scaledToDimension

**scaledToDimension**(): *undefined* \| *number*

**Returns:** *undefined* \| *number*

Defined in: [loaders/loadedModel.ts:46](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L46)

## Methods

### dispose

**dispose**(): *void*

Clean up all resources.

**Returns:** *void*

Defined in: [loaders/loadedModel.ts:99](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L99)

___

### scaleTo

**scaleTo**(`maxDimension`: *number*): *void*

#### Parameters:

Name | Type |
------ | ------ |
`maxDimension` | *number* |

**Returns:** *void*

Defined in: [loaders/loadedModel.ts:81](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L81)
185 changes: 185 additions & 0 deletions docs/hooks/classes/loaders.loadedmodel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
[react-babylonjs](../README.md) / [Exports](../modules.md) / [loaders](../modules/loaders.md) / LoadedModel

# Class: LoadedModel

[loaders](../modules/loaders.md).LoadedModel

## Hierarchy

* **LoadedModel**

## Implements

* [*ILoadedModel*](../interfaces/loaders/loadedmodel.iloadedmodel.md)

## Table of contents

### Constructors

- [constructor](loaders.loadedmodel.md#constructor)

### Properties

- [\_scaledToDimension](loaders.loadedmodel.md#_scaledtodimension)
- [animationGroups](loaders.loadedmodel.md#animationgroups)
- [errorMessage](loaders.loadedmodel.md#errormessage)
- [loaderName](loaders.loadedmodel.md#loadername)
- [meshes](loaders.loadedmodel.md#meshes)
- [particleSystems](loaders.loadedmodel.md#particlesystems)
- [rootMesh](loaders.loadedmodel.md#rootmesh)
- [skeletons](loaders.loadedmodel.md#skeletons)
- [status](loaders.loadedmodel.md#status)

### Accessors

- [boundingInfo](loaders.loadedmodel.md#boundinginfo)
- [scaledToDimension](loaders.loadedmodel.md#scaledtodimension)

### Methods

- [dispose](loaders.loadedmodel.md#dispose)
- [scaleTo](loaders.loadedmodel.md#scaleto)

## Constructors

### constructor

\+ **new LoadedModel**(): [*LoadedModel*](loaders/loadedmodel.loadedmodel.md)

**Returns:** [*LoadedModel*](loaders/loadedmodel.loadedmodel.md)

## Properties

### \_scaledToDimension

`Private` `Optional` **\_scaledToDimension**: *undefined* \| *number*

Defined in: [loaders/loadedModel.ts:44](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L44)

___

### animationGroups

`Optional` **animationGroups**: *undefined* \| *AnimationGroup*[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[animationGroups](../interfaces/loaders/loadedmodel.iloadedmodel.md#animationgroups)

Defined in: [loaders/loadedModel.ts:43](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L43)

___

### errorMessage

`Optional` **errorMessage**: *undefined* \| *string*

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[errorMessage](../interfaces/loaders/loadedmodel.iloadedmodel.md#errormessage)

Defined in: [loaders/loadedModel.ts:38](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L38)

___

### loaderName

`Optional` **loaderName**: *undefined* \| *string*

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[loaderName](../interfaces/loaders/loadedmodel.iloadedmodel.md#loadername)

Defined in: [loaders/loadedModel.ts:39](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L39)

___

### meshes

`Optional` **meshes**: *undefined* \| *AbstractMesh*[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[meshes](../interfaces/loaders/loadedmodel.iloadedmodel.md#meshes)

Defined in: [loaders/loadedModel.ts:40](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L40)

___

### particleSystems

`Optional` **particleSystems**: *undefined* \| IParticleSystem[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[particleSystems](../interfaces/loaders/loadedmodel.iloadedmodel.md#particlesystems)

Defined in: [loaders/loadedModel.ts:41](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L41)

___

### rootMesh

`Optional` **rootMesh**: *undefined* \| *AbstractMesh*

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[rootMesh](../interfaces/loaders/loadedmodel.iloadedmodel.md#rootmesh)

Defined in: [loaders/loadedModel.ts:37](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L37)

___

### skeletons

`Optional` **skeletons**: *undefined* \| *Skeleton*[]

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[skeletons](../interfaces/loaders/loadedmodel.iloadedmodel.md#skeletons)

Defined in: [loaders/loadedModel.ts:42](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L42)

___

### status

**status**: [*LoaderStatus*](../enums/loaders/loadedmodel.loaderstatus.md)

Implementation of: [ILoadedModel](../interfaces/loaders/loadedmodel.iloadedmodel.md).[status](../interfaces/loaders/loadedmodel.iloadedmodel.md#status)

Defined in: [loaders/loadedModel.ts:36](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L36)

## Accessors

### boundingInfo

**boundingInfo**(): *Nullable*<*BoundingInfo*\>

**Returns:** *Nullable*<*BoundingInfo*\>

Defined in: [loaders/loadedModel.ts:50](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L50)

___

### scaledToDimension

**scaledToDimension**(): *undefined* \| *number*

**Returns:** *undefined* \| *number*

Defined in: [loaders/loadedModel.ts:46](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L46)

## Methods

### dispose

**dispose**(): *void*

Clean up all resources.

**Returns:** *void*

Defined in: [loaders/loadedModel.ts:99](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L99)

___

### scaleTo

**scaleTo**(`maxDimension`: *number*): *void*

#### Parameters:

Name | Type |
------ | ------ |
`maxDimension` | *number* |

**Returns:** *void*

Defined in: [loaders/loadedModel.ts:81](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L81)
Loading

0 comments on commit 773df92

Please sign in to comment.