-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {
/**
|
@cocos-robot run test cases |
@lealzhan, Please check the result of
Task Details
|
2youyou2
approved these changes
Jun 28, 2023
SantyWang
approved these changes
Jun 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re: ##15530
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: