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

remove useless cone twist joint #16285

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cocos/physics/framework/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ removeProperty(RigidBody.prototype, 'RigidBody.prototype', [
},
]);

removeProperty(EConstraintType, 'EConstraintType.prototype', [
{
name: 'CONE_TWIST',
},
]);

/**
* Alias of [[RigidBody]]
* @deprecated Since v1.2
Expand Down
8 changes: 0 additions & 8 deletions cocos/physics/framework/physics-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 2 additions & 15 deletions cocos/physics/framework/physics-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -58,10 +58,6 @@ interface IPhysicsWrapperObject {
PlaneShape?: Constructor<IPlaneShape>,
PointToPointConstraint?: Constructor<IPointToPointConstraint>,
HingeConstraint?: Constructor<IHingeConstraint>,
/**
* @deprecated cone twist constraint is deprecated, please use configurable instead
*/
ConeTwistConstraint?: Constructor<IConeTwistConstraint>,
FixedConstraint?: Constructor<IFixedConstraint>,
ConfigurableConstraint?: Constructor<IConfigurableConstraint>,
}
Expand Down Expand Up @@ -236,10 +232,6 @@ enum ECheckType {
// JOINT //
PointToPointConstraint,
HingeConstraint,
/**
* @deprecated cone twist constraint is deprecated, please use configurable instead
*/
ConeTwistConstraint,
FixedConstraint,
ConfigurableConstraint,
// CHARACTER CONTROLLER //
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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!();
Expand Down
5 changes: 0 additions & 5 deletions cocos/physics/spec/i-physics-constraint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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