新增tire。修改transform.Component为es.ComponentTransform

This commit is contained in:
yhh
2021-07-04 21:03:30 +08:00
parent dc3d639824
commit 77ad112f67
11 changed files with 6591 additions and 40 deletions

View File

@@ -193,7 +193,7 @@ declare module es {
* 当实体的位置改变时调用。这允许组件知道它们由于父实体的移动而移动了。
* @param comp
*/
onEntityTransformChanged(comp: transform.Component): void;
onEntityTransformChanged(comp: ComponentTransform): void;
debugRender(batcher: IBatcher): void;
/**
*当父实体或此组件启用时调用
@@ -311,7 +311,7 @@ declare module es {
readonly worldInverseTransform: Matrix2D;
readonly localToWorldTransform: Matrix2D;
readonly worldToLocalTransform: Matrix2D;
onTransformChanged(comp: transform.Component): void;
onTransformChanged(comp: ComponentTransform): void;
setParent(parent: Entity): any;
setParent(parent: Transform): any;
setPosition(x: number, y: number): this;
@@ -760,14 +760,12 @@ declare module es {
getEntityProcessor<T extends EntitySystem>(type: new (...args: any[]) => T): T;
}
}
declare module transform {
enum Component {
declare module es {
enum ComponentTransform {
position = 0,
scale = 1,
rotation = 2
}
}
declare module es {
enum DirtyType {
clean = 0,
positionDirty = 1,
@@ -1390,7 +1388,7 @@ declare module es {
setShouldColliderScaleAndRotateWithTransform(shouldColliderScaleAndRotationWithTransform: boolean): Collider;
onAddedToEntity(): void;
onRemovedFromEntity(): void;
onEntityTransformChanged(comp: transform.Component): void;
onEntityTransformChanged(comp: ComponentTransform): void;
onEnabled(): void;
onDisabled(): void;
/**
@@ -1517,7 +1515,7 @@ declare module es {
color: Color;
renderLayer: number;
protected _renderLayer: number;
onEntityTransformChanged(comp: transform.Component): void;
onEntityTransformChanged(comp: ComponentTransform): void;
localOffset: es.Vector2;
setLocalOffset(offset: es.Vector2): this;
isVisible: boolean;
@@ -1878,7 +1876,7 @@ declare module es {
*/
getComponents(typeName: any, components?: any[]): any[];
update(): void;
onEntityTransformChanged(comp: transform.Component): void;
onEntityTransformChanged(comp: ComponentTransform): void;
onEntityEnabled(): void;
onEntityDisabled(): void;
debugRender(batcher: IBatcher): void;
@@ -4191,6 +4189,11 @@ declare module es {
pinParticleAtIndex(index: number): LineSegments;
}
}
declare module es {
class Tire extends Composite {
constructor(origin: Vector2, radius: number, segments: number, spokeStiffness?: number, treadStiffness?: number);
}
}
declare module es {
abstract class Constraint {
composite: Composite;