mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
b3e3ff2b3c
* move declaration files into @types; adapt sampler interface; fix compiler error * typing asset/raw-asset * compiler errors * delete asset.d.ts * change tsconfig-gendecls.json * fix
27 lines
838 B
TypeScript
27 lines
838 B
TypeScript
import { Vec3 } from '../../core/value-types';
|
|
import { BoxShapeBase, ICreateBodyOptions, PhysicsWorldBase, RigidBodyBase, SphereShapeBase } from './api';
|
|
import { BoxShape, PhysicsWorld, RigidBody, SphereShape } from './impl-selector';
|
|
import { RaycastResult } from './raycast-result';
|
|
|
|
export function createPhysicsWorld (): PhysicsWorldBase {
|
|
return new PhysicsWorld();
|
|
}
|
|
|
|
export function createRigidBody (options?: ICreateBodyOptions): RigidBodyBase {
|
|
return new RigidBody(options);
|
|
}
|
|
|
|
export function createBoxShape (size: Vec3): BoxShapeBase {
|
|
return new BoxShape(size);
|
|
}
|
|
|
|
export function createSphereShape (radius: number): SphereShapeBase {
|
|
return new SphereShape(radius);
|
|
}
|
|
|
|
export function createRaycastResult (): RaycastResult {
|
|
return new RaycastResult();
|
|
}
|
|
|
|
cc.createRaycastResult = createRaycastResult;
|