UNPKG

@react-three/p2

Version:

2D physics based hooks for react-three-fiber

32 lines (31 loc) 861 B
import { AABB, EventEmitter } from 'p2-es'; import type { Body, World } from 'p2-es'; import type { Duplet } from './'; export declare type RaycastControllerOptns = { world: World; body: Body; collisionMask?: number; skinWidth?: number; dstBetweenRays?: number; }; export default class RaycastController extends EventEmitter { world: World; body: Body; bounds: AABB; collisionMask: number; skinWidth: number; dstBetweenRays: number; horizontalRayCount: number; verticalRayCount: number; horizontalRaySpacing: number; verticalRaySpacing: number; raycastOrigins: { topLeft: Duplet; topRight: Duplet; bottomLeft: Duplet; bottomRight: Duplet; }; constructor(options: RaycastControllerOptns); updateRaycastOrigins(): void; calculateRaySpacing(): void; }