Files
esengine/source/src/Physics/Shapes/Shape.ts

28 lines
1021 B
TypeScript
Raw Normal View History

module es {
export abstract class Shape {
/**
* entity.position
* //
*
*/
public position: Vector2;
/**
*
* localOffset
*
*/
public center: Vector2;
/** 缓存的形状边界 内部字段 */
public bounds: Rectangle;
public abstract recalculateBounds(collider: Collider);
public abstract pointCollidesWithShape(point: Vector2): CollisionResult;
public abstract overlaps(other: Shape);
public abstract collidesWithShape(other: Shape): CollisionResult;
2020-07-23 13:25:10 +08:00
public clone(): Shape{
return ObjectUtils.clone<Shape>(this);
}
}
}