| @@ -18,6 +18,9 @@ We welcome contributions to Threepipe. Please read the following guidelines to s | |||
| For website(vitepress) development - | |||
| - Run `npm run website:dev` to start the website server. | |||
| Some examples requires env variables. | |||
| - Run `cp examples/sample.env examples/.env` and set the required tokens/keys in the `examples/.env` file. | |||
| ## Testing | |||
| TBD | |||
| @@ -1,12 +1,12 @@ | |||
| { | |||
| "name": "@threepipe/plugin-tweakpane", | |||
| "version": "0.5.4", | |||
| "version": "0.5.5", | |||
| "lockfileVersion": 3, | |||
| "requires": true, | |||
| "packages": { | |||
| "": { | |||
| "name": "@threepipe/plugin-tweakpane", | |||
| "version": "0.5.4", | |||
| "version": "0.5.5", | |||
| "license": "Apache-2.0", | |||
| "dependencies": { | |||
| "threepipe": "file:./../../src/" | |||
| @@ -1,7 +1,7 @@ | |||
| { | |||
| "name": "@threepipe/plugin-tweakpane", | |||
| "description": "Tweakpane UI Plugin for ThreePipe", | |||
| "version": "0.5.4", | |||
| "version": "0.5.5", | |||
| "devDependencies": { | |||
| "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz", | |||
| "uiconfig-tweakpane": "^0.0.10", | |||
| @@ -351,7 +351,7 @@ export const tpImageInputGenerator: (viewer: ThreeViewer) => (parent: any, confi | |||
| params = params ?? {} | |||
| params.extensions = ['.jpg', '.png', '.svg', '.hdr', '.ktx2', | |||
| '.exr', /* '.mp4', '.ogg', '.mov',*/ '.jpeg', | |||
| '.bmp', '.gif', '.webp', '.cube'] | |||
| '.bmp', '.gif', '.webp', '.cube', '.ktx2', '.avif', '.ico', '.tiff'] // todo update blueprint editor with this list | |||
| if (typeof params.imageFit === 'undefined') params.imageFit = 'contain' | |||
| if (typeof params.clickCallback === 'undefined') params.clickCallback = (ev: MouseEvent, inp: HTMLInputElement) => { | |||
| const target = ev?.target as HTMLElement | |||
| @@ -291,7 +291,7 @@ export class AssetManager extends EventDispatcher<AssetManagerEventMap> { | |||
| const importers: Importer[] = [ | |||
| new Importer(SVGTextureLoader, ['svg', 'data:image/svg'], ['image/svg+xml'], false), // todo: use ImageBitmapLoader if supported (better performance) | |||
| new Importer(TextureLoader, ['webp', 'png', 'jpeg', 'jpg', 'ico', 'data:image', 'avif'], [ | |||
| new Importer(TextureLoader, ['webp', 'png', 'jpeg', 'jpg', 'ico', 'data:image', 'avif', 'bmp', 'gif', 'tiff'], [ | |||
| 'image/webp', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'image/x-icon', 'image/avif', | |||
| ], false), // todo: use ImageBitmapLoader if supported (better performance) | |||
| @@ -32,7 +32,7 @@ declare module 'three'{ | |||
| value?: IObject3D /* | Material*/ // todo is this required? | |||
| source?: string // who is triggering the event. so that recursive events can be prevented | |||
| } | |||
| } /* & IObjectSetDirtyOptions*/ | |||
| } | |||
| } | |||
| // [key: keyof Object3DEventMap]: Object3DEventMap[key] & { | |||
| @@ -139,20 +139,40 @@ export interface ISetDirtyCommonOptions { | |||
| } | |||
| export interface IObjectSetDirtyOptions extends ISetDirtyCommonOptions{ | |||
| bubbleToParent?: boolean // bubble event to parent root | |||
| change?: string | |||
| refreshScene?: boolean // update scene after setting dirty | |||
| /** | |||
| * Bubble event to parent root(scene). | |||
| */ | |||
| bubbleToParent?: boolean | |||
| /** | |||
| * Change identifier that triggered the setDirty call. | |||
| */ | |||
| change?: string | keyof IObject3D | |||
| /** | |||
| * Update scene(bounds, shadows, plugins, etc) after setting dirty. | |||
| */ | |||
| refreshScene?: boolean | |||
| geometryChanged?: boolean // whether to refresh stuff like ground. | |||
| /** | |||
| * Indicate whether the geometry has been changed to properly refresh plugins like ground, shadows. | |||
| */ | |||
| geometryChanged?: boolean | |||
| /** | |||
| * update scene after setting dirty | |||
| * | |||
| * @deprecated use {@link refreshScene} instead | |||
| */ | |||
| sceneUpdate?: boolean // update scene after setting dirty | |||
| sceneUpdate?: boolean | |||
| source?: string // who is triggering the event. so that recursive events can be prevented | |||
| /** | |||
| * Source identifier of who is triggering the event. so that recursive events can be prevented | |||
| */ | |||
| source?: string | |||
| // from onChange3 etc. | |||
| /** | |||
| * Key to identify the change. This is used to identify the change in the event. Can be used interchangeably with {@link change}. | |||
| * Set from `onChange3` etc. | |||
| */ | |||
| key?: string | |||
| /** | |||
| @@ -275,8 +295,11 @@ export interface IObject3D<TE extends IObject3DEventMap = IObject3DEventMap> ext | |||
| isLight?: boolean | |||
| isCamera?: boolean | |||
| isMesh?: boolean | |||
| isMeshLine?: boolean | |||
| isLine?: boolean | |||
| isLine2?: boolean | |||
| isLineSegments?: boolean | |||
| isLineSegments2?: boolean | |||
| // isGroup?: boolean | |||
| isScene?: boolean | |||
| // isHelper?: boolean | |||
| @@ -401,6 +424,11 @@ export interface IObject3D<TE extends IObject3DEventMap = IObject3DEventMap> ext | |||
| */ | |||
| computeBoundingSphere?(): void; | |||
| /** | |||
| * For LineSegments, Line2 etc | |||
| */ | |||
| computeLineDistances?(): void | |||
| /** | |||
| * Set to `false` to disable propagation of any events from its children. | |||
| */ | |||
| @@ -217,7 +217,7 @@ export class BaseGroundPlugin<TE extends AViewerPluginEventMap = AViewerPluginEv | |||
| // this._mesh.lookAt(new Vector3().fromArray(this._options.up)) | |||
| this._mesh.setRotationFromEuler(new Euler(-Math.PI / 2., 0, this._mesh.rotation.z)) | |||
| this._mesh.matrixWorldNeedsUpdate = true | |||
| this._mesh.setDirty() | |||
| this._mesh.setDirty({refreshScene: false, source: BaseGroundPlugin.PluginType}) | |||
| // this._viewer.scene.setDirty() | |||
| } | |||
| this._transformNeedRefresh = false | |||
| @@ -327,4 +327,4 @@ declare module '../../core/IScene' { | |||
| interface ISceneSetDirtyOptions { | |||
| updateGround?: boolean | |||
| } | |||
| } | |||
| } | |||