mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
4bc2739786
* Vmath (#4895) * vmath refactor * value-type API change * vmath change update * conflict fix * value types change * translate modify (#4917) * value types bug fixed (#4940) * playground update (#4946) * bug fixed * bug fixed * bug fixed * bug fix * util modify * create remove & ccenum rename * export by cc.math * Rename value-types to math * util funtion deprecated warn * value-types change * color test fix * color API change
31 lines
888 B
TypeScript
31 lines
888 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;
|