mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
9f89b0ef24
* Temp * temp * move ui core * Arrange ui and terrain * Fix import path for all modules except core * Move primitives into core * Fix debug.getError * Move audio-downloader to audio module * export game from game.ts * Migrate load-pipeline to ts * Fix core modules and cleanup * Move animation into core * Fix module exports * Fix director issue * Remove most cc.director usage * Fix ts issues * Fix issues for unit test and editor running * Revert removing deprecated import * tweaks * tweaks * Fix ci * Fix ci * Add modules in module division * Upgrade coordinates-converts-utils
31 lines
885 B
TypeScript
31 lines
885 B
TypeScript
/**
|
|
* @hidden
|
|
*/
|
|
|
|
import { Vec3 } from '../core/math';
|
|
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() as PhysicsWorldBase;
|
|
}
|
|
|
|
export function createRigidBody (options?: ICreateBodyOptions): RigidBodyBase {
|
|
return new RigidBody(options) as RigidBodyBase;
|
|
}
|
|
|
|
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;
|