diff --git a/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts b/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts index 841c2aa3fea..d696bdaef76 100644 --- a/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts +++ b/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts @@ -26,7 +26,7 @@ import { B2, B2ObjectType, addImplPtrReference, addImplPtrReferenceWASM, getImpl import { IJoint2D } from '../../spec/i-physics-joint'; import { Joint2D, PhysicsSystem2D, RigidBody2D } from '../../framework'; import { B2PhysicsWorld } from '../physics-world'; -import { Vec2, warn } from '../../../core'; +import { warn } from '../../../core'; export class B2Joint implements IJoint2D { get impl (): B2.Joint | null { diff --git a/cocos/physics-2d/box2d-wasm/physics-contact.ts b/cocos/physics-2d/box2d-wasm/physics-contact.ts index d275f9a908d..25632a4f3fa 100644 --- a/cocos/physics-2d/box2d-wasm/physics-contact.ts +++ b/cocos/physics-2d/box2d-wasm/physics-contact.ts @@ -28,7 +28,6 @@ import { PHYSICS_2D_PTM_RATIO } from '../framework/physics-types'; import { Collider2D, Contact2DType, PhysicsSystem2D } from '../framework'; import { B2Shape2D } from './shapes/shape-2d'; import { IPhysics2DContact, IPhysics2DImpulse, IPhysics2DManifoldPoint, IPhysics2DWorldManifold } from '../spec/i-physics-contact'; -import { B2PhysicsWorld } from './physics-world'; const pools: PhysicsContact[] = []; diff --git a/cocos/physics-2d/box2d-wasm/physics-world.ts b/cocos/physics-2d/box2d-wasm/physics-world.ts index 56d5e1a2370..07882428b10 100644 --- a/cocos/physics-2d/box2d-wasm/physics-world.ts +++ b/cocos/physics-2d/box2d-wasm/physics-world.ts @@ -26,7 +26,7 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { B2, getImplPtr, addImplPtrReference, addImplPtrReferenceWASM, getTSObjectFromWASMObjectPtr, removeImplPtrReference, removeImplPtrReferenceWASM, B2ObjectType } from './instantiated'; import { IPhysicsWorld } from '../spec/i-physics-world'; -import { IVec2Like, Vec3, Quat, toRadian, Vec2, toDegree, Rect, CCObject, js } from '../../core'; +import { IVec2Like, Vec3, Quat, Vec2, toDegree, Rect, CCObject, js } from '../../core'; import { PHYSICS_2D_PTM_RATIO, ERaycast2DType, ERigidBody2DType } from '../framework/physics-types'; import { Canvas } from '../../2d/framework'; import { Graphics } from '../../2d/components'; @@ -45,7 +45,6 @@ import { director } from '../../game'; const tempVec3 = new Vec3(); const tempVec2_1 = new Vec2(); const tempVec2_2 = new Vec2(); -const tempB2Vec2_1 = { x: 0, y: 0 }; // const tempB2AABB = null;//new B2.AABB(); diff --git a/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts b/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts index 088620079c3..590c4a34643 100644 --- a/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts +++ b/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts @@ -22,9 +22,6 @@ THE SOFTWARE. */ -import { B2 } from '../instantiated'; -import { js, warn } from '../../../core'; - export class PhysicsContactListener { static _BeginContact: Function | null = null; static _EndContact: Function | null = null; diff --git a/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts b/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts index e8d3f81417c..b9022eb0096 100644 --- a/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts +++ b/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts @@ -23,7 +23,7 @@ */ import { B2, b2Mul } from '../instantiated'; -import { Color, warn } from '../../../core'; +import { Color } from '../../../core'; import { PHYSICS_2D_PTM_RATIO } from '../../framework'; import { Graphics } from '../../../2d'; diff --git a/cocos/physics-2d/box2d-wasm/rigid-body.ts b/cocos/physics-2d/box2d-wasm/rigid-body.ts index 092b851ffaf..7305e878928 100644 --- a/cocos/physics-2d/box2d-wasm/rigid-body.ts +++ b/cocos/physics-2d/box2d-wasm/rigid-body.ts @@ -27,11 +27,11 @@ import { IRigidBody2D } from '../spec/i-rigid-body'; import { RigidBody2D } from '../framework/components/rigid-body-2d'; import { PhysicsSystem2D } from '../framework/physics-system'; import { B2PhysicsWorld } from './physics-world'; -import { Vec2, toRadian, Vec3, Quat, IVec2Like, toDegree, TWO_PI, HALF_PI } from '../../core'; +import { Vec2, toRadian, Vec3, Quat, IVec2Like, TWO_PI, HALF_PI } from '../../core'; import { PHYSICS_2D_PTM_RATIO, ERigidBody2DType } from '../framework/physics-types'; import { Node } from '../../scene-graph/node'; -import { Collider2D, Joint2D } from '../framework'; +import { Collider2D } from '../framework'; import { B2Shape2D } from './shapes/shape-2d'; import { B2Joint } from './joints/joint-2d'; diff --git a/cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts b/cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts index b32d55b5ba6..b72067c6db1 100644 --- a/cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts +++ b/cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts @@ -30,7 +30,6 @@ import { IBoxShape } from '../../spec/i-physics-shape'; import { Vec2, Rect } from '../../../core'; const tempAabb = new Rect(); -const tempB2Vec2_1 = { x: 0, y: 0 }; export class B2BoxShape extends B2Shape2D implements IBoxShape { _worldPoints: Vec2[] = [new Vec2(), new Vec2(), new Vec2(), new Vec2()]; diff --git a/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts b/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts index 8bd31e5be25..af88d89e119 100644 --- a/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts +++ b/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts @@ -28,7 +28,7 @@ import * as PolygonPartition from '../../framework/utils/polygon-partition'; import { PolygonCollider2D } from '../../framework'; import { PHYSICS_2D_PTM_RATIO } from '../../framework/physics-types'; import { IPolygonShape } from '../../spec/i-physics-shape'; -import { Vec2, IVec2Like, warn } from '../../../core'; +import { Vec2, warn } from '../../../core'; export class B2PolygonShape extends B2Shape2D implements IPolygonShape { _worldPoints: Vec2[] = []; diff --git a/cocos/physics-2d/box2d/joints/joint-2d.ts b/cocos/physics-2d/box2d/joints/joint-2d.ts index 9cf1d9b7087..1f62c14142c 100644 --- a/cocos/physics-2d/box2d/joints/joint-2d.ts +++ b/cocos/physics-2d/box2d/joints/joint-2d.ts @@ -26,7 +26,6 @@ import b2 from '@cocos/box2d'; import { IJoint2D } from '../../spec/i-physics-joint'; import { Joint2D, PhysicsSystem2D, RigidBody2D } from '../../framework'; import { b2PhysicsWorld } from '../physics-world'; -import { Vec2 } from '../../../core'; export class b2Joint implements IJoint2D { get impl (): b2.Joint | null { diff --git a/cocos/physics-2d/box2d/joints/relative-joint.ts b/cocos/physics-2d/box2d/joints/relative-joint.ts index 510cc125a1e..aaee57c899b 100644 --- a/cocos/physics-2d/box2d/joints/relative-joint.ts +++ b/cocos/physics-2d/box2d/joints/relative-joint.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import b2, { MotorJointDef, Vec2 } from '@cocos/box2d'; +import b2, { Vec2 } from '@cocos/box2d'; import { IRelativeJoint } from '../../spec/i-physics-joint'; import { b2Joint } from './joint-2d'; import { RelativeJoint2D } from '../../framework'; diff --git a/cocos/physics-2d/box2d/physics-world.ts b/cocos/physics-2d/box2d/physics-world.ts index 1a0a748ba9e..d1ffc8df3a1 100644 --- a/cocos/physics-2d/box2d/physics-world.ts +++ b/cocos/physics-2d/box2d/physics-world.ts @@ -26,11 +26,8 @@ import b2 from '@cocos/box2d'; import { EDITOR_NOT_IN_PREVIEW, TEST } from 'internal:constants'; import { IPhysicsWorld } from '../spec/i-physics-world'; -import { IVec2Like, Vec3, Quat, toRadian, Vec2, toDegree, Rect, CCObject, js } from '../../core'; +import { IVec2Like, Vec3, Quat, Vec2, toDegree, Rect, CCObject, js } from '../../core'; import { PHYSICS_2D_PTM_RATIO, ERaycast2DType, ERigidBody2DType } from '../framework/physics-types'; -// import { Canvas } from '../../2d/framework'; -// import { Graphics } from '../../2d/components'; - import { b2RigidBody2D } from './rigid-body'; import { PhysicsContactListener } from './platform/physics-contact-listener'; import { PhysicsAABBQueryCallback } from './platform/physics-aabb-query-callback'; diff --git a/cocos/physics-2d/box2d/rigid-body.ts b/cocos/physics-2d/box2d/rigid-body.ts index 0e7b9357309..98920bd7665 100644 --- a/cocos/physics-2d/box2d/rigid-body.ts +++ b/cocos/physics-2d/box2d/rigid-body.ts @@ -27,12 +27,11 @@ import { IRigidBody2D } from '../spec/i-rigid-body'; import { RigidBody2D } from '../framework/components/rigid-body-2d'; import { PhysicsSystem2D } from '../framework/physics-system'; import { b2PhysicsWorld } from './physics-world'; -import { Vec2, toRadian, Vec3, Quat, IVec2Like, toDegree, TWO_PI, HALF_PI } from '../../core'; +import { Vec2, toRadian, Vec3, Quat, IVec2Like, TWO_PI, HALF_PI } from '../../core'; import { PHYSICS_2D_PTM_RATIO, ERigidBody2DType } from '../framework/physics-types'; import { Node } from '../../scene-graph/node'; import { Collider2D } from '../framework'; -import { NodeEventType } from '../../scene-graph/node-event'; const tempVec3 = new Vec3(); diff --git a/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts b/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts index ba04cec60a8..0a9097add6e 100644 --- a/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts +++ b/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts @@ -24,12 +24,11 @@ import b2 from '@cocos/box2d'; import { b2Shape2D } from './shape-2d'; -import * as PolygonSeparator from '../../framework/utils/polygon-separator'; import * as PolygonPartition from '../../framework/utils/polygon-partition'; import { PolygonCollider2D } from '../../framework'; import { PHYSICS_2D_PTM_RATIO } from '../../framework/physics-types'; import { IPolygonShape } from '../../spec/i-physics-shape'; -import { Vec2, IVec2Like } from '../../../core'; +import { Vec2 } from '../../../core'; export class b2PolygonShape extends b2Shape2D implements IPolygonShape { _worldPoints: Vec2[] = []; diff --git a/cocos/physics-2d/box2d/shapes/shape-2d.ts b/cocos/physics-2d/box2d/shapes/shape-2d.ts index 714f31c18c4..ca98f6bdf7a 100644 --- a/cocos/physics-2d/box2d/shapes/shape-2d.ts +++ b/cocos/physics-2d/box2d/shapes/shape-2d.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import b2, { Vec2 } from '@cocos/box2d'; +import b2 from '@cocos/box2d'; import { IBaseShape } from '../../spec/i-physics-shape'; import { Collider2D, PhysicsSystem2D, RigidBody2D, PHYSICS_2D_PTM_RATIO } from '../../../../exports/physics-2d-framework'; diff --git a/cocos/physics-2d/framework/components/colliders/box-collider-2d.ts b/cocos/physics-2d/framework/components/colliders/box-collider-2d.ts index 9feeda73413..f9ddd3902b2 100644 --- a/cocos/physics-2d/framework/components/colliders/box-collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/box-collider-2d.ts @@ -28,7 +28,7 @@ import { ECollider2DType } from '../../physics-types'; import { IBoxShape } from '../../../spec/i-physics-shape'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.BoxCollider2D') @help('i18n:cc.BoxCollider2D') diff --git a/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts b/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts index 4d8abd25649..1ac67569ef9 100644 --- a/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts @@ -28,7 +28,7 @@ import { ECollider2DType } from '../../physics-types'; import { ICircleShape } from '../../../spec/i-physics-shape'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.CircleCollider2D') @help('i18n:cc.CircleCollider2D') diff --git a/cocos/physics-2d/framework/components/colliders/collider-2d.ts b/cocos/physics-2d/framework/components/colliders/collider-2d.ts index dbe11aba6ad..b998b713154 100644 --- a/cocos/physics-2d/framework/components/colliders/collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/collider-2d.ts @@ -24,7 +24,7 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; -import { Vec2, Rect, _decorator, Eventify, cclegacy, tooltip, CCInteger, serializable, CCFloat, CCBoolean } from '../../../../core'; +import { Vec2, Rect, _decorator, Eventify, tooltip, serializable, CCFloat, CCBoolean } from '../../../../core'; import { PhysicsGroup } from '../../../../physics/framework/physics-enum'; import { RigidBody2D } from '../rigid-body-2d'; @@ -33,7 +33,7 @@ import { ECollider2DType } from '../../physics-types'; import { IBaseShape } from '../../../spec/i-physics-shape'; import { Component } from '../../../../scene-graph'; -const { ccclass, editable, property, type } = _decorator; +const { ccclass, editable, type } = _decorator; @ccclass('cc.Collider2D') export class Collider2D extends Eventify(Component) { diff --git a/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts b/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts index ff7a735d7f6..ab2fb523121 100644 --- a/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts @@ -28,7 +28,7 @@ import { ECollider2DType } from '../../physics-types'; import { IPolygonShape } from '../../../spec/i-physics-shape'; import { displayOrder, help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.PolygonCollider2D') @help('i18n:cc.PolygonCollider2D') diff --git a/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts b/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts index 9ae6d5f968b..668e5bce79e 100644 --- a/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts @@ -28,7 +28,7 @@ import { EJoint2DType } from '../../physics-types'; import { CCBoolean, CCFloat, Vec3, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.DistanceJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts b/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts index 96a44ebdf7f..966755b5777 100644 --- a/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts @@ -28,7 +28,7 @@ import { IFixedJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.FixedJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts b/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts index b359515fcd9..0262c69c5f8 100644 --- a/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts @@ -28,7 +28,7 @@ import { IHingeJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.HingeJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/joints/joint-2d.ts b/cocos/physics-2d/framework/components/joints/joint-2d.ts index dd4653afc0e..8834dd732af 100644 --- a/cocos/physics-2d/framework/components/joints/joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/joint-2d.ts @@ -30,7 +30,7 @@ import { EJoint2DType } from '../../physics-types'; import { createJoint } from '../../physics-selector'; import { Component } from '../../../../scene-graph'; -const { ccclass, type, property } = _decorator; +const { ccclass, type } = _decorator; @ccclass('cc.Joint2D') export class Joint2D extends Component { diff --git a/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts b/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts index 4798b1175cc..036eb3bc748 100644 --- a/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts @@ -28,7 +28,7 @@ import { EJoint2DType } from '../../physics-types'; import { CCFloat, Vec2, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.MouseJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts b/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts index 1d0845efc05..10c712ee151 100644 --- a/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts @@ -31,7 +31,7 @@ import { help, serializable, tooltip, type } from '../../../../core/data/decorat const tempVec3_1 = new Vec3(); const tempVec3_2 = new Vec3(); -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.RelativeJoint2D') @help('i18n:cc.Joint2D') @@ -104,11 +104,17 @@ export class RelativeJoint2D extends Joint2D { get linearOffset (): Vec2 { if (this._autoCalcOffset) { if (this.connectedBody) { - return Vec2.subtract(this._linearOffset, this.connectedBody.node.worldPosition as IVec2Like, - this.node.worldPosition as IVec2Like) as Vec2; + return Vec2.subtract( + this._linearOffset, +this.connectedBody.node.worldPosition as IVec2Like, +this.node.worldPosition as IVec2Like, + ) as Vec2; } else { //if connected body is not set, use scene origin as connected body - return Vec2.subtract(this._linearOffset, new Vec2(0, 0), - this.node.worldPosition as IVec2Like) as Vec2; + return Vec2.subtract( + this._linearOffset, + new Vec2(0, 0), +this.node.worldPosition as IVec2Like, + ) as Vec2; } } return this._linearOffset; diff --git a/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts b/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts index 35364eb2d1d..eb68c709d99 100644 --- a/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts @@ -29,7 +29,7 @@ import { Vec2, IVec2Like, toDegree, _decorator, CCFloat, CCBoolean } from '../.. import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; const tempVec2 = new Vec2(); -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.SliderJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts b/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts index 63e87f1e558..6326609d098 100644 --- a/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts @@ -28,7 +28,7 @@ import { EJoint2DType } from '../../physics-types'; import { CCBoolean, CCFloat, Vec3, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, property, menu } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.SpringJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts b/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts index eb352c681ad..44e07c34373 100644 --- a/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts @@ -28,7 +28,7 @@ import { IWheelJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; -const { ccclass, menu, property } = _decorator; +const { ccclass, menu } = _decorator; @ccclass('cc.WheelJoint2D') @help('i18n:cc.Joint2D') diff --git a/cocos/physics-2d/framework/components/rigid-body-2d.ts b/cocos/physics-2d/framework/components/rigid-body-2d.ts index 242b1207279..388971d51e1 100644 --- a/cocos/physics-2d/framework/components/rigid-body-2d.ts +++ b/cocos/physics-2d/framework/components/rigid-body-2d.ts @@ -31,7 +31,7 @@ import { PhysicsGroup } from '../../../physics/framework/physics-enum'; import { Component } from '../../../scene-graph'; import { help, serializable, tooltip } from '../../../core/data/decorators'; -const { property, type, menu, ccclass } = _decorator; +const { type, menu, ccclass } = _decorator; @ccclass('cc.RigidBody2D') @help('i18n:cc.RigidBody2D') diff --git a/cocos/physics/bullet/bullet-world.ts b/cocos/physics/bullet/bullet-world.ts index 75c9f206e2f..09bc2bcfe41 100644 --- a/cocos/physics/bullet/bullet-world.ts +++ b/cocos/physics/bullet/bullet-world.ts @@ -32,7 +32,7 @@ import { TriggerEventObject, CollisionEventObject, CC_V3_0, CC_V3_1, CC_V3_2, CC import { bullet2CocosVec3, cocos2BulletQuat, cocos2BulletVec3 } from './bullet-utils'; import { IRaycastOptions, IPhysicsWorld } from '../spec/i-physics-world'; import { PhysicsRayResult, PhysicsMaterial, CharacterControllerContact, EPhysicsDrawFlags } from '../framework'; -import { error, RecyclePool, Vec3, js, IVec3Like, geometry, IQuatLike, Quat, Color } from '../../core'; +import { error, RecyclePool, Vec3, js, IVec3Like, geometry, IQuatLike, Quat } from '../../core'; import { BulletContactData } from './bullet-contact-data'; import { BulletConstraint } from './constraints/bullet-constraint'; import { BulletCharacterController } from './character-controllers/bullet-character-controller'; diff --git a/cocos/physics/bullet/character-controllers/bullet-character-controller.ts b/cocos/physics/bullet/character-controllers/bullet-character-controller.ts index a1425644253..b29b029ea46 100644 --- a/cocos/physics/bullet/character-controllers/bullet-character-controller.ts +++ b/cocos/physics/bullet/character-controllers/bullet-character-controller.ts @@ -23,7 +23,7 @@ */ import { error, IVec3Like, Vec3 } from '../../../core'; -import { CharacterControllerContact, PhysicsSystem } from '../../framework'; +import { PhysicsSystem } from '../../framework'; import { CharacterController } from '../../framework/components/character-controllers/character-controller'; import { IBaseCharacterController } from '../../spec/i-character-controller'; import { BulletCache } from '../bullet-cache'; diff --git a/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts b/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts index 0a3cd59490b..b11466a25b4 100644 --- a/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts +++ b/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts @@ -26,7 +26,7 @@ import { BulletConstraint } from './bullet-constraint'; import { IConfigurableConstraint } from '../../spec/i-physics-constraint'; import { error, IVec3Like, Mat4, Quat, Vec3, toRadian } from '../../../core'; -import { ConfigurableConstraint, EConstraintMode, EConstraintType, EDriverMode, PhysicsSystem } from '../../framework'; +import { ConfigurableConstraint, EConstraintMode, EDriverMode, PhysicsSystem } from '../../framework'; import { bt } from '../instantiated'; import { BulletRigidBody } from '../bullet-rigid-body'; import { BulletCache, CC_QUAT_0, CC_QUAT_1, CC_V3_0, CC_MAT4_0, CC_V3_1 } from '../bullet-cache'; diff --git a/cocos/physics/bullet/constraints/bullet-fixed-constraint.ts b/cocos/physics/bullet/constraints/bullet-fixed-constraint.ts index 1168953a6f5..b1fa7e8789a 100644 --- a/cocos/physics/bullet/constraints/bullet-fixed-constraint.ts +++ b/cocos/physics/bullet/constraints/bullet-fixed-constraint.ts @@ -25,8 +25,8 @@ /* eslint-disable new-cap */ import { BulletConstraint } from './bullet-constraint'; import { IFixedConstraint } from '../../spec/i-physics-constraint'; -import { Quat, Vec3, Mat4 } from '../../../core'; -import { FixedConstraint, PhysicsSystem } from '../../framework'; +import { Mat4 } from '../../../core'; +import { FixedConstraint } from '../../framework'; import { BulletRigidBody } from '../bullet-rigid-body'; import { BulletCache, CC_MAT4_0, CC_QUAT_0, CC_V3_0 } from '../bullet-cache'; import { bt } from '../instantiated'; diff --git a/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts b/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts index 935fe7f4b93..b73cd2d3d72 100644 --- a/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts +++ b/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts @@ -23,7 +23,6 @@ */ import { BulletShape } from './bullet-shape'; -import { warnID } from '../../../core'; import { Mesh } from '../../../3d/assets'; import { MeshCollider } from '../../../../exports/physics-framework'; import { cocos2BulletVec3, cocos2BulletTriMesh } from '../bullet-utils'; diff --git a/cocos/physics/cannon/constraints/cannon-constraint.ts b/cocos/physics/cannon/constraints/cannon-constraint.ts index 13a2caa8857..1e0a4e856e6 100644 --- a/cocos/physics/cannon/constraints/cannon-constraint.ts +++ b/cocos/physics/cannon/constraints/cannon-constraint.ts @@ -26,8 +26,6 @@ import CANNON from '@cocos/cannon'; import { IBaseConstraint } from '../../spec/i-physics-constraint'; import { Constraint, RigidBody } from '../../framework'; import { CannonRigidBody } from '../cannon-rigid-body'; -import { getWrap } from '../../utils/util'; -import { CannonSharedBody } from '../cannon-shared-body'; (CANNON.World as any).staticBody = new CANNON.Body(); (CANNON.World as any).idToConstraintMap = {}; diff --git a/cocos/physics/cannon/constraints/cannon-lock-constraint.ts b/cocos/physics/cannon/constraints/cannon-lock-constraint.ts index c5edcd8dd3b..096803e55a3 100644 --- a/cocos/physics/cannon/constraints/cannon-lock-constraint.ts +++ b/cocos/physics/cannon/constraints/cannon-lock-constraint.ts @@ -23,7 +23,6 @@ */ import CANNON from '@cocos/cannon'; -import { IVec3Like, Vec3 } from '../../../core'; import { FixedConstraint } from '../../framework'; import { IFixedConstraint } from '../../spec/i-physics-constraint'; import { CannonConstraint } from './cannon-constraint'; diff --git a/cocos/physics/cocos/builtin-world.ts b/cocos/physics/cocos/builtin-world.ts index 6ef27c336fb..321d052a553 100644 --- a/cocos/physics/cocos/builtin-world.ts +++ b/cocos/physics/cocos/builtin-world.ts @@ -35,7 +35,6 @@ import { BuiltinRigidBody } from './builtin-rigid-body'; import { Node } from '../../scene-graph'; import { GeometryRenderer } from '../../rendering/geometry-renderer'; import { director } from '../../game'; -import { VEC3_0 } from '../utils/util'; const hitPoint = new Vec3(); const TriggerEventObject = { diff --git a/cocos/physics/framework/assets/physics-material.ts b/cocos/physics/framework/assets/physics-material.ts index 39aa39e8d49..3c209d69a76 100644 --- a/cocos/physics/framework/assets/physics-material.ts +++ b/cocos/physics/framework/assets/physics-material.ts @@ -24,7 +24,7 @@ // @ts-check -import { ccclass, editable, help, menu, range, serializable, type } from 'cc.decorator'; +import { ccclass, editable, range, serializable, type } from 'cc.decorator'; import { Asset } from '../../../asset/assets/asset'; import { CCFloat, math } from '../../../core'; diff --git a/cocos/physics/framework/components/character-controllers/box-character-controller.ts b/cocos/physics/framework/components/character-controllers/box-character-controller.ts index 8e91ba1cbea..1c121449862 100644 --- a/cocos/physics/framework/components/character-controllers/box-character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/box-character-controller.ts @@ -23,15 +23,11 @@ */ import { - ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, - tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; -import { DEBUG } from 'internal:constants'; -import { Vec3, error, warn, CCFloat } from '../../../../core'; -import { Component } from '../../../../scene-graph'; + ccclass, help, executeInEditMode, menu, executionOrder, + tooltip, type, serializable } from 'cc.decorator'; +import { Vec3, CCFloat } from '../../../../core'; import { IBoxCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; -import { selector, createCharacterController } from '../../physics-selector'; -import { PhysicsSystem } from '../../physics-system'; import { CharacterController } from './character-controller'; const v3_0 = new Vec3(0, 0, 0); diff --git a/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts b/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts index e08f9fd95d0..ec329e70096 100644 --- a/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts @@ -23,15 +23,11 @@ */ import { - ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, - tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; -import { DEBUG } from 'internal:constants'; -import { Vec3, error, warn, CCFloat } from '../../../../core'; -import { Component } from '../../../../scene-graph'; + ccclass, help, executeInEditMode, menu, executionOrder, + tooltip, type, serializable } from 'cc.decorator'; +import { Vec3, CCFloat } from '../../../../core'; import { ICapsuleCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; -import { selector, createCharacterController } from '../../physics-selector'; -import { PhysicsSystem } from '../../physics-system'; import { CharacterController } from './character-controller'; const v3_0 = new Vec3(0, 0, 0); diff --git a/cocos/physics/framework/components/character-controllers/character-controller.ts b/cocos/physics/framework/components/character-controllers/character-controller.ts index 6f455bb709e..6f76f4fb21e 100644 --- a/cocos/physics/framework/components/character-controllers/character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/character-controller.ts @@ -30,13 +30,10 @@ import { Vec3, warn, CCFloat, Eventify } from '../../../../core'; import { Component } from '../../../../scene-graph'; import { IBaseCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; -import { CharacterCollisionEventType, CharacterTriggerEventType, TriggerEventType } from '../../physics-interface'; +import { CharacterCollisionEventType, CharacterTriggerEventType } from '../../physics-interface'; import { selector, createCharacterController } from '../../physics-selector'; import { PhysicsSystem } from '../../physics-system'; -const v3_0 = new Vec3(0, 0, 0); -const scaledCenter = new Vec3(0, 0, 0); - type Callback = (...args: any[]) => any; /** diff --git a/cocos/physics/framework/components/constraints/fixed-constraint.ts b/cocos/physics/framework/components/constraints/fixed-constraint.ts index 653735d7593..6a515c5d995 100644 --- a/cocos/physics/framework/components/constraints/fixed-constraint.ts +++ b/cocos/physics/framework/components/constraints/fixed-constraint.ts @@ -33,7 +33,7 @@ import { } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { Constraint } from './constraint'; -import { CCFloat, IVec3Like, Vec3 } from '../../../../core'; +import { CCFloat } from '../../../../core'; import { EConstraintType } from '../../physics-enum'; import { IFixedConstraint } from '../../../spec/i-physics-constraint'; diff --git a/cocos/physics/framework/physics-system.ts b/cocos/physics/framework/physics-system.ts index e83c672d0aa..3499e7d4ec6 100644 --- a/cocos/physics/framework/physics-system.ts +++ b/cocos/physics/framework/physics-system.ts @@ -33,7 +33,6 @@ import { CollisionMatrix } from './collision-matrix'; import { PhysicsGroup } from './physics-enum'; import { constructDefaultWorld, IWorldInitData, selector } from './physics-selector'; import { assetManager, builtinResMgr } from '../../asset/asset-manager'; -import { Collider } from './components/colliders/collider'; cclegacy.internal.PhysicsGroup = PhysicsGroup; diff --git a/cocos/physics/physx/joints/physx-configurable-joint.ts b/cocos/physics/physx/joints/physx-configurable-joint.ts index 1b93a44d365..f8f881dede1 100644 --- a/cocos/physics/physx/joints/physx-configurable-joint.ts +++ b/cocos/physics/physx/joints/physx-configurable-joint.ts @@ -34,7 +34,6 @@ import { PhysXJoint } from './physx-joint'; const CC_V3_0 = new Vec3(); const CC_V3_1 = new Vec3(); const CC_QUAT_0 = new Quat(); -const CC_QUAT_1 = new Quat(); const CC_MAT4_0 = new Mat4(); function getConstraintFlag (v: EConstraintMode): any {