@vrspace/babylonjs
Version:
vrspace.org babylonjs client
41 lines (40 loc) • 1.74 kB
TypeScript
/**
* Helper class, provides mesh visibility methods.
*/
export class VisibilityHelper {
constructor(world?: World);
world: World;
scene: any;
dispose(): void;
/**
* Returns true if target mesh is visible, performs least expensive checks first, then more expensive ones.
* It's supposed to test multiple points of the mesh, tests only one for the time being.
* Calls this.isClosestMesh to determine visibility.
* @param target babylonjs mesh to test for visibility
* @param {number} [confidence=1] minimum number of points required to be visible
* @param {Vector3} [offset=new BABYLON.Vector3(0,0,0)] offset to add to mesh position before testing
*/
isVisible(target: any, confidence?: number, offset?: Vector3): boolean;
/**
* Casts a ray from the camera to the point, and returns true if the mesh is hit.
* Mesh may be root node of the scene, or any mesh in the scene.
*/
isClosestMesh(camera: any, mesh: any, point: any): boolean;
/**
* Traverses VRObject scene, and returns visible avatars.
*/
getVisibleAvatars(confidence?: number): any[];
/**
* Traverses all VRObjects in the scene, and returns avatars out of active camera frustrum
*/
getAvatarsOutOfView(): any;
/**
* Traverses scene root nodes, and returns visible objects.
*/
getVisibleObjects(confidence?: number): any[];
/** Traverses give babyolonjs node array, and returns visible nodes */
getVisibleOf(nodeArray: any, confidence?: number): any[];
/** Traverses given User array, and returns array of visible User objects */
getVisibleUsers(userArray: any, confidence?: number): any[];
}
import { World } from "./world.js";