@awayjs/view
Version:
View for AwayJS
112 lines • 5.29 kB
TypeScript
import { Vector3D, Matrix3D, Box, Sphere, AbstractionBase, AssetEvent, Plane3D } from '@awayjs/core';
import { IPartitionTraverser } from '../partition/IPartitionTraverser';
import { INode } from '../partition/INode';
import { BoundsPickerPool } from '../PickGroup';
import { BoundingVolumeType } from '../bounds/BoundingVolumeType';
import { BoundingVolumeBase } from '../bounds/BoundingVolumeBase';
import { IBoundsPicker } from './IBoundsPicker';
import { ContainerNode } from '../partition/ContainerNode';
/**
* Picks a 3d object from a view or scene by 3D raycast calculations.
* Performs an initial coarse boundary calculation to return a subset
* of entities whose bounding volumes intersect with the specified ray,
* then triggers an optional picking collider on individual renderable
* objects to further determine the precise values of the picking ray collision.
*
* @class away.pick.RaycastPicker
*/
export declare class BoundsPicker extends AbstractionBase implements IPartitionTraverser, IBoundsPicker {
private static tmpMatrix;
private static tmpPoint;
private static tmpBox;
static MINIMAL_SCALE: number;
private _boundingVolumePools;
private _boundingVolumes;
private _pickGroup;
private _boundsPickers;
/**
*
* @returns {ContainerNode}
*/
get node(): ContainerNode;
/**
* Indicates the width of the display object, in pixels. The width is
* calculated based on the bounds of the content of the display object. When
* you set the <code>width</code> property, the <code>scaleX</code> property
* is adjusted accordingly, as shown in the following code:
*
* <p>Except for TextField and Video objects, a display object with no
* content(such as an empty sprite) has a width of 0, even if you try to set
* <code>width</code> to a different value.</p>
*/
get width(): number;
set width(val: number);
/**
* Indicates the height of the display object, in pixels. The height is
* calculated based on the bounds of the content of the display object. When
* you set the <code>height</code> property, the <code>scaleY</code> property
* is adjusted accordingly, as shown in the following code:
*
* <p>Except for TextField and Video objects, a display object with no
* content (such as an empty sprite) has a height of 0, even if you try to
* set <code>height</code> to a different value.</p>
*/
get height(): number;
set height(val: number);
/**
* Indicates the depth of the display object, in pixels. The depth is
* calculated based on the bounds of the content of the display object. When
* you set the <code>depth</code> property, the <code>scaleZ</code> property
* is adjusted accordingly, as shown in the following code:
*
* <p>Except for TextField and Video objects, a display object with no
* content (such as an empty sprite) has a depth of 0, even if you try to
* set <code>depth</code> to a different value.</p>
*/
get depth(): number;
set depth(val: number);
init(node: ContainerNode, pool: BoundsPickerPool): void;
onInvalidate(event: AssetEvent): void;
traverse(): void;
getTraverser(node: ContainerNode): IPartitionTraverser;
/**
* Returns true if the current node is at least partly in the frustum.
* If so, the partition node knows to pass on the traverser to its children.
*
* @param node The Partition3DNode object to frustum-test.
*/
enterNode(node: INode): boolean;
getBoundingVolume(target?: INode, type?: BoundingVolumeType): BoundingVolumeBase;
getBoxBounds(targetCoordinateSpace?: INode, strokeFlag?: boolean, fastFlag?: boolean): Box;
getSphereBounds(targetCoordinateSpace?: INode, strokeFlag?: boolean, fastFlag?: boolean): Sphere;
addBoundingVolume(boundingVolume: BoundingVolumeBase): void;
removeBoundingVolume(boundingVolume: BoundingVolumeBase): void;
hitTestPoint(x: number, y: number, shapeFlag?: boolean): boolean;
_hitTestPointInternal(node: INode, x: number, y: number, shapeFlag?: boolean, maskFlag?: boolean): boolean;
/**
* Evaluates the bounding box of the display object to see if it overlaps or
* intersects with the bounding box of the <code>obj</code> display object.
*
* @param obj The display object to test against.
* @return <code>true</code> if the bounding boxes of the display objects
* intersect; <code>false</code> if not.
*/
hitTestObject(obj: BoundsPicker): boolean;
_getBoxBoundsInternal(matrix3D?: Matrix3D, strokeFlag?: boolean, fastFlag?: boolean, cache?: Box, target?: Box): Box;
_getSphereBoundsInternal(center?: Vector3D, matrix3D?: Matrix3D, strokeFlag?: boolean, fastFlag?: boolean, cache?: Sphere, target?: Sphere): Sphere;
/**
*
* @param planes
* @param numPlanes
* @returns {boolean}
*/
isInFrustum(planes: Array<Plane3D>, numPlanes: number): boolean;
_isInFrustumInternal(node: INode, planes: Array<Plane3D>, numPlanes: number): boolean;
onClear(event: AssetEvent): void;
/**
*
* @param entity
*/
applyEntity(node: ContainerNode): void;
}
//# sourceMappingURL=BoundsPicker.d.ts.map