From 090c8fe1b7ff5e7c91048262004d841fd292b2ca Mon Sep 17 00:00:00 2001 From: yiwenxue <15225434259xue@gmail.com> Date: Tue, 19 Sep 2023 18:10:36 +0800 Subject: [PATCH] remove useless cone twist joint --- cocos/physics/framework/deprecated.ts | 6 ------ cocos/physics/framework/physics-enum.ts | 8 -------- cocos/physics/framework/physics-selector.ts | 17 ++--------------- cocos/physics/spec/i-physics-constraint.ts | 5 ----- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/cocos/physics/framework/deprecated.ts b/cocos/physics/framework/deprecated.ts index 6a9d9519d11..fdb15eec610 100644 --- a/cocos/physics/framework/deprecated.ts +++ b/cocos/physics/framework/deprecated.ts @@ -148,12 +148,6 @@ removeProperty(RigidBody.prototype, 'RigidBody.prototype', [ }, ]); -removeProperty(EConstraintType, 'EConstraintType.prototype', [ - { - name: 'CONE_TWIST', - }, -]); - /** * Alias of [[RigidBody]] * @deprecated Since v1.2 diff --git a/cocos/physics/framework/physics-enum.ts b/cocos/physics/framework/physics-enum.ts index a84d210aa48..de4bcbc3de8 100644 --- a/cocos/physics/framework/physics-enum.ts +++ b/cocos/physics/framework/physics-enum.ts @@ -270,14 +270,6 @@ export enum EConstraintType { * 铰链约束。 */ HINGE, - /** - * @en - * Cone twist constraint. - * @zh - * 锥形扭转约束。 - * @deprecated coneTwist is deprecated, please use configurable instead - */ - CONE_TWIST, /** * @en * Fixed constraint. diff --git a/cocos/physics/framework/physics-selector.ts b/cocos/physics/framework/physics-selector.ts index 9be81501389..7bb003d67e0 100644 --- a/cocos/physics/framework/physics-selector.ts +++ b/cocos/physics/framework/physics-selector.ts @@ -26,7 +26,7 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-unsafe-return */ import { EDITOR, TEST } from 'internal:constants'; -import { IBaseConstraint, IPointToPointConstraint, IHingeConstraint, IConeTwistConstraint, IFixedConstraint, +import { IBaseConstraint, IPointToPointConstraint, IHingeConstraint, IFixedConstraint, IConfigurableConstraint } from '../spec/i-physics-constraint'; import { IBoxShape, ISphereShape, ICapsuleShape, ITrimeshShape, ICylinderShape, @@ -58,10 +58,6 @@ interface IPhysicsWrapperObject { PlaneShape?: Constructor, PointToPointConstraint?: Constructor, HingeConstraint?: Constructor, - /** - * @deprecated cone twist constraint is deprecated, please use configurable instead - */ - ConeTwistConstraint?: Constructor, FixedConstraint?: Constructor, ConfigurableConstraint?: Constructor, } @@ -236,10 +232,6 @@ enum ECheckType { // JOINT // PointToPointConstraint, HingeConstraint, - /** - * @deprecated cone twist constraint is deprecated, please use configurable instead - */ - ConeTwistConstraint, FixedConstraint, ConfigurableConstraint, // CHARACTER CONTROLLER // @@ -422,7 +414,7 @@ function initColliderProxy (): void { const CREATE_CONSTRAINT_PROXY = { INITED: false }; -interface IEntireConstraint extends IPointToPointConstraint, IHingeConstraint, IConeTwistConstraint, IFixedConstraint, IConfigurableConstraint { } +interface IEntireConstraint extends IPointToPointConstraint, IHingeConstraint, IFixedConstraint, IConfigurableConstraint { } const ENTIRE_CONSTRAINT: IEntireConstraint = { impl: null, initialize: FUNC, @@ -488,11 +480,6 @@ function initConstraintProxy (): void { return new selector.wrapper.HingeConstraint!(); }; - CREATE_CONSTRAINT_PROXY[EConstraintType.CONE_TWIST] = function createConeTwistConstraint (): IConeTwistConstraint { - if (check(selector.wrapper.ConeTwistConstraint, ECheckType.ConeTwistConstraint)) { return ENTIRE_CONSTRAINT; } - return new selector.wrapper.ConeTwistConstraint!(); - }; - CREATE_CONSTRAINT_PROXY[EConstraintType.FIXED] = function createFixedConstraint (): IFixedConstraint { if (check(selector.wrapper.FixedConstraint, ECheckType.FixedConstraint)) { return ENTIRE_CONSTRAINT; } return new selector.wrapper.FixedConstraint!(); diff --git a/cocos/physics/spec/i-physics-constraint.ts b/cocos/physics/spec/i-physics-constraint.ts index 91664b25717..ad6692b20e5 100644 --- a/cocos/physics/spec/i-physics-constraint.ts +++ b/cocos/physics/spec/i-physics-constraint.ts @@ -96,8 +96,3 @@ export interface IConfigurableConstraint extends IBaseConstraint { setBreakForce(v: number): void; setBreakTorque(v: number): void; } - -/** - * @deprecated ConeTwistConstraint is deprecated, please use ConfigurableConstraint instead - */ -export type IConeTwistConstraint = IBaseConstraint