Files
cocos4/cocos/physics/framework/Physics-selector.ts
T
jiaxin.lai 1a99b886b6 refactor physics framework & wrapper (#5667)
* basic physics abstract spec

* spec tweaks

* stash

* cannon refactor

* builtin refactor

* cannon wrapper & framework tweaks

* cannon wrapper import tweaks

* remve unneeded code

* group mask tweaks

* hiding, wait for 1.0.3

* builtin tweaks

* delete unneed code

* export CANNON

* update @cocos/cannon to 1.0.3

* using hasTigger property

* fix remove cannon body

* rebase

* update cannon version to 1.0.4

* rename stash

* rename I-rigid-body to i-rigid-body
2019-12-13 16:00:22 +08:00

31 lines
1.0 KiB
TypeScript

/**
* @hidden
*/
// Cannon
import { CannonRigidBody } from '../cannon/cannon-rigid-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 { 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 | null;
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;
}