mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 09:32:38 +08:00
87c6b9bda4
* basic physics abstract spec * spec tweaks * stash * cannon refactor * builtin refactor * cannon wrapper & framework tweaks * hiding, wait for 1.0.3 * delete unneed code * export CANNON * rebase * rename stash * rename I-rigid-body to i-rigid-body * stash * stash * cannon refactor * cannon wrapper & framework tweaks * remve unneeded code * wrap,....hack * demo impl * stash * stash, complete dynamics update * dynamic update center * stash, size + center * tweaks, fix share trigger shape * tweaks * stash * ammo events stash * tweaks * stash * complete ammo events * tweaks * stash * body property, stash * body , stash... * tweaks * tweaks * tweaks * ammo tweaks * stash * stash * tweaks * tweaks * stash,complete tirgger,body、 ghost etc. * tweaks * remove unneeded code * fix api of angluar velocity * physic material for single body for now * ray test stash * stash * update ammo version * impl raycast * impl group mask * update ammo version * update ammo package * add onDestroy to ammo rigid body * add protected for temporary * fix allow sleep * remove unneed code * shape tweaks * stash * rename spahe to shape * tweaks * fix damping * adapt * reset state after disable & enable * export ammo.js * Revert "cannon wrapper & framework tweaks" This reverts commit e59ea98c0bd8c23b23e9ee428ddce45d0271f1eb. * update @cocos/ammo version * fix applyLocalTorque * tweaks * beta version * fix import i-rigid-body * delete unused file * Specification function name
37 lines
1.3 KiB
TypeScript
37 lines
1.3 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';
|
|
|
|
// Ammo
|
|
import { AmmoRigidBody } from '../ammo/ammo-rigid-body';
|
|
import { AmmoWorld } from '../ammo/ammo-world';
|
|
import { AmmoBoxShape } from '../ammo/shapes/ammo-box-shape';
|
|
import { AmmoSphereShape } from '../ammo/shapes/ammo-sphere-shape';
|
|
|
|
export let BoxShape: typeof CannonBoxShape | typeof BuiltinBoxShape | typeof AmmoBoxShape;
|
|
export let SphereShape: typeof CannonSphereShape | typeof BuiltinSphereShape | typeof AmmoSphereShape;
|
|
export let RigidBody: typeof CannonRigidBody | null | typeof AmmoRigidBody;
|
|
export let PhysicsWorld: typeof CannonWorld | typeof BuiltInWorld | typeof AmmoWorld;
|
|
|
|
export function instantiate (
|
|
boxShape: typeof BoxShape,
|
|
sphereShape: typeof SphereShape,
|
|
body: typeof RigidBody,
|
|
world: typeof PhysicsWorld) {
|
|
BoxShape = boxShape;
|
|
SphereShape = sphereShape;
|
|
RigidBody = body;
|
|
PhysicsWorld = world;
|
|
}
|