API / BoundingBoxData
Class: abstract
BoundingBoxData
Defined in: model/BoundingBoxData.ts:36
The base class of bounding box data.
Extends
Extended by
Constructors
Constructor
new BoundingBoxData(): BoundingBoxData;
Returns
BoundingBoxData
Inherited from
Properties
hashCode
readonly hashCode: number;
Defined in: core/BaseObject.ts:156
A unique identification number assigned to the object.
Inherited from
type
type: BoundingBoxType;
Defined in: model/BoundingBoxData.ts:44
The bounding box type.
Methods
containsPoint()
abstract containsPoint(pX: number, pY: number): boolean;
Defined in: model/BoundingBoxData.ts:70
Check whether the bounding box contains a specific point. (Local coordinate system)
Parameters
Parameter | Type |
---|---|
pX | number |
pY | number |
Returns
boolean
intersectsSegment()
abstract intersectsSegment(
xA: number,
yA: number,
xB: number,
yB: number,
intersectionPointA: object,
intersectionPointB: object,
normalRadians: object): number;
Defined in: model/BoundingBoxData.ts:78
Check whether the bounding box intersects a specific segment. (Local coordinate system)
Parameters
Parameter | Type |
---|---|
xA | number |
yA | number |
xB | number |
yB | number |
intersectionPointA | { x : number ; y : number ; } |
intersectionPointA.x | number |
intersectionPointA.y | number |
intersectionPointB | { x : number ; y : number ; } |
intersectionPointB.x | number |
intersectionPointB.y | number |
normalRadians | { x : number ; y : number ; } |
normalRadians.x | number |
normalRadians.y | number |
Returns
number
returnToPool()
returnToPool(): void;
Defined in: core/BaseObject.ts:167
Clear the object and return it back to object pool。
Returns
void
Inherited from
borrowObject()
static borrowObject<T>(objectConstructor: () => T): T;
Defined in: core/BaseObject.ts:136
Get an instance of the specify class from object pool.
Type Parameters
Type Parameter |
---|
T extends BaseObject |
Parameters
Parameter | Type | Description |
---|---|---|
objectConstructor | () => T | The specify class. |
Returns
T
Inherited from
clearPool()
static clearPool(objectConstructor: typeof BaseObject): void;
Defined in: core/BaseObject.ts:111
Clear the cached instances of a specify object pool.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
objectConstructor | typeof BaseObject | null | Specify class. (Clear all cached instances if not set) |
Returns
void
Inherited from
setMaxCount()
static setMaxCount(objectConstructor: typeof BaseObject, maxCount: number): void;
Defined in: core/BaseObject.ts:72
Set the maximum cache count of the specify object pool.
Parameters
Parameter | Type | Description |
---|---|---|
objectConstructor | typeof BaseObject | The specify class. (Set all object pools max cache count if not set) |
maxCount | number | Max count. |
Returns
void
Inherited from
toString()
static toString(): string;
Defined in: core/BaseObject.ts:56
Returns
string