mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
1380e46c34
* 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
32 lines
1.1 KiB
TypeScript
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;
|
|
}
|