export default Object3DFacade; declare class Object3DFacade { constructor(parent: any, threeObject: any); threeObject: any; _parentObject3DFacade: any; /** * Lifecycle method, called at constructor time, that creates and returns a Three.js `Object3D` * instance which will become the `threeObject` for this facade. This is a more ergonomic * alternative than overriding the constructor to pass the `threeObject` as a second argument * to the super() call. By default it creates a plain Object3D marked as non-renderable so it * is not added to the Three.js tree. * @return {Object3D} * @protected */ protected initThreeObject(): Object3D; afterUpdate(): void; _worldMatrixVersionAfterLastUpdate: number; /** * Update the underlying threeObject's `matrix` and `matrixWorld` to the current state if necessary. * This bypasses the `updateMatrix` and `updateMatrixWorld` methods of the threejs objects with a more * efficient approach that doesn't require traversing the entire tree prior to every render. This is possible * since we control the update lifecycle; as long as this is called from the `afterUpdate` lifecycle * method or later, it can be safely assumed that the world matrices of all ancestors have already been * similarly updated so the result should always be accurate. */ updateMatrices(): void; _matrixChanged: boolean; /** * If the `threeObject.matrixWorld` is modified manually instead of via the individual transformation * properties, you can call this to tell the facade its caches need to be recalculated. */ markWorldMatrixDirty(): void; _worldMatrixVersion: number; _boundsChanged: boolean; _checkBoundsChange(): void; _lastGeometrySphereVersion: any; /** * Get this object's current position in world space * @param {Vector3} [vec3] - optional Vector3 object to populate with the position; * if not passed in a new one will be created. * @returns {Vector3} */ getWorldPosition(vec3?: Vector3): Vector3; /** * Get the current position vector of the world's camera. * @param {Vector3} [vec3] - optional Vector3 object to populate with the position; * if not passed in a new one will be created. * @returns {Vector3} */ getCameraPosition(vec3?: Vector3): Vector3; /** * Get the facade object for the world's camera. Can be used to get to low-level info * about the camera such as its various matrices, but be careful not to make modifications * to the camera as that can lead to things getting out of sync. * @returns {Camera3DFacade} */ getCameraFacade(): Camera3DFacade; /** * Calculate the distance in world units between this object's origin and the camera. * @returns {Number} */ getCameraDistance(): number; /** * Get the current projected user space position for this object, or for a specific position * in its object space. * @returns {Vector3} x and y are in screen pixels, z is worldspace distance from camera. The * z may be negative, which means it is out of view behind the camera. */ getProjectedPosition(x: any, y: any, z: any): Vector3; /** * Get the facade object for the world's scene. * @returns {Scene3DFacade} */ getSceneFacade(): Scene3DFacade; /** * Return a {@link Sphere} encompassing the bounds of this object in worldspace, or `null` if * it has no physical bounds. This is used for optimized raycasting. * * The default implementation attempts to be as efficient as possible, only updating the sphere * when necessary, and assumes the threeObject has a geometry that accurately describes its bounds. * Override this method to provide custom bounds calculation logic, for example when additional meshes * need to be checked or a vertex shader manipulates the geometry; you'll probably also need to override * {@link #raycast} to match. * * TODO: this needs to be easier to override without having to reimplement large chunks of logic */ getBoundingSphere(): Sphere; _boundingSphere: Sphere; /** * Ensure the object's geometry, if any, has an up-to-date bounding Sphere, and return that Sphere. * The returned Sphere will be assigned a unique `version` property when it is modified, which can * be used elsewhere for tracking changes. */ _getGeometryBoundingSphere(): any; /** * Extension point for subclasses that don't use their threeObject's geometry, e.g. Instanceable */ getGeometry(): any; /** * Determine if this facade's threeObject intersects a Raycaster. Override this method to provide * custom raycasting logic, for example when additional meshes need to be checked or a vertex shader * manipulates the geometry; you'll probably also need to override {@link #getBoundingSphere} to match. * * The return value can be: * - An array of hit objects for this facade, matching the format returned by `Raycaster.intersectObject` * - `null`, if this facade has no hits */ raycast(raycaster: any): any[]; /** * Custom optimized raycast that, unlike Raycaster.intersectObject(), avoids creating a * new array unless there are actually hits. It also supports the custom `raycastSide` * override property, hit on sides other than the material's configured `side`. */ _raycastObject(obj: any, raycaster: any): any[]; _addToThreeObjectTree(): void; _queueRemoveChildObject3D(threeObjectId: any): void; _removeChildIds: any; _flushQueuedChildRemovals(): void; destructor(): void; /** * @property {null|number} raycastSide * Hook to force a different `side` than that of the material for mesh raycasting. * Should be set to `FrontSide`|`BackSide`|`DoubleSide`, or `null` to use the * material's side. */ raycastSide: any; set scale(value: any); get scale(): any; readonly isObject3DFacade: boolean; } import { Object3D } from 'three'; import { Vector3 } from 'three'; import { Sphere } from 'three';