import { AnyObject, Vec2 } from '../physics'; import { Box2DRigidBody } from './RigidBody'; import { Box2DJoint } from './Joint'; import { Box2DBaseJointOptions, Box2DRigidBodyOptions, Box2DWorldOptions } from './interface'; export declare class Box2DWorld { /** * 物理世界 */ protected _world: AnyObject; private _box2d; get Box2D(): AnyObject; set Box2D(value: AnyObject); get instance(): AnyObject; /**2D游戏默认单位为像素,物理默认单位为米,此值设置了像素和米的转换比率,默认50像素=1米*/ pixelRatio: number; tempVector: any; tempVector2: any; tempVector3: any; tempVector4: any; tempBodyDef: any; tempFixtureDef: any; emptyBody: any; private _tempDistanceJointDef; get tempDistanceJointDef(): any; private _tempGearJointDef; get tempGearJointDef(): any; private _tempMotorJointDef; get tempMotorJointDef(): any; private _tempMouseJointDef; get tempMouseJointDef(): any; private _tempPrismaticJointDef; get tempPrismaticJointDef(): any; private _tempPulleyJointDef; get tempPulleyJointDef(): any; private _tempRevoluteJointDef; get tempRevoluteJointDef(): any; private _tempWeldJointDef; get tempWeldJointDef(): any; private _tempWheelJointDef; get tempWheelJointDef(): any; private _velocityIterations; private _positionIterations; init({ gravity, wasm, Box2D, positioniterations, velocityIterations, }: Box2DWorldOptions): Promise; step(deltaTime: number): void; /** * 清除世界 */ clear(): void; addRigidBody(options: Box2DRigidBodyOptions): Box2DRigidBody; removeRigidBody(body: Box2DRigidBody): void; addJoint(options: Box2DBaseJointOptions): Box2DJoint; removeJoint(joint: Box2DJoint): void; setGravity(value: Vec2): void; }