mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
26 lines
805 B
TypeScript
26 lines
805 B
TypeScript
import { Vec3 } from '../../core/value-types';
|
|
import { BoxShapeBase, ICreateBodyOptions, PhysicsWorldBase, RaycastResultBase, RigidBodyBase } from './api';
|
|
import { BoxShape, PhysicsWorld, RaycastResult, RigidBody, SphereShape } from './impl-selector';
|
|
|
|
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): SphereShape {
|
|
return new SphereShape(radius);
|
|
}
|
|
|
|
export function createRaycastResult (): RaycastResultBase {
|
|
return new RaycastResult();
|
|
}
|
|
|
|
cc.createRaycastResult = createRaycastResult;
|