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