Files
cocos4/cocos/physics-2d/spec/i-physics-shape.ts
T
yinkaile 96a735b2ff 3d v1.2 physics 2d (#7357)
* Squashed commit of the following:

add physics 2d

* @@ -205,9 +205,6 @@ export class b2PhysicsWorld implements IPhysicsWorld {

revert box2d version

* add mask param to raycast

* refine code
2020-10-12 11:49:49 +08:00

33 lines
862 B
TypeScript

/**
* @hidden
*/
import { IVec3Like } from '../../core/math/type-define';
import { Rect, Vec2 } from '../../core';
import { ILifecycle } from '../../physics/spec/i-lifecycle';
import { Collider2D, RigidBody2D } from '../../../exports/physics-2d-framework';
export interface IBaseShape extends ILifecycle {
readonly impl: any;
readonly collider: Collider2D;
readonly worldAABB: Readonly<Rect>;
// readonly attachedRigidBody: RigidBody2D | null;
initialize (v: Collider2D): void;
apply (): void;
onGroupChanged (): void;
}
export interface IBoxShape extends IBaseShape {
worldPoints: readonly Readonly<Vec2>[];
}
export interface ICircleShape extends IBaseShape {
worldPosition: Readonly<Vec2>;
worldRadius: number;
}
export interface IPolygonShape extends IBaseShape {
worldPoints: readonly Readonly<Vec2>[];
}