@pmndrs/vanilla
Advanced tools
Comparing version 1.10.1 to 1.11.0
{ | ||
"name": "@pmndrs/vanilla", | ||
"version": "1.10.1", | ||
"version": "1.11.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -422,3 +422,3 @@ ![logo](logo.jpg) | ||
[![storybook](https://img.shields.io/badge/-storybook-%23ff69b4)](https://pmndrs.github.io/drei-vanilla/?path=/story/gizmos-outlines--outlines-story) | ||
[![storybook](https://img.shields.io/badge/-storybook-%23ff69b4)](https://pmndrs.github.io/drei-vanilla/?path=/story/abstractions-outlines--outlines-story) | ||
@@ -457,3 +457,3 @@ [drei counterpart](https://github.com/pmndrs/drei#outlines) | ||
Grid function returns the following | ||
Outlines function returns the following | ||
@@ -467,1 +467,56 @@ ```jsx | ||
``` | ||
#### Billboard | ||
[![storybook](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.pmnd.rs/?path=/story/abstractions-billboard--billboard-story) | ||
[drei counterpart](https://github.com/pmndrs/drei#billboard) | ||
Adds a `THREE.Group` that always faces the camera. | ||
```tsx | ||
export type BillboardProps = { | ||
/** | ||
* @default true | ||
*/ | ||
follow?: boolean | ||
/** | ||
* @default false | ||
*/ | ||
lockX?: boolean | ||
/** | ||
* @default false | ||
*/ | ||
lockY?: boolean | ||
/** | ||
* @default false | ||
*/ | ||
lockZ?: boolean | ||
} | ||
``` | ||
Usage | ||
```js | ||
const billboard = Billboard() | ||
const mesh = new THREE.Mesh(geometry, material) | ||
billboard.group.add(mesh) | ||
scene.add(billboard) | ||
// call in animate loop | ||
billboard.update(camera) | ||
``` | ||
Billboard function returns the following | ||
```js | ||
export type BillboardType = { | ||
group: THREE.Group | ||
/** | ||
* Should called every frame to update the billboard | ||
*/ | ||
update: (camera: THREE.Camera) => void | ||
updateProps: (newProps: Partial<BillboardProps>) => void | ||
} | ||
``` |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
211206
54
2542
520
16