Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[fix] refactor physics2d contact listener (#14026)" #15564

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

lealzhan
Copy link
Contributor

Re: ##15530

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@github-actions
Copy link

github-actions bot commented Jun 28, 2023

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -44675,52 +44675,13 @@
          * 同一个碰撞体上有可能会返回多个碰撞点,All 将返回所有这些碰撞点。
          */
         All = 3
     }
-    /**
-     * @en
-     * Physics2D contact event types.
-     * @zh
-     * 2D物理接触事件类型。
-     */
     export const Contact2DType: {
-        /**
-         * @en
-         * The event type of non contact.
-         * @zh
-         * 无接触的事件类型。
-         */
         None: string;
-        /**
-         * @en
-         * The event type of the contact start.
-         * @zh
-         * 开始接触的事件类型。
-         */
         BEGIN_CONTACT: string;
-        /**
-         * @en
-         * The event type of the contact stay.
-         * @zh
-         * 保持接触的事件类型。
-         */
-        STAY_CONTACT: string;
-        /**
-         * @en
-         * The event type of the contact end.
-         * @zh
-         * 结束接触的事件类型。
-         */
         END_CONTACT: string;
-        /**
-         * @deprecated Since v3.7.1, PhysicsSystem2D doesn't directly emit the contact events emitted by box2d.
-         * If you need this event, try to modify the relevant engine code(mainly PhysicsContactListener).
-         */
         PRE_SOLVE: string;
-        /**
-         * @deprecated Since v3.7.1, PhysicsSystem2D doesn't directly emit the contact events emitted by box2d.
-         * If you need this event, try to modify the relevant engine code(mainly PhysicsContactListener).
-         */
         POST_SOLVE: string;
     };
     export interface RaycastResult2D {
         collider: Collider2D;
@@ -44892,9 +44853,8 @@
          * @en Test which colliders contain the point.
          * @zh 检测给定点在哪些碰撞体内。
          */
         testAABB(rect: math.Rect): readonly Collider2D[];
-        on<TFunction extends (...any: any[]) => void>(type: string, callback: TFunction, thisArg?: any, once?: boolean): typeof callback;
     }
     /**
      * @en
      * Contact impulses for reporting.
@@ -45065,18 +45025,19 @@
         colliderB: Collider2D | null;
         /**
          * @en
          * If set disabled to true, the contact will be ignored until contact end.
+         * If you just want to disabled contact for current time step or sub-step, please use disabledOnce.
          * @zh
          * 如果 disabled 被设置为 true,那么直到接触结束此接触都将被忽略。
+         * 如果只是希望在当前时间步或子步中忽略此接触,请使用 disabledOnce 。
          */
         disabled: boolean;
         /**
          * @en
          * Disabled contact for current time step or sub-step.
          * @zh
          * 在当前时间步或子步中忽略此接触。
-         * @deprecated Since v3.8.0, disabledOnce is no longer supported.
          */
         disabledOnce: boolean;
         /**
          * @en
@@ -45495,9 +45456,8 @@
          * @zh
          * 获取碰撞体的世界坐标系下的包围盒。
          */
         get worldAABB(): Readonly<math.Rect>;
-        on<TFunction extends (...any: any[]) => void>(type: string, callback: TFunction, thisArg?: any, once?: boolean): typeof callback;
         protected _shape: __private._cocos_physics_2d_spec_i_physics_shape__IBaseShape | null;
         protected _body: RigidBody2D | null;
         protected _group: physics.PhysicsGroup;
         protected _density: number;
@@ -64610,9 +64570,8 @@
             raycast(p1: math.IVec2Like, p2: math.IVec2Like, type: ERaycast2DType, mask: number): RaycastResult2D[];
             testPoint(p: math.Vec2): readonly Collider2D[];
             testAABB(rect: math.Rect): readonly Collider2D[];
             drawDebug(): void;
-            finalizeContactEvent(): void;
         }
         export const _cocos_physics_2d_framework_physics_system__PhysicsSystem2D_base: new (...args: any[]) => System & _cocos_core_event_eventify__IEventified;
         export interface _cocos_physics_spec_i_lifecycle__ILifecycle {
             /**

@lealzhan
Copy link
Contributor Author

@cocos-robot run test cases

@github-actions
Copy link

@lealzhan, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL single-compress,Morph-Head,canvasUseRenderTex,LoadRes,layout-basic-grid,layout-basic-horizontal,rich-text-align,rich-text-long-string-truncation,mask-inverted-event,mask-type-change,mask-use-image-stencil,editbox,sharedMaterial,label-cacheMode,BuildTimeConstantsTest,label-align,rich-text-wrap,rich-text,system-font
windows PASS PASS FAIL label-cacheMode,label-align,ttf-font
ios PASS PASS PASS
android PASS PASS FAIL canvasUseRenderTex,LoadRes,deprecated,label-spacing-x,align-mode,widget-percentage,layout-basic-grid,layout-basic-horizontal,layout-grid-expand,rich-text-align,rich-text-long-string-truncation,mask-type-change,editbox,sharedMaterial,label-cacheMode,BuildTimeConstantsTest,label-align,rich-text-wrap,rich-text,system-font,ttf-font
mac PASS PASS PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants