Skip to content

API / RectangleBoundingBoxData

类: RectangleBoundingBoxData ​

定义于: model/BoundingBoxData.ts:109

矩形边界框数据。

继承 ​

构造函数 ​

构造函数 ​

ts
new RectangleBoundingBoxData(): RectangleBoundingBoxData;

返回 ​

RectangleBoundingBoxData

继承自 ​

BoundingBoxData.constructor

属性 ​

hashCode ​

ts
readonly hashCode: number;

定义于: core/BaseObject.ts:156

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

继承自 ​

BoundingBoxData.hashCode


type ​

ts
type: BoundingBoxType;

定义于: model/BoundingBoxData.ts:44

边界框类型。

继承自 ​

BoundingBoxData.type

方法 ​

containsPoint() ​

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

定义于: model/BoundingBoxData.ts:290

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

参数 ​

参数类型
pXnumber
pYnumber

返回 ​

boolean

重写了 ​

BoundingBoxData.containsPoint


intersectsSegment() ​

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

定义于: model/BoundingBoxData.ts:304

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

参数 ​

参数类型默认值
xAnumberundefined
yAnumberundefined
xBnumberundefined
yBnumberundefined
intersectionPointA{ x: number; y: number; }null
intersectionPointA.xnumberundefined
intersectionPointA.ynumberundefined
intersectionPointB{ x: number; y: number; }null
intersectionPointB.xnumberundefined
intersectionPointB.ynumberundefined
normalRadians{ x: number; y: number; }null
normalRadians.xnumberundefined
normalRadians.ynumberundefined

返回 ​

number

重写了 ​

BoundingBoxData.intersectsSegment


returnToPool() ​

ts
returnToPool(): void;

定义于: core/BaseObject.ts:167

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

返回 ​

void

继承自 ​

BoundingBoxData.returnToPool


borrowObject() ​

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

定义于: core/BaseObject.ts:136

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

类型参数 ​

类型参数
T extends BaseObject

参数 ​

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

返回 ​

T

继承自 ​

BoundingBoxData.borrowObject


clearPool() ​

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

定义于: core/BaseObject.ts:111

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

参数 ​

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

返回 ​

void

继承自 ​

BoundingBoxData.clearPool


setMaxCount() ​

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

定义于: core/BaseObject.ts:72

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

参数 ​

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

返回 ​

void

继承自 ​

BoundingBoxData.setMaxCount


toString() ​

ts
static toString(): string;

定义于: model/BoundingBoxData.ts:110

返回 ​

string

重写了 ​

BoundingBoxData.toString

Released under the MIT License.