Skip to content

API / BoundingBoxData

类: abstract BoundingBoxData

定义于: model/BoundingBoxData.ts:36

边界框数据基类。

继承

继承于

构造函数

构造函数

ts
new BoundingBoxData(): BoundingBoxData;

返回

BoundingBoxData

继承自

BaseObject.constructor

属性

hashCode

ts
readonly hashCode: number;

定义于: core/BaseObject.ts:156

分配给此实例的唯一标识号。

继承自

BaseObject.hashCode


type

ts
type: BoundingBoxType;

定义于: model/BoundingBoxData.ts:44

边界框类型。

方法

containsPoint()

ts
abstract containsPoint(pX: number, pY: number): boolean;

定义于: model/BoundingBoxData.ts:70

检查边界框是否包含特定点。(本地坐标系)

参数

参数类型
pXnumber
pYnumber

返回

boolean


intersectsSegment()

ts
abstract intersectsSegment(
   xA: number, 
   yA: number, 
   xB: number, 
   yB: number, 
   intersectionPointA: object, 
   intersectionPointB: object, 
   normalRadians: object): number;

定义于: model/BoundingBoxData.ts:78

检查边界框是否与特定线段相交。(本地坐标系)

参数

参数类型
xAnumber
yAnumber
xBnumber
yBnumber
intersectionPointA{ x: number; y: number; }
intersectionPointA.xnumber
intersectionPointA.ynumber
intersectionPointB{ x: number; y: number; }
intersectionPointB.xnumber
intersectionPointB.ynumber
normalRadians{ x: number; y: number; }
normalRadians.xnumber
normalRadians.ynumber

返回

number


returnToPool()

ts
returnToPool(): void;

定义于: core/BaseObject.ts:167

清除该实例的所有数据并将其返还对象池。

返回

void

继承自

BaseObject.returnToPool


borrowObject()

ts
static borrowObject<T>(objectConstructor: () => T): T;

定义于: core/BaseObject.ts:136

从对象池中获取特定类的实例。

类型参数

类型参数
T extends BaseObject

参数

参数类型描述
objectConstructor() => T特定的类。

返回

T

继承自

BaseObject.borrowObject


clearPool()

ts
static clearPool(objectConstructor: typeof BaseObject): void;

定义于: core/BaseObject.ts:111

清除特定对象池的缓存实例。

参数

参数类型默认值描述
objectConstructortypeof BaseObjectnull特定的类。 (不设置则清除所有缓存的实例)

返回

void

继承自

BaseObject.clearPool


setMaxCount()

ts
static setMaxCount(objectConstructor: typeof BaseObject, maxCount: number): void;

定义于: core/BaseObject.ts:72

设置特定对象池的最大缓存数量。

参数

参数类型描述
objectConstructortypeof BaseObject特定的类。 (不设置则设置所有对象池的最大缓存数量)
maxCountnumber最大缓存数量。

返回

void

继承自

BaseObject.setMaxCount


toString()

ts
static toString(): string;

定义于: core/BaseObject.ts:56

返回

string

继承自

BaseObject.toString

Released under the MIT License.