Skip to content

1.基于 Box2D JSB 的2D物理系统 结束碰撞但不回调 2.回调个数BeginContact和EndContact不一致。#89

Merged
star-e merged 3 commits intococos:v4.0.0from
tangkaikk:400fixOnEndContact
Mar 11, 2026
Merged

1.基于 Box2D JSB 的2D物理系统 结束碰撞但不回调 2.回调个数BeginContact和EndContact不一致。#89
star-e merged 3 commits intococos:v4.0.0from
tangkaikk:400fixOnEndContact

Conversation

@tangkaikk
Copy link
Copy Markdown
Contributor

Re: #

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.

@tangkaikk tangkaikk requested review from bofeng-song and star-e March 4, 2026 03:59
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1010366 bytes 1010366 bytes ✅ 0 bytes
2D All (legacy pipeline) 2676058 bytes 2676058 bytes ✅ 0 bytes
2D All (new pipeline) 2767796 bytes 2767796 bytes ✅ 0 bytes
(2D + 3D) All 10024822 bytes 10024976 bytes ⚠️ +154 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16844473 bytes 16844627 bytes ⚠️ +154 bytes

Interface Check Report

This pull request does not change any public interfaces !

contactMap.delete(b2contact);
}

static clear (): void {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the clear API called?

Copy link
Copy Markdown
Contributor Author

@tangkaikk tangkaikk Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear function left, but there is no better way to call it. because the box2d system follow the engine utils it destroy.

c.emit(Contact2DType.END_CONTACT);

PhysicsContact.put(b2contact);
PhysicsContactManager.put(b2contact);
Copy link
Copy Markdown
Contributor

@bofeng-song bofeng-song Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When to clear b2contact?

@star-e star-e merged commit 37abbf2 into cocos:v4.0.0 Mar 11, 2026
14 checks passed
@github-actions
Copy link
Copy Markdown

@tangkaikk ❗ There was an error during the execution of the tasks. Please check the logs for more details.

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