import { EventProxy } from '../game/event-proxy'; import { PlayerPhysics } from '../game/player-physics'; import { FRect3D } from '../math/frect3d'; import { Ball } from '../vpt/ball/ball'; import { IPhysicalData } from '../vpt/item-data'; import { Table } from '../vpt/table/table'; import { CollisionEvent } from './collision-event'; import { CollisionType } from './collision-type'; export declare abstract class HitObject { /** * Base object pointer. * * Mainly used as IFireEvents, but also as HitTarget or Primitive or Trigger or Kicker or Gate. */ obj?: EventProxy; threshold: number; hitBBox: FRect3D; elasticity: number; elasticityFalloff: number; friction: number; scatter: number; protected objType: CollisionType; isEnabled: boolean; /** * FireEvents for m_obj? */ fe: boolean; /** * currently only used to determine which HitTriangles/HitLines/HitPoints * are being part of the same Primitive element m_obj, to be able to early * out intersection traversal if primitive is flagged as not collidable */ e: boolean; abstract calcHitBBox(): void; abstract hitTest(ball: Ball, dTime: number, coll: CollisionEvent, physics: PlayerPhysics): number; abstract collide(coll: CollisionEvent, physics: PlayerPhysics): void; /** * apply contact forces for the given time interval. Ball, Spinner and Gate do nothing here, Flipper has a specialized handling * @param coll * @param dTime * @param physics * @constructor */ contact(coll: CollisionEvent, dTime: number, physics: PlayerPhysics): void; setFriction(friction: number): this; setScatter(scatter: number): this; fireHitEvent(ball: Ball): void; setElasticity(elasticity: number, elasticityFalloff?: number): this; setZ(zLow: number, zHigh: number): this; setEnabled(isEnabled: boolean): void; setType(type: CollisionType): void; doHitTest(ball: Ball, coll: CollisionEvent, physics: PlayerPhysics): void; applyPhysics(data: IPhysicalData, table: Table): void; }