mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
ab82e1b42d
* remove hidden * fix typo * fix unit-test * turn on auto fix
34 lines
789 B
TypeScript
34 lines
789 B
TypeScript
import { legacyCC } from '../../core/global-exports';
|
|
|
|
interface IPhysicsWrapperObject {
|
|
PhysicsWorld: any,
|
|
RigidBody?: any,
|
|
|
|
BoxShape: any,
|
|
CircleShape: any,
|
|
PolygonShape?: any,
|
|
|
|
DistanceJoint: any,
|
|
FixedJoint: any,
|
|
MouseJoint: any,
|
|
SpringJoint: any,
|
|
RelativeJoint: any,
|
|
SliderJoint: any,
|
|
WheelJoint: any,
|
|
HingeJoint: any,
|
|
}
|
|
|
|
type IPhysicsEngineId = 'builtin' | 'box2d' | string | undefined;
|
|
|
|
export let WRAPPER: IPhysicsWrapperObject;
|
|
|
|
export let physicsEngineId: IPhysicsEngineId;
|
|
|
|
export function select (id: IPhysicsEngineId, wrapper: IPhysicsWrapperObject) {
|
|
physicsEngineId = id;
|
|
legacyCC._global.CC_PHYSICS_2D_BUILTIN = id == 'builtin';
|
|
legacyCC._global.CC_PHYSICS_2D_BOX2D = id == 'box2d';
|
|
|
|
WRAPPER = wrapper;
|
|
}
|