Files
cocos4/cocos/3d/physics/impl-selector.ts
T
pandamicro 1380e46c34 Unittest (#4973)
* unit test for ts

* Fix ts-jest warnings

* Remove puppeteer for now

* fix physics define and jest config for windows

* Replace Node ref with INode ref

* Fix ci issue

* Fix

* tweak

* tweak

* Fix vscode launcher

* now physics framework export all physics component (#28)

* tweaks
2019-07-25 17:15:20 +08:00

32 lines
1.1 KiB
TypeScript

/**
* @hidden
*/
// Cannon
import { CannonRigidBody } from './cannon/cannon-body';
import { CannonWorld } from './cannon/cannon-world';
import { CannonBoxShape } from './cannon/shapes/cannon-box-shape';
import { CannonSphereShape } from './cannon/shapes/cannon-sphere-shape';
// built-in
import { BuiltInBody } from './cocos/builtin-body';
import { BuiltInWorld } from './cocos/builtin-world';
import { BuiltinBoxShape } from './cocos/shapes/builtin-box-shape';
import { BuiltinSphereShape } from './cocos/shapes/builtin-sphere-shape';
export let BoxShape: typeof CannonBoxShape | typeof BuiltinBoxShape;
export let SphereShape: typeof CannonSphereShape | typeof BuiltinSphereShape;
export let RigidBody: typeof CannonRigidBody | typeof BuiltInBody;
export let PhysicsWorld: typeof CannonWorld | typeof BuiltInWorld;
export function instantiate (
boxShape: typeof BoxShape,
sphereShape: typeof SphereShape,
body: typeof RigidBody,
world: typeof PhysicsWorld) {
BoxShape = boxShape;
SphereShape = sphereShape;
RigidBody = body;
PhysicsWorld = world;
}